Jump to content


Photo

Fair Strides' Script Shack


  • Please log in to reply
110 replies to this topic

#81 Fair Strides

Fair Strides

    Aurora Engine Operator

  • Administrators
  • 2,206 posts
  • LocationOregon, USA

Posted 02 July 2017 - 02:19 AM

This script will simply unequip the items, not destroy them. Also, to make it work, replace the "" in "GetObjectByTag("");" with "<tag of your party member>", only don't use the < > marks.


  • jc2 likes this

(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


#82 DarthRevan101

DarthRevan101

    World's most unoriginal forum name....

  • Members
  • PipPipPipPip
  • 214 posts

Posted 02 July 2017 - 10:33 PM

This script will simply unequip the items, not destroy them. Also, to make it work, replace the "" in "GetObjectByTag("");" with "<tag of your party member>", only don't use the < > marks.

 

Works great, thanks for the help!



#83 Hassat Hunter

Hassat Hunter

    TSLRCM / M4-78EP Developer

  • Administrators
  • 4,554 posts

Posted 06 July 2017 - 11:19 AM

@Reztea: Why are you even MAKING a script for that? Just check the boolean in the conversation using the default boolean check code? (c_glob_bool_set)

#84 DarthRevan101

DarthRevan101

    World's most unoriginal forum name....

  • Members
  • PipPipPipPip
  • 214 posts

Posted 10 July 2017 - 12:01 AM

How could I make it so that a door, after being opened, closes again after a few seconds? (For KotOR I)



#85 Kexikus

Kexikus

    Jedi Master

  • Members
  • PipPipPipPipPip
  • 1,372 posts

Posted 10 July 2017 - 07:58 AM

In a conversation for some NPC to walk through or when the player opens the door during normal gameplay?



#86 djh269

djh269

    Lurker

  • Members
  • PipPipPipPip
  • 257 posts

Posted 10 July 2017 - 12:25 PM

How could I make it so that a door, after being opened, closes again after a few seconds? (For KotOR I)

 

I used modified Manaan door scripts for my Jolees Hut mod:
 
k_pman_door04.nss (attached to the UTDs OnOpen script tab)
 

Spoiler

 
k_pman_door05.nss (attached to the UTDs OnUserDefined script tab)

 

Spoiler


#87 DarthRevan101

DarthRevan101

    World's most unoriginal forum name....

  • Members
  • PipPipPipPip
  • 214 posts

Posted 14 July 2017 - 01:56 PM

I used modified Manaan door scripts for my Jolees Hut mod:
 
k_pman_door04.nss (attached to the UTDs OnOpen script tab)
 

Spoiler

 
k_pman_door05.nss (attached to the UTDs OnUserDefined script tab)

 

Spoiler

 

Thank you!



#88 djh269

djh269

    Lurker

  • Members
  • PipPipPipPip
  • 257 posts

Posted 14 July 2017 - 02:23 PM

Thank you!


Some doors have funny animations though, especially the force cages :D

#89 N-DReW25

N-DReW25

    Little Fixer

  • Members
  • PipPipPipPipPip
  • 641 posts
  • LocationSuper Secret GenoHaradan Base

Posted 24 July 2017 - 01:07 AM

How can I make it so if my character opens a specific door it will start a conversation with an NPC on the other side of said door?



#90 Fair Strides

Fair Strides

    Aurora Engine Operator

  • Administrators
  • 2,206 posts
  • LocationOregon, USA

Posted 24 July 2017 - 05:42 AM

Assuming this "specific door" is a unique .utd file in the level and only spawned/used once in the .git file, you can attach a script to the OnOpen slot:

 

Spoiler

 

That should work for you. The local boolean stuff is just to make the conversation only activate once.


(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


#91 N-DReW25

N-DReW25

    Little Fixer

  • Members
  • PipPipPipPipPip
  • 641 posts
  • LocationSuper Secret GenoHaradan Base

Posted 27 July 2017 - 10:26 AM

Assuming this "specific door" is a unique .utd file in the level and only spawned/used once in the .git file, you can attach a script to the OnOpen slot:

 

Spoiler

 

That should work for you. The local boolean stuff is just to make the conversation only activate once.

Pretty sure I made a small mistake here, the script is not working. The only way I can actually get my NPC to speak his dialogue is to approach him and start dialogue normally. My tag of NPC is "mod_vulkar01.utc" and the dialogue is "tar03_vulkar031.dlg".

 

Here is my script

Spoiler
 
I think I may have done something wrong with my script above. I do also have a unique utd in the git so that cannot be the issue (I hope)


#92 Kexikus

Kexikus

    Jedi Master

  • Members
  • PipPipPipPipPip
  • 1,372 posts

Posted 27 July 2017 - 05:22 PM

The if condition has to be either == 0 or < 1, as the boolean is either 0 or 1, so it'll never be smaller than 0 which is why the condition is never fulfilled in your case.



#93 bead-v

bead-v

    Evil Malachor Overlord

  • Premium Member
  • 369 posts
  • LocationSlovenia

Posted 27 July 2017 - 07:04 PM

The kotor script doesn't really have a bool data type, it just uses int for it, but still, it's good to think of it separately, having either the value 'true' or 'false'.

 

Since you want the if() to pass if the boolean is false, it's best to write:

if ( !GetLocalBoolean(OBJECT_SELF, 10) ) { ... }

Or if you only want it to pass if it's true:

if ( GetLocalBoolean(OBJECT_SELF, 10) ) { ... }

For the same reason, writing this

SetLocalBoolean(OBJECT_SELF, 10, TRUE);

instead of this

SetLocalBoolean(OBJECT_SELF, 10, 1);

is better. Logically it's exactly equivalent, TRUE is defined as 1 in nwscript.nss. Using TRUE and FALSE will just help you keep the Boolean and Number functions apart in your mind, and it's more readable when you or somebody else reads the code (after a while).

 

Also, I'm not sure, but Get...Boolean() may not return 1 for when it's true, so you could get in trouble writing GetLocalBoolean() == 1 or GetLocalBoolean() == TRUE. Just keep in mind that Get...Boolean() already returns the true/false value, you don't need to == it.



#94 N-DReW25

N-DReW25

    Little Fixer

  • Members
  • PipPipPipPipPip
  • 641 posts
  • LocationSuper Secret GenoHaradan Base

Posted 30 July 2017 - 06:13 AM

I am trying to make a Seppuku cutscene where a hostile NPC will reach 1hp then a dialogue will fire and the NPC will perform a Seppuku (Stabbing themselves with a Melee Weapon) and the NPC will drop dead. With that out of the way what are the scripts, I will need to actually fulfill this cutscene?

 

I think I have the 1hp script right here but not the rest

Spoiler

Also is it possible to do a Seppuku with a Vibrosword weapon or does it have to be a Lightsaber?



#95 Fair Strides

Fair Strides

    Aurora Engine Operator

  • Administrators
  • 2,206 posts
  • LocationOregon, USA

Posted 31 July 2017 - 01:30 AM

Also, I'm not sure, but Get...Boolean() may not return 1 for when it's true, so you could get in trouble writing GetLocalBoolean() == 1 or GetLocalBoolean() == TRUE. Just keep in mind that Get...Boolean() already returns the true/false value, you don't need to == it.

The Local functions (not the global ones, mind you) will either return 0 or NOT 0, so FALSE or !FALSE. It's a weird quirk they seem to have. Mine was originally a typo on that, since the idea was to see if it was > 0, not < 0.
 

I am trying to make a Seppuku cutscene where a hostile NPC will reach 1hp then a dialogue will fire and the NPC will perform a Seppuku (Stabbing themselves with a Melee Weapon) and the NPC will drop dead. With that out of the way what are the scripts, I will need to actually fulfill this cutscene?
 
I think I have the 1hp script right here but not the rest

Also is it possible to do a Seppuku with a Vibrosword weapon or does it have to be a Lightsaber?


In the DLG file in question for that scene (852nih.dlg, second main branch), Visas plays the 1431 Meditate2 animation, assigned from the dialog file itself, not through script. Given that, I don't know if the animation is custom to her model, or the general animation.

 

As for your code, the following should do fine:

 

Spoiler

(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


#96 N-DReW25

N-DReW25

    Little Fixer

  • Members
  • PipPipPipPipPip
  • 641 posts
  • LocationSuper Secret GenoHaradan Base

Posted 31 July 2017 - 06:48 AM


In the DLG file in question for that scene (852nih.dlg, second main branch), Visas plays the 1431 Meditate2 animation, assigned from the dialog file itself, not through script. Given that, I don't know if the animation is custom to her model, or the general animation.

Kreia uses the animation during the Jedi Enclave Scene so I'll hope it's a General Animation.

 

 

 

As for your code, the following should do fine:

I forgot to mention the dialogue the NPC will mention has a conditional called 

 

Spoiler

I'll assume I'd need to change my NPC to Minimum 1hp in the Utc file in order for this to work. Two questions where will I place this new script in order for it to work and will the script need the "// Makes it so the NPC can't die." to work or is that there for the sake of direction?



#97 DarthRevan101

DarthRevan101

    World's most unoriginal forum name....

  • Members
  • PipPipPipPip
  • 214 posts

Posted 31 July 2017 - 08:42 PM

Is there a script to level up a party member? I've got a script to give them a Jedi class but it doesn't level them up once they get the class added, so they have to be levelled up in game manually. Is there a script to level up the character by 1 without affecting anyone else? (For KotOR 1)

void main()
{
AddMultiClass( CLASS_TYPE_JEDIGUARDIAN, GetObjectByTag(""));

}


#98 Guingamor

Guingamor

    Jedi Initiate

  • Registered
  • Pip
  • 5 posts

Posted 14 August 2017 - 04:57 PM

Hello! I was wondering if someone could tell me how I goofed this line of code; whenever I try to compile it it says 'Error: Syntax error at ","'.

 

Here's the specific line:

                      AssignCommand(GetObjectByTag("Juhani", 0), ActionMoveToLocation((-77.5775390625, -51.8112106323242, 0), 213.749927975663, 0), 0, 1.0);

And here's the chunk it's part of, if that's relevant:

                  else {
                    if ((nParam1 == 10)) {
                      AssignCommand(GetObjectByTag("Juhani", 0), ActionMoveToLocation((-77.5775390625, -51.8112106323242, 0), 213.749927975663, 0), 0, 1.0);
                      AssignCommand(GetObjectByTag("Bastila", 0), ActionMoveToObject(GetObjectByTag("wp_bastila_1", 0), 0, 1.0));
                    }


#99 Fair Strides

Fair Strides

    Aurora Engine Operator

  • Administrators
  • 2,206 posts
  • LocationOregon, USA

Posted 14 August 2017 - 05:21 PM

I'll assume I'd need to change my NPC to Minimum 1hp in the Utc file in order for this to work. Two questions where will I place this new script in order for it to work and will the script need the "// Makes it so the NPC can't die." to work or is that there for the sake of direction?

This script would need to go in the OnDamaged script slot. Also, you will not need to set the Minimum 1 Hp setting in the UTC file, as that's done in the script with the "SetMinOneHP" function.

And the "//" denotes a comment in the code, purely for explanation.

Is there a script to level up a party member?

No, there is no auto-level function, unfortunately. Also, you can l9ck the Party Selection screen with SetAreaUnescapable function. S value of TRUE should disable it and calling the function again with a value of FALSE should re-enable it.

Hello! I was wondering if someone could tell me how I goofed this line of code; whenever I try to compile it it says 'Error: Syntax error at ","'.

Here's the specific line:

AssignCommand(GetObjectByTag("Juhani", 0), ActionMoveToLocation((-77.5775390625, -51.8112106323242, 0), 213.749927975663, 0), 0, 1.0);
I don't have the modding tools on me at the moment to look up the functions at the moment, but I know the compiler isn't seeing a valid location and I don't think the 0 inside the location section is required...

ActionMoveToLocation(Location(Vector(-77.5775390625, -51.8112106323242, 0.0), 213.749927975663), 0, 1.0);

(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


#100 Guingamor

Guingamor

    Jedi Initiate

  • Registered
  • Pip
  • 5 posts

Posted 14 August 2017 - 05:49 PM

I don't have the modding tools on me at the moment to look up the functions at the moment, but I know the compiler isn't seeing a valid location and I don't think the 0 inside the location section is required...
 

ActionMoveToLocation(Location(Vector(-77.5775390625, -51.8112106323242, 0.0), 213.749927975663), 0, 1.0);

Thank you! But now it says the error is at ";".

 

I think these are the functions?

void ActionMoveToLocation(location lDestination, int bRun=FALSE);

location Location(vector vPosition, float fOrientation);

vector Vector(float x=0.0f, float y=0.0f, float z=0.0f);





1 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users


    Bing (1)