lfnetwork.com mark read register faq members calendar

Thread: Three scripts I need
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 09-15-2011, 08:05 AM   #1
Warlord664
Junior Member
 
Warlord664's Avatar
 
Join Date: Jun 2011
Location: Computer Desk
Posts: 320
Current Game: swtor
Contest winner - Modding 
Three scripts I need

Hey! Can some one help me out with these?


(1) I need a script that makes it trigger a conversation after you open a door.

(2) I need a script that gives you credits kinda like a quest reward.

(3) I need a script that makes one guy attack the other guy and kill him all in conversation.

Ty.
Warlord664 is offline   you may: quote & reply,
Old 09-15-2011, 08:18 AM   #2
Qui-Don Jorn
Junior Member
 
Qui-Don Jorn's Avatar
 
Join Date: Apr 2010
Location: The Fleet, where are you?
Posts: 435
Current Game: The Old Republic
Helpful! 
need more info,..
which game?
is there a specific tag for the door?
tags of the two "guys"?
Qui-Don Jorn is offline   you may: quote & reply,
Old 09-15-2011, 08:27 AM   #3
Warlord664
Junior Member
 
Warlord664's Avatar
 
Join Date: Jun 2011
Location: Computer Desk
Posts: 320
Current Game: swtor
Contest winner - Modding 
This is for TSL The two guys are npcs I put down. The door is in the refugee sector in nar shadda its tag is NarShaddaaDoor01. I believe every door in the refugee sector has that tag.
Warlord664 is offline   you may: quote & reply,
Old 09-15-2011, 08:46 AM   #4
Qui-Don Jorn
Junior Member
 
Qui-Don Jorn's Avatar
 
Join Date: Apr 2010
Location: The Fleet, where are you?
Posts: 435
Current Game: The Old Republic
Helpful! 
oh, umm.
well there is a generic a_givecredits script in the game, you can just put it in the script slot in the dialog with the amount next to it in the box..or is it actually attached to a journal quest entry? what is the tag of the journal quest entry and the id# for it?
Qui-Don Jorn is offline   you may: quote & reply,
Old 09-15-2011, 08:56 AM   #5
harIII
Veteran
 
harIII's Avatar
 
Join Date: Feb 2008
Posts: 980
Helpful! 
Here are the script you need, they should all compile because these are the generic scripts I use as templates while work on my project. Note that a lot of scripts can work in both TSL and KOTOR because they have basically the same set of functions. However TSL gives you a couple of more scripting options. Anyways, onto the scripts:

1. Conversation after Door - Attach this the OnOpen field of the door and it will fire when the door opens. Also I attached a small delay script so that the script will fire 3 seconds after the door is opened. I did this so that you would click the door and start a conversation while the door is still opening. Also I saw from your post that apparently all the doors in the area you want to use this have the same tag, that's bad, real bad, as in not breathing bad. You need to go in the .git file, find the door that you want the script to fire at (by matching up the coordinates with the whereami armband), and change the name so that it's unique. Otherwise the script will fire every time you open a door with the same tag.

Quote:
void main() {

object oNPC=GetObjectByTag("npc tag or the name of dialog if there is no npc to fire it");
ActionDoCommand(SetCommandable(TRUE,oNPC));
DelayCommand(3.0,AssignCommand (oNPC, ActionStartConversation(GetFirstPC())));

}
2. Add Credits to the PC

Quote:
void main()
{
GiveGoldToCreature(GetFirstPC(),200);

}
3. Two Guys Fight and Die - This one requires two scripts, one to fire at some point to make the guys fight and the second to kill the one you want. What's going on here is that the two characters will fight each other but you will NOT be able to intervene in the fight. What you need to do is fire the first script when you want the to characters to fight and the second when you want one of them to die.

First Script:
Quote:
void main() {
object oObject1=GetObjectByTag("first character");
object oObject2=GetObjectByTag("second character");

ChangeToStandardFaction(oObject1, 12);
ChangeToStandardFaction(oObject2, 13);

ExecuteScript("k_ai_master",oObject1,1005);
ExecuteScript("k_ai_master",oObject2,1005);

}
Second Script:
Quote:
void main() {
effect eStun = EffectDeath();
object oTarget = GetObjectByTag("tag of character to die");

ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eStun, oTarget);
}
I hope this helps, if you have any questions, yell at me.
harIII is offline   you may: quote & reply,
Old 09-15-2011, 09:00 AM   #6
Qui-Don Jorn
Junior Member
 
Qui-Don Jorn's Avatar
 
Join Date: Apr 2010
Location: The Fleet, where are you?
Posts: 435
Current Game: The Old Republic
Helpful! 
wow. yeah, what he said.
Qui-Don Jorn is offline   you may: quote & reply,
Old 09-15-2011, 09:08 AM   #7
Warlord664
Junior Member
 
Warlord664's Avatar
 
Join Date: Jun 2011
Location: Computer Desk
Posts: 320
Current Game: swtor
Contest winner - Modding 
Ty Har. But the last script I just want the one guy to swing once and kill the other guy. I wasn't planning on having a big fight with these guys. Im guessing it will still work thoguh. Not sure where two place the second script. Will I have to have the guy whos killing the other guy talking while he does it?
Warlord664 is offline   you may: quote & reply,
Old 09-15-2011, 09:22 AM   #8
harIII
Veteran
 
harIII's Avatar
 
Join Date: Feb 2008
Posts: 980
Helpful! 
If you want you could combine the two scripts together and do something like this for the second script:

Quote:
DelayCommand(5.0,ApplyEffectToObject(DURATION_TYPE _TEMPORARY,eStun, oTarget));
Just replace this with the last line of the last script and now it will happen after 5 seconds, you can change that pretty easily. Now that these two scripts are combined you can watch the fighting and then after 5 seconds the one guy will die.
harIII is offline   you may: quote & reply,
Old 09-15-2011, 09:25 AM   #9
Warlord664
Junior Member
 
Warlord664's Avatar
 
Join Date: Jun 2011
Location: Computer Desk
Posts: 320
Current Game: swtor
Contest winner - Modding 
Awesome. Ty Har.
Warlord664 is offline   you may: quote & reply,
Old 09-15-2011, 09:32 AM   #10
harIII
Veteran
 
harIII's Avatar
 
Join Date: Feb 2008
Posts: 980
Helpful! 
No worries, let me know if you need any additional help and I'll be happy to work with you.
harIII is offline   you may: quote & reply,
Old 09-15-2011, 09:37 AM   #11
Warlord664
Junior Member
 
Warlord664's Avatar
 
Join Date: Jun 2011
Location: Computer Desk
Posts: 320
Current Game: swtor
Contest winner - Modding 
Huh. I just tried the door script and it didn't work. I put the npcs name in it and put the script in the onopen area on the door.utd so I don't know what I did wrong.
Warlord664 is offline   you may: quote & reply,
Old 09-15-2011, 01:34 PM   #12
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,464
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
It is possible that you need to revert to an earlier save, one where you have not entered the module where the altered door is.


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa
Qui-Gon Glenn is offline   you may: quote & reply,
Old 09-15-2011, 03:29 PM   #13
harIII
Veteran
 
harIII's Avatar
 
Join Date: Feb 2008
Posts: 980
Helpful! 
Another option is to simply place the .git file in the override and start the game that way. The .git in the override will in a sense "reset" the level and ensure that everything you do to the module will take affect. Some changes require you to start a new game to see their affects if you've already compiled the modules. If I'm testing something I always keep the .git file and any edited/new files in the override until I'm not with that section and have to move on to the next module.
harIII is offline   you may: quote & reply,
Old 09-15-2011, 04:02 PM   #14
Warlord664
Junior Member
 
Warlord664's Avatar
 
Join Date: Jun 2011
Location: Computer Desk
Posts: 320
Current Game: swtor
Contest winner - Modding 
I already have the git file in my override. Are you guys sure theres not something wrong with the script?
Warlord664 is offline   you may: quote & reply,
Old 09-15-2011, 04:05 PM   #15
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,464
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
Post the script, as you are trying to use it. Not the one that harIII provided, but the one where you have substituted the tag you are using.


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa
Qui-Gon Glenn is offline   you may: quote & reply,
Old 09-15-2011, 04:10 PM   #16
Warlord664
Junior Member
 
Warlord664's Avatar
 
Join Date: Jun 2011
Location: Computer Desk
Posts: 320
Current Game: swtor
Contest winner - Modding 
void main() {

object oNPC=GetObjectByTag("to'ggar");
ActionDoCommand(SetCommandable(TRUE,oNPC));
DelayCommand(3.0,AssignCommand (oNPC, ActionStartConversation(GetFirstPC())));

}


Thats the script.
Warlord664 is offline   you may: quote & reply,
Old 09-15-2011, 04:20 PM   #17
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,464
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
Code:
void main()
{
   object oNPC=GetObjectByTag("to'ggar");

   ActionDoCommand(SetCommandable(TRUE,oNPC));
   DelayCommand(3.0,AssignCommand(oNPC,ActionStartConversation(GetFirstPC())));

}
Not sure if the hyphen is a valid character or not for tags.... so that may be the problem.

Otherwise, the code compiles fine. Have you placed it as the action script in the OnOpen field of the door's .utd?

If so, then I am not sure what the issue might be... maybe harIII has an idea.

For fun, you could play around with the DelayCommand.... try changing the value to a shorter time, or try it without the DelayCommand (you would need to remove the 3.0 value as well as the DelayCommand parentheses).


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa
Qui-Gon Glenn is offline   you may: quote & reply,
Old 09-15-2011, 04:33 PM   #18
Warlord664
Junior Member
 
Warlord664's Avatar
 
Join Date: Jun 2011
Location: Computer Desk
Posts: 320
Current Game: swtor
Contest winner - Modding 
Well I already have that npc in game and that was his tag so I guess hyphens work.

Yeah I placed it in the OnOpen field of the doors .utd
Warlord664 is offline   you may: quote & reply,
Old 09-15-2011, 04:57 PM   #19
harIII
Veteran
 
harIII's Avatar
 
Join Date: Feb 2008
Posts: 980
Helpful! 
Does the dialog fire when you walk up to the character and try talking with him?
harIII is offline   you may: quote & reply,
Old 09-15-2011, 05:04 PM   #20
Warlord664
Junior Member
 
Warlord664's Avatar
 
Join Date: Jun 2011
Location: Computer Desk
Posts: 320
Current Game: swtor
Contest winner - Modding 
Yeah I can walk up and talk to him like every body else. There shouldn't be any thing wrong with the dlg
Warlord664 is offline   you may: quote & reply,
Old 09-15-2011, 05:09 PM   #21
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,464
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
Ok, so try this...

Code:
void main()
{
   object oPC=GetFirstPC();
   object oTalker=GetObjectByTag("to'ggar");

   ActionDoCommand(SetCommandable(TRUE,oTalker));
   DelayCommand(3.0, AssignCommand(oTalker,ActionStartConversation(oPC,"yourdialogname",CONVERSATION_TYPE_CINEMATIC)));

}
This should, when you have substituted the name of your dialog for what is in orange above, fire the dialog immediately after opening the door.


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa

Last edited by Qui-Gon Glenn; 09-15-2011 at 05:15 PM. Reason: clarity and missing object for the PC
Qui-Gon Glenn is offline   you may: quote & reply,
Old 09-15-2011, 05:21 PM   #22
Warlord664
Junior Member
 
Warlord664's Avatar
 
Join Date: Jun 2011
Location: Computer Desk
Posts: 320
Current Game: swtor
Contest winner - Modding 
I put that into the script and then tried to compile it and then it gave me an error. Did it compile it anyway or do I need to figure out what the error is and fix it?
Warlord664 is offline   you may: quote & reply,
Old 09-15-2011, 05:42 PM   #23
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,464
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
It compiles for me with no errors, even with the generic dialog name yourdialogname...

I did edit my post a couple times... I was copy and pasting old code, and realized I had not declared a variable in my initial "try this" post. Sorry

Try what is posted now, just copy & paste it into your editor and simply replace the name of your dialog where it is highlighted orange, leaving the quotes! Then compile and blissfully admire your modmaking!


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa
Qui-Gon Glenn is offline   you may: quote & reply,
Old 09-15-2011, 05:52 PM   #24
Warlord664
Junior Member
 
Warlord664's Avatar
 
Join Date: Jun 2011
Location: Computer Desk
Posts: 320
Current Game: swtor
Contest winner - Modding 
It works! Ty QGG! Now I just need to change the delay it was a little bit too long.
Warlord664 is offline   you may: quote & reply,
Old 09-15-2011, 05:55 PM   #25
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,464
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 


Anytime.... harIII was on the money, just left out specifying the dialog to fire... his code would have worked with the addition of a comma and the dialog name and it's data type.


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa
Qui-Gon Glenn is offline   you may: quote & reply,
Old 09-15-2011, 06:43 PM   #26
Warlord664
Junior Member
 
Warlord664's Avatar
 
Join Date: Jun 2011
Location: Computer Desk
Posts: 320
Current Game: swtor
Contest winner - Modding 
Alright I just tested the credit one and it works Ty har. However the attack one doesn't seem to work. Can you guys take a look and see what I did wrong?

Quote:
void main() {
object oObject1=GetObjectByTag("to'ggar");
object oObject2=GetObjectByTag("degar");

ChangeToStandardFaction(oObject1, 12);
ChangeToStandardFaction(oObject2, 13);

ExecuteScript("k_ai_master",oObject1,1005);
ExecuteScript("k_ai_master",oObject2,1005);

DelayCommand(5.0,ApplyEffectToObject(DURATION_TYPE _TEMPORARY,eStun, oTarget));
effect eStun = EffectDeath();
object oTarget = GetObjectByTag("degar");

ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eStun, oTarget);


}
Ty.
Warlord664 is offline   you may: quote & reply,
Old 09-15-2011, 09:17 PM   #27
harIII
Veteran
 
harIII's Avatar
 
Join Date: Feb 2008
Posts: 980
Helpful! 
When you compile what does KOTOR Tool complain about?
harIII is offline   you may: quote & reply,
Old 09-15-2011, 09:41 PM   #28
Warlord664
Junior Member
 
Warlord664's Avatar
 
Join Date: Jun 2011
Location: Computer Desk
Posts: 320
Current Game: swtor
Contest winner - Modding 
Yeah it has one error when I try to compile it.
Warlord664 is offline   you may: quote & reply,
Old 09-15-2011, 10:41 PM   #29
harIII
Veteran
 
harIII's Avatar
 
Join Date: Feb 2008
Posts: 980
Helpful! 
Well I'm trying to figure out what the error SAYS! If you can tell me what it's complaining about I can walk you through it.
harIII is offline   you may: quote & reply,
Old 09-15-2011, 10:49 PM   #30
Warlord664
Junior Member
 
Warlord664's Avatar
 
Join Date: Jun 2011
Location: Computer Desk
Posts: 320
Current Game: swtor
Contest winner - Modding 
lol sorry. it says
Quote:
DegarBatt(11):Error:Syntax error at "_TEMPORARY"
EDIT

DegarBatt is the name of the script.
Warlord664 is offline   you may: quote & reply,
Old 09-16-2011, 12:03 AM   #31
harIII
Veteran
 
harIII's Avatar
 
Join Date: Feb 2008
Posts: 980
Helpful! 
Okay, I played around with your script and it boils down to the way you made it. Anyways here's a working script that should do what you want, I made sure that it compiles on my computer:

Quote:
void main() {

effect eStun = EffectDeath();
object oTarget = GetObjectByTag("degar");
object oObject1=GetObjectByTag("to'ggar");
object oObject2=GetObjectByTag("degar");

ChangeToStandardFaction(oObject1, 12);
ChangeToStandardFaction(oObject2, 13);

ExecuteScript("k_ai_master",oObject1,1005);
ExecuteScript("k_ai_master",oObject2,1005);

DelayCommand(5.0,ApplyEffectToObject(DURATION_TYPE _TEMPORARY,eStun, oTarget));

}
harIII is offline   you may: quote & reply,
Old 09-16-2011, 07:07 AM   #32
Warlord664
Junior Member
 
Warlord664's Avatar
 
Join Date: Jun 2011
Location: Computer Desk
Posts: 320
Current Game: swtor
Contest winner - Modding 
It still has an error this time it says
Quote:
DegarBatt(14):Error:Syntax error at "_TEMPORARY"
instead of DegarBatt(11):Error:Syntax error at "_TEMPORARY".
Warlord664 is offline   you may: quote & reply,
Old 09-16-2011, 08:49 AM   #33
harIII
Veteran
 
harIII's Avatar
 
Join Date: Feb 2008
Posts: 980
Helpful! 
The problem I had with that line is that there is for some God awful reason a space between "TYPE" and "_TEMPORARY" I thought I removed that but now that I look at it for some reason it's still there. I edited the script in the post so that you should now be able to compile it, sorry about that.

-----EDIT-----
Hmmm, I went in to edit the script but it shows that there is no space where I said there was, but looking at the script it looks like there is a space. You'll have to go in manually and remove the space right where I mentioned above. I don't know why Lucasforums is doing this but as I upload the script it's fine but when I copied it, there's a space. Any just remove the space and you should be able to compile it.
harIII is offline   you may: quote & reply,
Old 09-16-2011, 08:52 AM   #34
Warlord664
Junior Member
 
Warlord664's Avatar
 
Join Date: Jun 2011
Location: Computer Desk
Posts: 320
Current Game: swtor
Contest winner - Modding 
Huh. It still won't compile, same error as last time.
Warlord664 is offline   you may: quote & reply,
Old 09-16-2011, 09:22 AM   #35
harIII
Veteran
 
harIII's Avatar
 
Join Date: Feb 2008
Posts: 980
Helpful! 
You have to take the space out of the last line between TYPE and _TEMORARY
harIII is offline   you may: quote & reply,
Old 09-16-2011, 09:30 AM   #36
Warlord664
Junior Member
 
Warlord664's Avatar
 
Join Date: Jun 2011
Location: Computer Desk
Posts: 320
Current Game: swtor
Contest winner - Modding 
It doesn't look like there is a space

Quote:
void main() {

effect eStun = EffectDeath();
object oTarget = GetObjectByTag("degar");
object oObject1=GetObjectByTag("to'ggar");
object oObject2=GetObjectByTag("degar");

ChangeToStandardFaction(oObject1, 12);
ChangeToStandardFaction(oObject2, 13);

ExecuteScript("k_ai_master",oObject1,1005);
ExecuteScript("k_ai_master",oObject2,1005);

DelayCommand(5.0,ApplyEffectToObject(DURATION_TYPE _TEMPORARY,eStun, oTarget));

}
Theres just a _ and thats it.
Warlord664 is offline   you may: quote & reply,
Old 09-16-2011, 09:38 AM   #37
harIII
Veteran
 
harIII's Avatar
 
Join Date: Feb 2008
Posts: 980
Helpful! 
What I'm saying is that you dont see the space until you copy it into the compiler. Anyways just download these two files, i went ahead and compiled it for you. One is the compiled version and the other is the source script.

http://min.us/mmj8nKDKf
harIII is offline   you may: quote & reply,
Old 09-16-2011, 09:49 AM   #38
Warlord664
Junior Member
 
Warlord664's Avatar
 
Join Date: Jun 2011
Location: Computer Desk
Posts: 320
Current Game: swtor
Contest winner - Modding 
I downloaded it doesn't seem to have a .nss with it and when i try to open the the ncs I downloaded it just brings up kotor tool with no script. soo..I guess im not understanding something here.


Edit:Ok i opend it and i was like what??? its like ten millions miles long I would post it but...its ten million miles long.

Last edited by Warlord664; 09-16-2011 at 09:58 AM.
Warlord664 is offline   you may: quote & reply,
Old 09-16-2011, 10:02 AM   #39
harIII
Veteran
 
harIII's Avatar
 
Join Date: Feb 2008
Posts: 980
Helpful! 
There are TWO files. You have to tab over to the second. Note that you can't open and edit .ncs files, in human terms they are comprehensible. You can only open the source script which is the .nss file.
harIII is offline   you may: quote & reply,
Old 09-16-2011, 10:06 AM   #40
Warlord664
Junior Member
 
Warlord664's Avatar
 
Join Date: Jun 2011
Location: Computer Desk
Posts: 320
Current Game: swtor
Contest winner - Modding 
Ok the files I got are K1TemplateTags and K2TemplateTags there both BFD files (not sure what those are) and when i open them in the text editer there both ten million miles long and i have no idea what to do with them.
Warlord664 is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Three scripts I need

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:00 AM.

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