LucasForums

LucasForums (http://www.lucasforums.com/index.php)
-   Holowan Laboratories (http://www.lucasforums.com/forumdisplay.php?f=324)
-   -   Conditional Script for a Script? (http://www.lucasforums.com/showthread.php?t=195265)

Mandalore_The_Great 01-21-2009 12:44 AM

Conditional Script for a Script?
 
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 01:06 AM

Quote:

Originally Posted by Mandalore_The_Great (Post 2579999)
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 01:23 AM

Do you know how to write this type of script?

Stream 01-21-2009 03:18 AM

What kind of conditional script do you need?

Mandalore_The_Great 01-21-2009 09:50 PM

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 10:10 PM

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 10:16 PM

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.

Code:

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.

Code:

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.

Code:

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 08:20 PM

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 03:58 AM

"Fx_Lightning.tpc" in "swpc_tex_tpa.erf" looks to be the one you want. ;)

Mandalore_The_Great 01-24-2009 11:09 PM

I found that one but when a guy casts it the part that's around his hand is still blue....

glovemaster 01-25-2009 07:06 AM

I think the texture for that is "fx_conjure", you might want to try editing that and seeing if that changes anything.


All times are GMT -4. The time now is 07:10 PM.

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