lfnetwork.com mark read register faq members calendar

Thread: Talk- Attack script
Thread Tools Display Modes
Post a new thread. Sorry, this thread is closed. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 03-11-2006, 02:23 PM   #1
Elven6
Rookie
 
Elven6's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 226
Talk- Attack script

I looked throught the scripting tutorial but I coulden't find a script that allows the PC to talk to a npc and then attack him. Does anyone have one that I can use?
Elven6 is offline   you may:
Old 03-11-2006, 02:36 PM   #2
Kitty Kitty
Junior Member
 
Kitty Kitty's Avatar
 
Join Date: Jan 2004
Location: USA
Posts: 355
There's an excellent writeup by our very own tk102 entitled "Talk - Fight - Talk sequence" which should do what you need. Just read it over and leave out the part about stopping the NPC from death and going back into conversation if you don't need that part.

You can find it HERE

Cheers,
-Kitty


Kitty Kitty is offline   you may:
Old 03-11-2006, 02:40 PM   #3
Elven6
Rookie
 
Elven6's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 226
When I try to compile the fight script it dosent work

this is what I use

void main() {
object oNPC=GetObjectByTag("npc_tag");
ChangeToStandardFaction(oNPC, 1);

// and if there are any thugs to fight...
object oThug1 = GetObjectByTag("npc1_tag");
object oThug2 = GetObjectByTag("npc2_tag");
object oThug3 = GetObjectByTag("npc3_tag");

ChangeToStandardFaction(oThug1, 1);
ChangeToStandardFaction(oThug2, 1);
ChangeToStandardFaction(oThug3, 1);

}
Elven6 is offline   you may:
Old 03-11-2006, 03:20 PM   #4
Kitty Kitty
Junior Member
 
Kitty Kitty's Avatar
 
Join Date: Jan 2004
Location: USA
Posts: 355
Well, no. Like that I'm quite sure it's not going to work.

See, right off, you don't even need any of the stuff after the comment line (// and if there are any thugs to fight...) except of course the closing curly brace unless whatever NPC you're trying to start a fight with has friends around that you also want to fight you.

Second, everything you see in quotes there, such as "npc_tag" means you have to go look up the actual tag for the NPC you want to interact with and replace it with the correct information.

Let me say I'm sorry in advance if I make any minor mistakes here -it's been a LONG time since I touched a script for KOTOR. If I do though, someone will be able to spot and correct it quickly I'm certain.

That said...

If you wanted to have Belaya fight you after talking with her on Dantooine in the Jedi Enclave, you'd want your source to look like this:

Code:
void main() {
object oNPC=GetObjectByTag(dan13_belaya);
ChangeToStandardFaction(oNPC, 1);
}
Now if you want to have Belaya attack you and have Juhani join her in attacking you (I use her as the example simply because once she goes back to the enclace she's standing right there in the same spot) you'd want it to look like this:

Code:
void main() {
object oNPC=GetObjectByTag(dan13_belaya);
ChangeToStandardFaction(oNPC, 1);

object oThug1 = GetObjectByTag(dan13_juhani);
ChangeToStandardFaction(oThug1, 1);
}
The reason yours won't compile is because you're trying to define a constant string within a function call that doesn't allow for doing so (the quotes), but even if it DID compile, it wouldn't do anything beause the game would never find any NPC called 'npc_tag' anyway.

Not to be mean or rude or anything, but if you plan on fiddling about with much scripting, it would behoove you to read (not skim --read) through the available scripting advice and tutorials. It can be pretty tricky, and if you don't at least have a pretty solid basic knowledge of what's going on in there it'll give you migranes in no time.

Cheers,
-Kitty


Kitty Kitty is offline   you may:
Old 03-11-2006, 03:30 PM   #5
deathdisco
Bastards of Young
 
deathdisco's Avatar
 
Join Date: Jan 2004
Location: Left of the Dial
Posts: 717
Veteran Modder Contest winner - Modding 
@Kitty, glad to see you're back. You were here for a brief time when I first discovered Holowan. It's good to see one of the original Kotor modders back

@Elven6,
The script compiles fine. If you mean it not working like you intended, did you replace everything in quote with the tags from the UTC's you're using.

EDIT: Kitty beat me to it.

deathdisco is offline   you may:
Old 03-11-2006, 03:34 PM   #6
Pavlos
Scruffy Englishman
 
Pavlos's Avatar
 
Join Date: Sep 2005
Location: The real world/ivory towers
Posts: 1,974
Current Game: Viking Warrior Poets
No you do need the quotations around the tag - otherwise the game doesn't know what it is looking at.

Code:
void main() {
object oNPC=GetObjectByTag("dan13_belaya");
ChangeToStandardFaction(oNPC, 1);

object oThug1 = GetObjectByTag("dan13_juhani");
ChangeToStandardFaction(oThug1, 1);
}
But yeah other than that it should be ok. Just attach it to the final dialogue node.
Pavlos is offline   you may:
Old 03-11-2006, 04:05 PM   #7
Kitty Kitty
Junior Member
 
Kitty Kitty's Avatar
 
Join Date: Jan 2004
Location: USA
Posts: 355
Quote:
Originally Posted by Pavlos
No you do need the quotations around the tag - otherwise the game doesn't know what it is looking at.

[snipped]

But yeah other than that it should be ok. Just attach it to the final dialogue node.
Ha! See? I knew I'd goof something up. Even as I was writing it the question as to whether the quotes should or shouldn't be around the proper tags was nagging me, and hence the disclaimer about my own lack of brain cells on the matter.

Soooo.. that being the case, let's retract part of what I said above. Everything up there is still ok as far as the code goes (just put the quote marks back as Pavlos stated) and all should be well.

If it's still not compiling, you've got something goofed in your tools. Start with checking the easy stuff, such as making sure all your paths are correct, and that you saved your script source as script_name.nss (NOT .txt) and that you have it and everything else KotORtool needs to find in the right places.

That's probably where 80% of people have compile problems crop up, as well as access to include files, but that isn't the case here since this script doesn't need to include any others.

And @ deathdisco: Thanx. It's good to be back, even if I am a dinosaur.

Cheers,
-Kitty


Kitty Kitty is offline   you may:
Old 03-11-2006, 06:04 PM   #8
Elven6
Rookie
 
Elven6's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 226
Ok I got the script to compile, but before I test it I need a warp script, like the one on Nar Shadda when you fix the speeder and it warps you

Like if a NPC comes up to you and tells you he can take you somewhere, but you will need a script in his dialouge to get you their.

Edit: I used the scripts but the PC dosen't attack after the conversation is over

Last edited by Elven6; 03-11-2006 at 07:07 PM.
Elven6 is offline   you may:
Old 03-12-2006, 10:14 PM   #9
RedHawke
Shadow Lord Of The Sith™
 
RedHawke's Avatar
 
Status: Moderator
Join Date: Mar 2004
Location: Stormreach CA.
Posts: 9,184
Current Game: DDO, Stormreach
A script to make an NPC hostile should run in the last line of the dialogue.


"Beware the form-fitting black armor-clad Drow hottie with twin Mineral II Greensteel Khopeshes!"
"Liella d'Orien says, '"You're the fool, Devil. -- Witness the power of this fully ARMED and OPERATIONAL Titan!"'"
----------------------------------------------------------------------

Last edited by RedHawke; 03-13-2006 at 12:35 AM.
RedHawke is offline   you may:
Old 03-13-2006, 12:37 PM   #10
cookie12
Rookie
 
cookie12's Avatar
 
Join Date: Mar 2006
Posts: 18
Does this script only work for Kotor 1?
cookie12 is offline   you may:
Old 03-13-2006, 01:28 PM   #11
Pavlos
Scruffy Englishman
 
Pavlos's Avatar
 
Join Date: Sep 2005
Location: The real world/ivory towers
Posts: 1,974
Current Game: Viking Warrior Poets
No, it should work for TSL. Generally, scripts from KotOR I will work for TSL - the problem comes with taking TSL into KotOR - some of the functions used just don't exist!
Pavlos is offline   you may:
Old 03-16-2006, 03:45 PM   #12
Elven6
Rookie
 
Elven6's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 226
The script still dosen't work, is their a special order the dialouge lines have to be?
Elven6 is offline   you may:
Old 03-16-2006, 04:01 PM   #13
cookie12
Rookie
 
cookie12's Avatar
 
Join Date: Mar 2006
Posts: 18
Thumbs up

Maybe your not compiling it? here do this take
Code:
void main() {
object oNPC=GetObjectByTag("dan13_belaya");
ChangeToStandardFaction(oNPC, 1);
}
that copy it paste it in your text editor in Kotor Tool go to the menu that has the compile button save it in your Override folder as fight now open up the module section of Kotor tool and look for Danm13_s.rim and look for the belaya dialog, make a new dialog entry for the PC to say then attach your fight.ncs script by typing in the first script box fight (without the .ncs) and save that in your override go to dantooine and talk to belaya and select your custom dialog and she should turn to a hostile (if you want to kill her permantly just edit her .utc file and turn of minamal 1 hp selection and save that into your override) if I made any mistakes tell me

Last edited by cookie12; 03-16-2006 at 04:15 PM.
cookie12 is offline   you may:
Old 03-16-2006, 04:09 PM   #14
Elven6
Rookie
 
Elven6's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 226
Thats what I am doing but he dosen't attack
Elven6 is offline   you may:
Old 03-16-2006, 04:14 PM   #15
cookie12
Rookie
 
cookie12's Avatar
 
Join Date: Mar 2006
Posts: 18
When you talk to he/she do you see your custom dialog entry? If so did you check and make sure you didnt add the .ncs extension to the dialog node? And in your override folder is it .nss or .ncs? And with the code you have to change dan13_belaya to something else if your doing another person
cookie12 is offline   you may:
Old 03-16-2006, 04:19 PM   #16
Elven6
Rookie
 
Elven6's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 226
Ok here is the code I use

void main() {
object oNPC=GetObjectByTag("g_dark_mas01m");
ChangeToStandardFaction(oNPC, 1);
}

And the code I belive is in nss format
Elven6 is offline   you may:
Old 03-16-2006, 04:22 PM   #17
cookie12
Rookie
 
cookie12's Avatar
 
Join Date: Mar 2006
Posts: 18
it has to be in .ncs format just make sure in the Kotor Tool text editor that that "Script is for Kotor 1" is check and that you use compile not the save or save as (p.s since you are using a normally hostile NPC make sure you edit his file and set him to netreul) but otherwise everything your doing is right

-cookie12
cookie12 is offline   you may:
Old 03-16-2006, 04:38 PM   #18
Elven6
Rookie
 
Elven6's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 226
it dosent compile anymore, btw the script is for kotor 2
Elven6 is offline   you may:
Old 03-16-2006, 04:40 PM   #19
cookie12
Rookie
 
cookie12's Avatar
 
Join Date: Mar 2006
Posts: 18
ok start Kotor Tool and start a new script make sure its selected "Script is for Kotor 2" then his compile it should prompt you to save it, save it in your override, then check your override and make sure it is in .ncs format

-Cookie12
cookie12 is offline   you may:
Old 03-16-2006, 04:44 PM   #20
Elven6
Rookie
 
Elven6's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 226
No it still dosent work, it is in a diffrent format, do I put the .ncs in the text box or is it the final product of compiling
Elven6 is offline   you may:
Old 03-16-2006, 04:51 PM   #21
cookie12
Rookie
 
cookie12's Avatar
 
Join Date: Mar 2006
Posts: 18
put .ncs there hope it works for you

-Cookie12
cookie12 is offline   you may:
Old 03-16-2006, 04:54 PM   #22
Patriarch
Rookie
 
Join Date: Oct 2005
Posts: 77
Elven

No offense, but the answers you are seeking, are not advanced.....Answers regarding talk fight talk are covered by tk102 in the tutorials.....Try to look at them and understand the syntax, add one line ...Then compile.....if success one more....this is helpfull at an early stage..... But mostly look for scripts that does something similar to what you wanna do..then modify it bit by bit.........Read the introduction to the scripting syntax by tk102....

To make a character attack you at the end of a dialogue just type "a_atkonend" in the scipt field of dlg edit.... Most of the scripts you need are already there.....Have a look at the source using kotor tool....

Last edited by Patriarch; 03-16-2006 at 05:06 PM.
Patriarch is offline   you may:
Old 03-16-2006, 04:57 PM   #23
cookie12
Rookie
 
cookie12's Avatar
 
Join Date: Mar 2006
Posts: 18
Why does some people think a regular talk attack script is so ... advanced it was my first script done
cookie12 is offline   you may:
Old 03-16-2006, 05:01 PM   #24
Patriarch
Rookie
 
Join Date: Oct 2005
Posts: 77
cookie....Trying to give the guy some pointers....I know it is not advanced....
Patriarch is offline   you may:
Old 03-16-2006, 05:01 PM   #25
cookie12
Rookie
 
cookie12's Avatar
 
Join Date: Mar 2006
Posts: 18
oh... ok sorry continue on then
cookie12 is offline   you may:
Old 03-16-2006, 05:03 PM   #26
Elven6
Rookie
 
Elven6's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 226
Then mabe you can give me yours cookie? Mine is just not working
Elven6 is offline   you may:
Old 03-16-2006, 05:07 PM   #27
cookie12
Rookie
 
cookie12's Avatar
 
Join Date: Mar 2006
Posts: 18
the computer im on that has the internet doesnt have neither KOtor or KOtor 2 so I cant upload a script since I dont have the script file thingy
cookie12 is offline   you may:
Old 03-16-2006, 05:09 PM   #28
Elven6
Rookie
 
Elven6's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 226
When can you acces the computer that has it?
Elven6 is offline   you may:
Old 03-16-2006, 05:13 PM   #29
cookie12
Rookie
 
cookie12's Avatar
 
Join Date: Mar 2006
Posts: 18
ill try now hold on...
cookie12 is offline   you may:
Old 03-16-2006, 05:19 PM   #30
Elven6
Rookie
 
Elven6's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 226
ok just use the code I posted above
Elven6 is offline   you may:
Old 03-16-2006, 05:31 PM   #31
Pavlos
Scruffy Englishman
 
Pavlos's Avatar
 
Join Date: Sep 2005
Location: The real world/ivory towers
Posts: 1,974
Current Game: Viking Warrior Poets
It may not be advanced but to someone learning scripting with no programming background whatsoever it would probably seem like the code version of painting like Monet. Elven, I really cannot see why your script wont work. Can you talk us through - step by step - everything that you do? We may be able to find what is wrong then.

Make sure that the tag you have is actually the tag and not the resref. And also, make sure it is the tag of the object!

Also, deleting your old post and then reposting it is still "bumping."
Pavlos is offline   you may:
Old 03-16-2006, 05:32 PM   #32
cookie12
Rookie
 
cookie12's Avatar
 
Join Date: Mar 2006
Posts: 18
Crap!! My peice of S&*$ computer wont work stupid 2003 junk anyway I cant do it now ill try later and if someone that could do it sooner could they do it? Thanks, and sorry Elven

-Cookie12
cookie12 is offline   you may:
Old 03-16-2006, 05:37 PM   #33
Kitty Kitty
Junior Member
 
Kitty Kitty's Avatar
 
Join Date: Jan 2004
Location: USA
Posts: 355
Quote:
Originally Posted by cookie12
Why does some people think a regular talk attack script is so ... advanced it was my first script done
*Puts on her RedHawke disguise armband for a moment*

In an effort to make your stay around here more productive and enjoyable, I thought I'd point out that posts like the one quoted above tend to be frowned upon.

Not that you intended it as such necesarily, but all that comes across with this type of reply is "Ha-ha! I can do it and you're not smart enough!". That is to say, your response isn't remotely helpful or constructive, so there's really no point to posting it.

It would be wise therefore in the future to consider whether a reply adds something meaningful or helpful to a thread before posting.

Additonally, all the little one line back and forth messages between you and Elven6 which follow the quoted post are really something that would be much better handled via the PM system.

Instead of a bunch of little question/answer/question posts about whether or not you two can get together and one send something to the other, just PM each other. Since it's not allowed to post an email address here, chances are you'll end up passing on via PM anyway before you're done, and it's just a whole lot cleaner and simpler to keep that sort of exchange between the two of you.

*removes the armband*

Anyways, just a bit of friendly advice. Take from it what you will, and I'll refrain from going into how it sounds to start with a comment like you did above and then oddly not have the internet on the machine you presumably mod KotOR on, seeing as you'd have had to DL tools and the like there at some point, but anyways..

And um.. to the mods, hope I'm not coming across as stomping on any toes or anything. I was here, it was here, some advice felt well placed, yadda..

Cheers,
-Kitty


Kitty Kitty is offline   you may:
Old 03-18-2006, 02:58 PM   #34
Elven6
Rookie
 
Elven6's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 226
The .ncs dosen't compile so Im just going to use the .nss file

When I click the dialouge that initiates the fight nothing happens unless the NPC has to respond last, im definitly making a tutorial for this when I understand what to do.
Elven6 is offline   you may:
Old 03-18-2006, 03:02 PM   #35
Jackel
Senior Member
 
Jackel's Avatar
 
Join Date: Sep 2003
Posts: 1,056
A .nss will not work sorry. For the game to "read" your script you will need the .ncs file. If you just leave it as a .nss file it will not do anything and your talk-fight-talk sequence wont work.
Jackel is offline   you may:
Old 03-18-2006, 03:43 PM   #36
Elven6
Rookie
 
Elven6's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 226
Well it dosen't let me convert the file to a ncs format
Elven6 is offline   you may:
Old 03-18-2006, 03:44 PM   #37
Pavlos
Scruffy Englishman
 
Pavlos's Avatar
 
Join Date: Sep 2005
Location: The real world/ivory towers
Posts: 1,974
Current Game: Viking Warrior Poets
If for K2: Do you have the game fully patched or have the corrected nwscript in your override? If you don't it will prevent you from compiling any script even if it is correct! See here.

If for K1: I have no idea whatsoever as to why it wouldn't compile...
Pavlos is offline   you may:
Old 03-18-2006, 03:46 PM   #38
Elven6
Rookie
 
Elven6's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 226
Correct nwscript? I got mine from kotor tool and yes it is patched im talking about K2
Elven6 is offline   you may:
Old 03-18-2006, 03:50 PM   #39
Pavlos
Scruffy Englishman
 
Pavlos's Avatar
 
Join Date: Sep 2005
Location: The real world/ivory towers
Posts: 1,974
Current Game: Viking Warrior Poets
Then you are doing something wrong. Post whatever error message it is that you get. There is no reason whatsoever for that script *not* to work. Even if your game copy is patched please look at that thread I posted to check and see if you have the error - sometimes it is not fixed by the language patch.
Pavlos is offline   you may:
Old 03-18-2006, 04:02 PM   #40
Elven6
Rookie
 
Elven6's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 226
Elven6 is offline   you may:
Post a new thread. Sorry, this thread is closed. 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 > Talk- Attack script

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 11:12 AM.

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