Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Conditional Script for a Script?

Page: 1 of 1
 Mandalore_The_Great
01-20-2009, 11:44 PM
#1
I've made a little mod that edits the .dlg for the escape pod on the Spire(end_pod, I think). I've made it so when a certain dialog branch is gone into, you get a few items.I need a conditional script but don't know how to write it, seeing as I've never needed one
 HK-42
01-21-2009, 12:06 AM
#2
I've made a little mod that edits the .dlg for the escape pod on the Spire(end_pod, I think). I've made it so when a certain dialog branch is gone into, you get a few items.I need a conditional script but don't know how to write it, seeing as I've never needed one

Ive done a similar mod. Instead editing Carths dialog.
 Mandalore_The_Great
01-21-2009, 12:23 AM
#3
Do you know how to write this type of script?
 Stream
01-21-2009, 2:18 AM
#4
What kind of conditional script do you need?
 Mandalore_The_Great
01-21-2009, 8:50 PM
#5
Just a dialogue conditional. I have an extra dlg option and after I use it I don't want it used again.
 HK-42
01-21-2009, 9:10 PM
#6
Why would you need conditionals for a dialog option? Especially if it's the escape pod dialog. Just have the branch appear after you say you want to go to Taris. Then move the warp script(should be on the final node in the dialog) To after the items. Don't give a option to return to the endar spire so they can't reselect the item node.

If you still need a dialog script I can't help you there. That isn't one of the ones I have.
 Star Admiral
01-21-2009, 9:16 PM
#7
I see two ways of doing this. There's probably more, though. One, you can set a global variable after giving the items. Two, if you plan on giving the player a specific item not found elsewhere on the Endar Spire, you can check for the presence of that item within the player's inventory.

For the first method, you'll need to edit the globalcat.2da file. Add a new Boolean variable at the end of the file. The conditional would look something like this, where xxx is the name of whatever you named your new variable.

int StartingConditional() {
if( GetGlobalBoolean( "xxx" ) == TRUE )
return FALSE;
return TRUE;
}

You'll also need to add the following line to the script that gives the player items.

SetGlobalBoolean( "xxx", TRUE );

For the second method, you'll need to make sure that of the items you give the player, there must be at least one that is not normally found on the Endar Spire, or else there might be a chance that the conditional would not work properly. This time, xxx refers to the item's tag.

int StartingConditional() {
object oItem = GetFirstItemInInventory( GetFirstPC() );
while( GetIsObjectValid( oItem ) ) {
if( GetTag( oItem ) == "xxx" )
return FALSE;
oItem = GetNextItemInInventory( GetFirstPC() );
}
return TRUE;
}

Hope this helps. :)

EDIT: The method that HK-42 proposed works well too. Saves the hassle of all the scripts. I'll leave my examples just in case you decide to use them.

- Star Admiral
 Mandalore_The_Great
01-22-2009, 7:20 PM
#8
I just thought it would be a good idea to allow you to be able to look around after. *shrug*
thanks SA, I'll save those scripts just in case. Thanks everybody
Off topic, but does anyone know where the .tpc for the force power lightning is? I mean the one that covers the caster's hand when it comes out?
 glovemaster
01-23-2009, 2:58 AM
#9
"Fx_Lightning.tpc" in "swpc_tex_tpa.erf" looks to be the one you want. ;)
 Mandalore_The_Great
01-24-2009, 10:09 PM
#10
I found that one but when a guy casts it the part that's around his hand is still blue....
 glovemaster
01-25-2009, 6:06 AM
#11
I think the texture for that is "fx_conjure", you might want to try editing that and seeing if that changes anything.
Page: 1 of 1