![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
#1 |
Dungeon Master
![]() Join Date: July 5, 2001
Posts: 98
|
Aaaarg. I can't take this. None of my scripting works, and I'm not about to spend money I don't have on a scripting guide. I know C for God's sake yet the scripting still boggles my mind. I just can't get anything too work. Too many functions, nothing explained, how am I supposed to make this thing work?
So I want a conversation to only run once. Fine. I set a conditional in the ShowTextWhen field and an iResult=(GetVariable(...)!=1). So if the variable is not 1 iResult should return TRUE and the conversation run if I get this correctly. At the end of the conversation I put a script SetVariable(...)=1 should that should make the thing run only once. Run it and? Nothing happens. The conversation doesn't show up. I want na NPC to talk with my PC when the PC is an area, then when the conversation ends, he should attack the NPC together with his baddies. I set a generic trigger, script some things on the on enter field to start the conversation, and at the end of the conversation I set a variable to 1 that is checked on the NPC heartbeat and makes them my enemies if it's one. What happens? It doesn't work. The area thing. When I talk to the NPC, at the end he and his friends manage to become hostile, but they just stand there instead of attacking. When I attack them they fight back but they don't draw their weapons, even though I put a DrawMostDamagingMelle function together with the script that made them hostile. I set a new faction that is neutral to all, and I place some NPC from that function. When I kill a monster in front of them they attack me. If I set them hostile to the monsters they go and attack them instead of staying in one place. I don't know how to add journal entries. And there has to be a way to script more than one henchman. Even if it is copying the information from summon familiar in the spells file, editing it to "summon my henchman" when I hire him, and setting the spell duration to forever. But damn it, I just can't get this scripting thing to work. PLEASE. Somebody help me. |
![]() |
![]() |
![]() |
#2 |
Legion Symbol
![]() Join Date: May 29, 2002
Location: Somewhere in between
Age: 40
Posts: 7,029
|
I'm having problems too. I dont know C, but I'd love to learn; I did this for a convo... it might help you; Ill C&P it here if you like...
you got ur "root" right; then ur first "green text" for the npc. put this in for the "when text appears" int StartingConditional() { // Inspect local variables if(!(GetLocalInt(GetPCSpeaker(), "...") == 0)) return FALSE; return TRUE; } then ur have ur "blue text" right? ur player text. Try setting this to "actions taken" void main() { // Set the variables SetLocalInt(GetPCSpeaker(), "...", 1); } then u have ur "root" again right? make another "green text". put this "Text appears when..." int StartingConditional() { // Inspect local variables if(!(GetLocalInt(GetPCSpeaker(), "...") == 1)) return FALSE; return TRUE; } . That should set it so that it "remembers the convo". hope this helps a little; also, here is a script that makes faction attack; #include "nw_i0_generic" void main() { // Set the faction to hate the player, then attack the player AdjustReputation(GetPCSpeaker(), OBJECT_SELF, -100); DetermineCombatRound(GetPCSpeaker()); } . Oh yeah to make the NPCs stand still; try going to "statitics" and set "movement" to "Immobile", this'll stop em from moving, obviously. Jornal entries... er, I think you can add that in... "Other actions". not to sure. anyway, hope this helps, a little at least.
__________________
Skydracgrrl: Cruelty, thy name is Cal! --- There are none so blind as those who refuse to see, none so deaf as those who refuse to hear, and none so smelly as those who refuse to bathe. ![]() |
![]() |
![]() |
![]() |
#3 |
Dungeon Master
![]() Join Date: July 5, 2001
Posts: 98
|
Thanks for the reply. I haven't tried to use this yet, but let me see if I got this correct.
if(!(GetLocalInt(GetPCSpeaker(), "...") == 0)) return FALSE; return TRUE; This looks if the local variable is not zero. If it's not zero it returns false, if it is it returns true. Now I can't help but wonder, how can a variable that has not yet been initialised have a value? If the variable is initialised in the SetLocalInt command, which is written AFTER the getLocalInt command, in the actions taken Tab of the PC speaker, then the GetCommand could return any value whatsoever. Actually the variable should not even exist. Does a GetLocalInt function create a variable and set it to 0? Anyway, the next action sets the variable to 1 so the conversation doesn't show up, and the next one checks if the variable is 1 and if it is it makes the NPC say another conversation. I still can't see how this is different than what I did. iResult=(GetVariable(...)!=1) If the variable here is not 1, ie, it is 0 which is how the variable is initialised I guess, iResult returns 1, which is equivalent to TRUE. Or atleast that's how it should work in C. Thanks for the other script for making the NPC's attack me, but my bigest problem is making the NPC start the conversation when I enter a certain area, and then making them draw their weapons when they attack me instead of fighting with their fists. I can make them hostile. Thanks again for the help though. Also making the other character immobile may not help much, because I will want them to move later on when I solve their quest so that they can disappear from the screen. I also want an NPC to speak a certain string when I approach him, like they do in the tutorial, when the NPC speaks, "May I have a word with you?". I quess I could just see how that is done in the game and copy the script. And I still don't knpow why when I kill a hostile creature, the NPCs in the faction which is neutral to both be, and the hostile faction attack me. Thanks anyway. I'll try to use that script in the text appears when field and see hw it goes. |
![]() |
![]() |
![]() |
#4 |
Legion Symbol
![]() Join Date: May 29, 2002
Location: Somewhere in between
Age: 40
Posts: 7,029
|
you're welcome... btw, maybe you could give me a hand at some point... I need my "main" NPC. ie not the player, to "dissapear" and "reappear" in the local tavern. I'd like her to walk to the tavern door, then step inside... I'm not quite sure how to do that... I had a look at the NWN scripts, but... as always, it seems I cant figure out how to "reverse enginer" them... *sigh*
lol, I had fun wiht my dragon tho. took me a while. hehe. was hilarous; I gave him a bow... now when ppl try and shoot at him... he shoots back! rofl. great fun. Oh, do u know how to make a "tavern" script for the NPCs? I saw a couple around, but I'm can't quite get them to work...
__________________
Skydracgrrl: Cruelty, thy name is Cal! --- There are none so blind as those who refuse to see, none so deaf as those who refuse to hear, and none so smelly as those who refuse to bathe. ![]() |
![]() |
![]() |
![]() |
#5 |
Dungeon Master
![]() Join Date: July 5, 2001
Posts: 98
|
I don't know about tavern scripts, truth be told I have no idea what you mean by a tavern script. bout the character disappearing and reappearing, what I would do, at least the logic of what I would do would be the following:
Create a generic area trigger outside the tavern. When the PC enters it set a variable stored on the module to TRUE. The area trigger should only work when the variable is in FLASE so it should work only once.Have the NPC walk some waypoints to the door, then use a function to make him disappear.(I'm sure there must be one). The script to make him walk there should really be on the trigger areas on enter. Then when inside the tavern, either on the on enter or on the heartbeat of the tavern area, have a script check if the variable checked outside is TRUE. If it is, spawn the NPC in there, and set the variable to 2. The reason for it being to, is that if you put it to FALSE (0), when you walk outside to the area trigger, the script will run again moving the NPC inside the tavern again. That's the theory of it. How you would do this in practise and with what functions I have no idea. |
![]() |
![]() |
![]() |
#6 |
Legion Symbol
![]() Join Date: May 29, 2002
Location: Somewhere in between
Age: 40
Posts: 7,029
|
thanks; when I say "tavern" script; its one with the waitress and patrons interacting an all that.. u know? the waitress goes over to a random guy/gal, and asks for their order, then walks over to the bar, then goes to another, and so on?
I dont suppose you could give me a sample script or somthing? I know the theory, kind of, but I dont know how to set up the waypoints in the script and all that... if someone could give me a smaple script; or better yet a small modual, I'd greatly appreciate it... [ 07-21-2002, 09:05 AM: Message edited by: Calaethis Dragonsbane ]
__________________
Skydracgrrl: Cruelty, thy name is Cal! --- There are none so blind as those who refuse to see, none so deaf as those who refuse to hear, and none so smelly as those who refuse to bathe. ![]() |
![]() |
![]() |
![]() |
#7 |
Dungeon Master
![]() Join Date: July 5, 2001
Posts: 98
|
Heh, I wish I was good enough with scripting to be able to give you a sample script. I can only give you the logic of how I would do it. There has been a waitress script around however for some time. Check at Neverwinter vault at the scripts sections they are bound to have it. The way it works is you attach it to the on heartbeat event of the waitress who chooses a tavern patron on random walks to him and speaks a one liner.
|
![]() |
![]() |
![]() |
#8 |
Legion Symbol
![]() Join Date: May 29, 2002
Location: Somewhere in between
Age: 40
Posts: 7,029
|
ok, I'll check. thanks, oh, btw, do you know how to set up waypoints? I can set them up, but Im unsure *how* to use em. especailly in scripting. Also, how do I use random walk? heh, I wonder if Mr. Mod, Z, knows how to do all these things. perhaps we should ask him.
![]()
__________________
Skydracgrrl: Cruelty, thy name is Cal! --- There are none so blind as those who refuse to see, none so deaf as those who refuse to hear, and none so smelly as those who refuse to bathe. ![]() |
![]() |
![]() |
![]() |
#9 |
Dungeon Master
![]() Join Date: July 5, 2001
Posts: 98
|
Random Walk is rather easy. I use it on my deers all the time. Just put a RandomWalk(); function in the heartbeat of the creature. Waypoints I expect would work like this: This is an example for patrolling guards. Set a number of generic trigers on the ground calling the Way1 Way2 Way3 etc. Set a variable to1. On the heartbeat of the guard you want to patrol put something like (this is in pseudocode)
if var=1 ActionWalktoLocation(GetLocation(GetObjectbyTag(Wa y1))); if var=2 ActionWalktoLocation(GetLocation(GetObjectbyTag(Wa y2))); if var=3 ActionWalktoLocation(GetLocation(GetObjectbyTag(Wa y3))); Then on the first Waypoint on the on enter script, or on the heartbeat of the area put a script which basically checks if the guard is in the location of Waypoint 1. If TRUE set var to 2 so the guard walks to the next waypoint and so on. By the way, I managed to stop the Neutral NPC from attacking me. Apparently while their faction was Neutral to hostiles, hostile was friendly to Neutral, so when I killed the Hostile they became Hostile towards me. Now I have every faction neutral to them, so they will never attack or be attacked. I have also managed to get ne of the conversations to work, but not another one which works with the exact same logic. I also managed to do a couple of other things I won't post since I can't be bothered to and you wouldn't care for anyway. |
![]() |
![]() |
![]() |
#10 |
Legion Symbol
![]() Join Date: May 29, 2002
Location: Somewhere in between
Age: 40
Posts: 7,029
|
k. thanks. I'll try the random walk script; if it doesnt work, Ill come back here... lol. hmm... it says Im missing a left bracket;
21/07/2002 14:43:32: Error. 'waytest1' did not compile. waytest1.nss(3): ERROR: NO LEFT BRACKET ON EXPRESSION. damn. what am I doin wrong. *sigh* I find it easiest if I have a script; found one actually, too complicated for waht I need tho. u see if I have one ready, then I can edit it it, and whatnot, then I can play around with it. one I've SEEN how to write it, it becomes easier, dont like writing it out by myself 1st time tho ![]() [ 07-21-2002, 09:49 AM: Message edited by: Calaethis Dragonsbane ]
__________________
Skydracgrrl: Cruelty, thy name is Cal! --- There are none so blind as those who refuse to see, none so deaf as those who refuse to hear, and none so smelly as those who refuse to bathe. ![]() |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Scripting | Smith | Dungeon Craft - RPG Game Maker | 1 | 08-17-2005 12:39 PM |
Scripting Help | robertthebard | Neverwinter Nights 1 & 2 Also SoU & HotU Forum | 5 | 11-29-2004 08:44 PM |
Need some help scripting again | robertthebard | Neverwinter Nights 1 & 2 Also SoU & HotU Forum | 6 | 10-22-2003 07:31 AM |
Scripting | Son of Osiris | Neverwinter Nights 1 & 2 Also SoU & HotU Forum | 1 | 04-05-2003 08:34 AM |
How the Hell do I send Haleabus to Hell? | Kenwyn | Wizards & Warriors Archives | 2 | 11-01-2000 03:56 PM |