Jump to content


Photo

Fair Strides' Script Shack


  • Please log in to reply
111 replies to this topic

#61 Kexikus

Kexikus

    Jedi Master

  • Members
  • PipPipPipPipPip
  • 1,373 posts

Posted 31 May 2017 - 06:14 PM

Ok, cool, I thought GetIsObjectValid was to test if it was an existing object. That's even shorter than I thought was needed. I'll try that, many thanks!

 

It is a way to test for an existing object. But it really only checks that specific object and returns TRUE if it exists and FALSE if it doesn't. So checking if the object is NOT valid asks: "Is this item NOT in the player's inventory."



#62 Fair Strides

Fair Strides

    Aurora Engine Operator

  • Administrators
  • 2,207 posts
  • LocationOregon, USA

Posted 01 June 2017 - 03:55 AM

Thanks for helping Effix out, Kex. I'm not always around, so it's nice that people don't have to wait too long.


(By the way, if you ever want to ask about one of the quotes, feel free to send me a PM)

 

My personal, made-up quote: "To know is good, but to act is better."

"Words are just words, thoughts thoughts, but actions...actions are progress." - Fair Strides

"Intelligence and respect are all it takes to get along fine. Not a bad trade off, huh?" - EwigD from GameFaqs

"And regarding butchering the language, I have been to the internet. The language is well butchered regularly." - Malkior

 

"You can either live with the lies or die with the truth. Who would rather lie to live than die for telling the truth?" - Fair Strides


#63 Reztea

Reztea

    Jedi Apprentice

  • Members
  • PipPip
  • 48 posts
  • LocationFlorida, USA

Posted 11 June 2017 - 11:45 PM

Oh wow, I haven't needed help in a whole month, yay me. Okay, so I have currently have two booleans

" Recruit_Atris_E " (Recruited Evil Atris)

" Recruit_Atris_G " (Recruited Good Atris)

 

Here's the script I used to inject the Booleans:

 

 

  void main() 

 
{
 
 // Once you have done the script, select the boolean to be true.
 SetGlobalBoolean("RECRUIT_ATRIS_E",TRUE);
}

 

void main() 

 
{
 
 // Once you have done the script, select the boolean to be true.
 SetGlobalBoolean("RECRUIT_ATRIS_G",TRUE);
}

 Here's where the issue lies, I am currently in a dialog where the party confronts Kreia. I made a separate version of the dialog that should only come available after recruiting Evil Atris. The conditional script I am using to check if the Boolean returned true so the dialog will be used is:

 

int StartingConditional() 

{
  int iResult;
 
  iResult = ((GetGlobalBoolean( "Recruit_Atris_E" ) == TRUE) );
 
  return iResult;  
 
}

 The conditional script also is not placed on a dialogue option from the PC, but from an NPC entry. Any suggestions? Thanks.



#64 Kexikus

Kexikus

    Jedi Master

  • Members
  • PipPipPipPipPip
  • 1,373 posts

Posted 12 June 2017 - 05:37 AM

The scripts are fine so we'll need a description of your actual issue to help you out.



#65 bead-v

bead-v

    Evil Malachor Overlord

  • Premium Member
  • 370 posts
  • LocationSlovenia

Posted 12 June 2017 - 06:36 AM

Try this instead:

int StartingConditional() 
{
    return GetGlobalBoolean("Recruit_Atris_E");
}


#66 Reztea

Reztea

    Jedi Apprentice

  • Members
  • PipPip
  • 48 posts
  • LocationFlorida, USA

Posted 12 June 2017 - 08:41 PM

 

Try this instead:

int StartingConditional() 
{
    return GetGlobalBoolean("Recruit_Atris_E");
}

Didn't work unfortunately.

 

Here's the exact problem, I put the conditional script "SeeRecruitE" on this node.

DwohHAcrRCilnsaRFLVJjA.png

 

I put the conditional script "SeeRecruitG" for good Atris on this node.

tQytlVgvSVuP_KVr1D8Iow.png

And I made a copy of the same node for Good Atris' conditional.. in case you don't have Atris at all..

zhl2hYpbRmWgp7U6UufTuw.png

This whole Boolean situation is so tiring, I feel like ripping my head off. 



#67 bead-v

bead-v

    Evil Malachor Overlord

  • Premium Member
  • 370 posts
  • LocationSlovenia

Posted 12 June 2017 - 08:49 PM

I just checked both your posts, it seems like you never mentioned what actually goes wrong, ie. what actually happens with your current setup :lol:

 

Anyway, I think I've had trouble in the past with using replies for directing cutscene flow like that, I don't remember the details, but you could try putting the scripts onto entry nodes instead.



#68 Reztea

Reztea

    Jedi Apprentice

  • Members
  • PipPip
  • 48 posts
  • LocationFlorida, USA

Posted 12 June 2017 - 08:54 PM

I just checked both your posts, it seems like you never mentioned what actually goes wrong, ie. what actually happens with your current setup :lol:

 

Anyway, I think I've had trouble in the past with using replies for directing cutscene flow like that, I don't remember the details, but you could try putting the scripts onto entry nodes instead.

Oh sorry, Well the game chooses the dialog with no conditional, I don't know why! I put both my booleans in the Globalcat file.

Row 999 = Recruit_Atris_E

Row 1000 = Recruit_Atris_G.

I made sure I used the correct set scripts, and conditions! I'm super confused. I'll attempt using entries, Let's hope it works.

 

EDIT: No dice, seems like me and Booleans just aren't friends.



#69 bead-v

bead-v

    Evil Malachor Overlord

  • Premium Member
  • 370 posts
  • LocationSlovenia

Posted 12 June 2017 - 09:33 PM

Okay, so then we need to make sure the globals are set correctly in the first place.

I'm not sure whether the globals are case-sensitive, but they could be, and you're setting them in all caps, while you're getting them with only the first letter of the word capitalized. Try fixing that.



#70 Reztea

Reztea

    Jedi Apprentice

  • Members
  • PipPip
  • 48 posts
  • LocationFlorida, USA

Posted 12 June 2017 - 10:03 PM

Okay, so then we need to make sure the globals are set correctly in the first place.

I'm not sure whether the globals are case-sensitive, but they could be, and you're setting them in all caps, while you're getting them with only the first letter of the word capitalized. Try fixing that.

Tried it, didn't work... I'm curious though.... Can I use a_global_set, and c_global_set, and use the string parameter??? Let me try that and I'll be back.

 

Edit: That didn't work either. I'm about to scrap this entire project.



#71 bead-v

bead-v

    Evil Malachor Overlord

  • Premium Member
  • 370 posts
  • LocationSlovenia

Posted 12 June 2017 - 10:31 PM

I think then you need to use a_glob_bool_set or something like that, check it out in kotor tool.

 

When and how do the scripts to set the booleans fire? Maybe the problem is that those scripts never fire. To diagnose, you could include this in your setting scripts, then check your feedback screen after they're supposed to have run.
 

void main(){
    SetGlobalBoolean("Recruit_Atris_E", TRUE);

    string sMessage = "Recruit_Atris_E setting script fired! Current value: ";
    if(GetGlobalBoolean("Recruit_Atris_E")) sMessage += "TRUE";
    else sMessage += "FALSE";

    SendMessageToPC(GetFirstPC(), sMessage);
}


#72 Reztea

Reztea

    Jedi Apprentice

  • Members
  • PipPip
  • 48 posts
  • LocationFlorida, USA

Posted 12 June 2017 - 11:21 PM

 

I think then you need to use a_glob_bool_set or something like that, check it out in kotor tool.

 

When and how do the scripts to set the booleans fire? Maybe the problem is that those scripts never fire. To diagnose, you could include this in your setting scripts, then check your feedback screen after they're supposed to have run.
 

void main(){
    SetGlobalBoolean("Recruit_Atris_E", TRUE);

    string sMessage = "Recruit_Atris_E setting script fired! Current value: ";
    if(GetGlobalBoolean("Recruit_Atris_E")) sMessage += "TRUE";
    else sMessage += "FALSE";

    SendMessageToPC(GetFirstPC(), sMessage);
}

The setting scripts fire just before the dialog that says "Atris has joined your party" dialog. I got a message! It says "Recruit_Atris_E setting script fired! Current Value: FALSE" I guess I need that to be true. It's one thing on top of another



#73 bead-v

bead-v

    Evil Malachor Overlord

  • Premium Member
  • 370 posts
  • LocationSlovenia

Posted 12 June 2017 - 11:27 PM

Yeah, so then the setting of the global is failing, make sure that the globals are named EXACTLY as in globalcat.2da, and that the global variable type is set to Boolean. Also make sure you don't have another globalcat.2da lying around somewhere in an override subfolder or something.



#74 Reztea

Reztea

    Jedi Apprentice

  • Members
  • PipPip
  • 48 posts
  • LocationFlorida, USA

Posted 12 June 2017 - 11:45 PM

Yeah, so then the setting of the global is failing, make sure that the globals are named EXACTLY as in globalcat.2da, and that the global variable type is set to Boolean. Also make sure you don't have another globalcat.2da lying around somewhere in an override subfolder or something.

THAT was the problem! There was a globalcat.2da file in my movies folder O_O, I don't know how that got there! Permission to beat me up is all the way granted! thank you!



#75 bead-v

bead-v

    Evil Malachor Overlord

  • Premium Member
  • 370 posts
  • LocationSlovenia

Posted 13 June 2017 - 06:08 AM

THAT was the problem! There was a globalcat.2da file in my movies folder O_O, I don't know how that got there! Permission to beat me up is all the way granted! thank you!

lol I almost didn't mention that because I was like "what are the odds of that!" :lol:  Anyway, glad it's working now! :)



#76 Reztea

Reztea

    Jedi Apprentice

  • Members
  • PipPip
  • 48 posts
  • LocationFlorida, USA

Posted 13 June 2017 - 10:50 PM

lol I almost didn't mention that because I was like "what are the odds of that!" :lol:  Anyway, glad it's working now! :D

You saved an entire project, LOL! One final script and the entire project is COMPLETE. How would I go about delaying a conversation from happening in a script? I tried using the DelayCommand but I'm getting parameter mismatches. ( I can never make a script myself  :turned:  :turned:, here's my script.

 

void main(){

    object oNPC = GetObjectByTag("KreiaEvil");
    DelayCommand(2.0, AssignCommand(ActionStartConversation(oNPC, OBJECT_SELF, "FinalKreia"));
}

A total mess! anyway, any help is appreciated, I'm gonna work on the TSLPatcher now and hopefully I'll have an answer by the time I come back (Because I take long to do everything  :mad2: )



#77 bead-v

bead-v

    Evil Malachor Overlord

  • Premium Member
  • 370 posts
  • LocationSlovenia

Posted 14 June 2017 - 07:34 AM

I tried using the DelayCommand but I'm getting parameter mismatches.

 

Your DelayCommand() is fine, the problem is that you put the object you're assigning the action to inside ActionStartConversation() instead of AssignCommand(), and you're missing one ). Here's what it should look like:

void main(){
    object oNPC = GetObjectByTag("KreiaEvil");
    DelayCommand(2.0, AssignCommand(oNPC, ActionStartConversation(OBJECT_SELF, "FinalKreia")));
}


#78 DarthRevan101

DarthRevan101

    World's most unoriginal forum name....

  • Members
  • PipPipPipPip
  • 214 posts

Posted 01 July 2017 - 11:52 PM

Hi there, just wondering if there's a script to unequip all items from a character? 



#79 Fair Strides

Fair Strides

    Aurora Engine Operator

  • Administrators
  • 2,207 posts
  • LocationOregon, USA

Posted 02 July 2017 - 12:01 AM

Without knowing which character (whether they're an NPC, the Player, or a party member), here's something:

 

Spoiler

 

That is for KotOR 2. To make it work for KotOR 1, simply change the "iSlot <= 19;" to "iSlot <= 17;"


(By the way, if you ever want to ask about one of the quotes, feel free to send me a PM)

 

My personal, made-up quote: "To know is good, but to act is better."

"Words are just words, thoughts thoughts, but actions...actions are progress." - Fair Strides

"Intelligence and respect are all it takes to get along fine. Not a bad trade off, huh?" - EwigD from GameFaqs

"And regarding butchering the language, I have been to the internet. The language is well butchered regularly." - Malkior

 

"You can either live with the lies or die with the truth. Who would rather lie to live than die for telling the truth?" - Fair Strides


#80 DarthRevan101

DarthRevan101

    World's most unoriginal forum name....

  • Members
  • PipPipPipPip
  • 214 posts

Posted 02 July 2017 - 12:35 AM

Without knowing which character (whether they're an NPC, the Player, or a party member), here's something:

 

Spoiler

 

That is for KotOR 2. To make it work for KotOR 1, simply change the "iSlot <= 19;" to "iSlot <= 17;"

 

This is for a party member, I should've been more specific. With this script will the items go back to your inventory or just disappear?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users