lfnetwork.com mark read register faq members calendar

Thread: Script: Transition From Game to Custom Mod (TSL)
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 06-24-2009, 09:46 PM   #1
gsusfrk
Rookie
 
gsusfrk's Avatar
 
Join Date: Jun 2009
Location: Waiting to stage an ambush
Posts: 40
Current Game: COD:WAW and KOTOR II
Script: Transition From Game to Custom Mod (TSL)

Hey everyone,

I've just finished my attempt at a script which will load my custom module, which is the start of my mod (for now). Here is my script:

Code:
void main()
{
    SetGlobalFadeOut(0.0, 5.0);
    SendMessageToPC(GetFirstPC(), "Faded out");
    object oClothesItem = CreateItemOnObject("a_robe_01", GetFirstPC());
    SendMessageToPC(GetFirstPC(), "Created item in inventory");
    AssignCommand(GetFirstPC(), ActionEquipItem(oClothesItem, INVENTORY_SLOT_BODY));
    SendMessageToPC(GetFirstPC(), "Equipped Item");
    object oInventItem = GetFirstItemInInventory(GetFirstPC());
    while(oInventItem != OBJECT_INVALID)
    {
        AssignCommand(GetFirstPC(), ActionTakeItem(oInventItem, GetFirstPC()));
        SendMessageToPC(GetFirstPC(), "Removed Item from inventory");
        oInventItem = GetNextItemInInventory(GetFirstPC());
    }
    DeleteJournalWorldAllEntries();
    SendMessageToPC(GetFirstPC(), "Nuked the journal");
    DelayCommand(1.0, SetGlobalFadeIn(0.0, 0.0));
    SendMessageToPC(GetFirstPC(), "Faded in");
    StartNewModule("JonathanFightModule");
}
What this does is fade the camera to black, give the "Clothes" item to the PC (I don't want him/her starting in my mod in their underwear!), force an equip of the item (so the player doesn't have to), and systematically remove everything from the player's inventory (stuff gathered from the prologue). All journal entries are deleted, the module is started, and the camera fades in from black. How'd I do? Possibly the only probable error I can find is perhaps i should move the while loop that removes everything from the inventory up before the clothes item is given and equipped. However, if, when an item is equipped, it is no longer counted as "in the inventory", this code should run fine.

My questions: Will this work? Is there a way to delete all messages, dialogue, feedback, etc. from the journal, or will the DeleteJournalWorldAllEntries command take care of that? Any improvements I can make to this script? Thanks for all input!



Last edited by gsusfrk; 06-25-2009 at 11:54 AM. Reason: Updated Code
gsusfrk is offline   you may: quote & reply,
Old 06-25-2009, 11:53 AM   #2
gsusfrk
Rookie
 
gsusfrk's Avatar
 
Join Date: Jun 2009
Location: Waiting to stage an ambush
Posts: 40
Current Game: COD:WAW and KOTOR II
Update: I seem to be having trouble with the "remove items from inventory" part of the script. Everything else works fine, except the items are not being removed from the inventory, and the journal is not being cleared. Could someone tell me what I'm doing wrong and possibly how to fix it? Thanks!


gsusfrk is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Script: Transition From Game to Custom Mod (TSL)

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:58 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.