Another Scripting problem...

Post » Tue Nov 09, 2010 10:40 pm

scn 1HHToolsRemnantDeadBegin OnDeath HHRemnantCaptainShort DoOnceif DoOnce == 0SetStage 11Quest1HHTOOLS 5Set DoOnce to 1endifendBegin OnActivate == HHRemnantCaptainShort DoOnceif DoOnce == 0player.additem 1111HHCaptainNote1 1SetStage 11Quest1HHTOOLS 10Set DoOnce to 1endifend


So basicly what I want it to do is when I kill the NPC the quest updates. Then when I go to activate his body (Like you would to loot it) a note appears in my inventory and my quest updates again.

Cheers,

Shadowform.
User avatar
no_excuse
 
Posts: 3380
Joined: Sun Jul 16, 2006 3:56 am

Post » Wed Nov 10, 2010 12:00 am

Oh boy, there are many things wrong here. First off you use the same variable in two separate, independant situations. Second, you must declare your variable outside of the begin block.

scn 1HHToolsRemnantDead Short DoOnce Begin OnDeath  SetStage 11Quest1HHTOOLS 5  End Begin OnActivate If GetIsDead == 1if DoOnce == 0  player.additem 1111HHCaptainNote1 1 SetStage 11Quest1HHTOOLS 10 Set DoOnce to 1  ElseActivateEndIfEndIfend


Place this script ON the NPC in question, this will make it so you don't have to reference him in it, and so you KNOW it runs. Second, you must declare variables outside of all your blocks (do it at the very start) and declaring them more than once does nothing, or is just bad, so don't. If anything make DoOnce1 and DoOnce2 instead. Also, The OnDeath begin block only runs the one time the NPC dies (provided he is unique), so you dont need a DoOnce variable for that, as it only occurs once. Also, I added the 'else activate' lines, so after the one activate that adds the note, the player can then normally loot the body as if he were any other NPC, so long as he is dead. If he is alive, the player simply cannot activate/speak to him until they kill him and do the one 'gather note' thing. Again, hope this helps.
User avatar
Laura Simmonds
 
Posts: 3435
Joined: Wed Aug 16, 2006 10:27 pm

Post » Tue Nov 09, 2010 8:05 pm

thanks. Always a big help. Cheers.
User avatar
Mrs Pooh
 
Posts: 3340
Joined: Wed Oct 24, 2007 7:30 pm

Post » Tue Nov 09, 2010 6:43 pm

hmmmmm, this doesnt seem to work. The GECK does it whole "Do you wish to save the current script?" thing it does when something is wrong. Which means it will revert back to the scripts last stable save... Any Ideas?
User avatar
james tait
 
Posts: 3385
Joined: Fri Jun 22, 2007 6:26 pm

Post » Tue Nov 09, 2010 7:26 pm

Rename the objects you created so that they don't start with a number, or you will always have scripting problems/strange bugs/failure to compile.
User avatar
Mark
 
Posts: 3341
Joined: Wed May 23, 2007 11:59 am

Post » Tue Nov 09, 2010 1:19 pm

Rename the objects you created so that they don't start with a number, or you will always have scripting problems/strange bugs/failure to compile.

Ahh, I didn't pay specific attention to your object and ref names, but this is it. Never start any object ID, or ref ID's with number; and as Ricker said, you avoid a lot of issues.
User avatar
RAww DInsaww
 
Posts: 3439
Joined: Sun Feb 25, 2007 5:47 pm

Post » Tue Nov 09, 2010 4:35 pm

Sorry Guys. I feel really stupid coming back here. But this is still screwing me around. Maybe I missed something. Sorry about this.

[code]scn AAAAHHToolsRemnantDead Short DoOnce Begin OnDeath  SetStage AAAAQuestHHTOOLS 5  End Begin OnActivate If GetIsDead == 1if DoOnce == 0  player.additem AAAAHHCaptainNote 1 SetStage AAAAQuestHHTOOLS 10 Set DoOnce to 1  ElseActivateEndIfEndIfend
[/code]

As you can see I have changed all the REF's, Items etc from having numbers in them and changed the ID's of the actual object themselves and the script is on the appropriate NPC. I'm running out of Ideas. I dont understand why this wont work.....
User avatar
Kira! :)))
 
Posts: 3496
Joined: Fri Mar 02, 2007 1:07 pm

Post » Tue Nov 09, 2010 8:19 pm

Sorry Guys. I feel really stupid coming back here. But this is still screwing me around. Maybe I missed something. Sorry about this.

scn AAAAHHToolsRemnantDead Short DoOnce Begin OnDeath  SetStage AAAAQuestHHTOOLS 5  End Begin OnActivate If GetIsDead == 1if DoOnce == 0  player.additem AAAAHHCaptainNote 1 SetStage AAAAQuestHHTOOLS 10 Set DoOnce to 1  ElseActivateEndIfEndIfend


As you can see I have changed all the REF's, Items etc from having numbers in them and changed the ID's of the actual object themselves and the script is on the appropriate NPC. I'm running out of Ideas. I dont understand why this wont work.....


Did you place this script on the NPC in question? It should work otherwise. Also, why do you need to update the quest stage to 5, if your just later updating it to 10 when they loot the body? Are the stages triggering objective displays? In which case, why not just have 1 stage for when he is looted, and trigger the displays from this script.
User avatar
Guinevere Wood
 
Posts: 3368
Joined: Mon Dec 04, 2006 3:06 pm

Post » Wed Nov 10, 2010 12:01 am

The main problem is the script wont save. Which means I cant put it on the NPC. The quest stage 5 tell the player to loot the body, when the player does the player receives the note and quest update 10 explaining what to do next. Yes the stages are triggering objective displays. :)
User avatar
stevie critchley
 
Posts: 3404
Joined: Sat Oct 28, 2006 4:36 pm

Post » Tue Nov 09, 2010 6:49 pm

I'm sorry! The error is me being silly. Change the function 'GetIsDead' to just 'GetDead'. My bad! GetIsDead is not a function. :P
User avatar
Jessie Butterfield
 
Posts: 3453
Joined: Wed Jun 21, 2006 5:59 pm

Post » Tue Nov 09, 2010 8:54 pm

hahahaha, Thanks Gunmaster.
User avatar
Jesus Duran
 
Posts: 3444
Joined: Wed Aug 15, 2007 12:16 am

Post » Tue Nov 09, 2010 9:25 pm

I dont beleive this...... I still get this error when trying to save the script:

"Do you want to save the current script?

Current == 1HHToolsRemnantDead"

This is driving me mad. Everything is in place...... Maybe i'll start again and try a different method.

Edit: Nevermind. I fixed it...somehow. Just randomly saved after not changeing anything and it worked.Thanks guys. :)
User avatar
danni Marchant
 
Posts: 3420
Joined: Sat Oct 07, 2006 2:32 am

Post » Tue Nov 09, 2010 7:51 pm

Edit: Nevermind. I fixed it...somehow. Just randomly saved after not changeing anything and it worked.Thanks guys. :)


The GECK works in mysterious ways...

I just hope the Creative Kit doesn't... <_<
User avatar
Inol Wakhid
 
Posts: 3403
Joined: Wed Jun 27, 2007 5:47 am

Post » Tue Nov 09, 2010 11:57 pm

*Sigh*

Well, I was a bit fast to say it was fixed.... The script saved properly but none of the quest stages initialize. When I kill the guy, no quest update. When I activate his body, the script gives me the note but no quest update, and I can loot him like normal afterwards which proves the script IS working but the quest isnt. I have no idea why. I have gone over the quest properties hundreds of times checking stages, objectives, everything. But nothing is happening. This isnt the first quest I have written by a longshot, the GECK just doesnt want to work for me anymore...... :/
Any Ideas?

Thanks in advance,

Shadowform.
User avatar
Jonathan Braz
 
Posts: 3459
Joined: Wed Aug 22, 2007 10:29 pm

Post » Tue Nov 09, 2010 4:31 pm

Then the issue is somewhere in your quest stage result scripts. Paste what you have in the one for stage 5 and stage 10.
User avatar
C.L.U.T.C.H
 
Posts: 3385
Joined: Tue Aug 14, 2007 6:23 pm

Post » Tue Nov 09, 2010 10:04 pm

Found the problem. I had a spelling error in my ObjectiveDisplay command.

Thanks anyways :P
User avatar
Alba Casas
 
Posts: 3478
Joined: Tue Dec 12, 2006 2:31 pm


Return to Fallout: New Vegas