Jump to content

Home

Conditional Script for a Script?


Would you download a mod that adds weapons in the escape pod?  

8 members have voted

  1. 1. Would you download a mod that adds weapons in the escape pod?

    • Yes
      2
    • No
      2
    • Maybe if they weren't useless ones
      4


Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...