unexplainable script failure

Post » Wed May 19, 2010 4:54 pm

i'm having problems with a quest script. the strange thing about is is certain earlier functions were tested and worked many times, but for some reason have stopped working. most of it is really simple too

also, the CS seems to be deleting parts of scripts at complete random. in my last test it had deleted the setstage that initiated the quest, which i knew was there cause i've tested portions of the quest numerous times and it's worked every time

the script attached to the quest looks like this

scn nameofscriptBegin GameMode	if Player.GetItemCount item1ref == 1				setstage questname 12	EndIf	if npc1.GetDead == 1 && npc2.GetDead == 1 && npc3.GetDead == 1 && npc4.GetDead == 1			setstage questname 55	endif	if GetStageDone questname 35 == 1 && npc5.GetDead == 1 && GetStageDone questname 50 == 0 && GetStageDone questname 65 == 0 && GetStageDone questname 110 == 0		SetStage questname 36                        Player.SetFactionRank factionname2 0 	endif	if GetPCFactionMurder factionname 1		SetStage questname 80	endifEnd


can anyone see any obvious problems with that? like i said earlier parts of the script (one of them being if the player has an item in their inventory, advance quest, the first if statement) won't work? when they used to?

thanks
User avatar
Eric Hayes
 
Posts: 3392
Joined: Mon Oct 29, 2007 1:57 am

Post » Wed May 19, 2010 2:40 pm

Is item1ref an object ID or a reference ID? I think getitemcount only works with object IDs.

You have no conditions that prevent the different blocks from running over and over. If the player has the item and killed a member of the specified faction the script will first set the stage of the quest to 12 and then to 80 every five seconds. That could lead to problems.
User avatar
Kelvin Diaz
 
Posts: 3214
Joined: Mon May 14, 2007 5:16 pm

Post » Wed May 19, 2010 4:50 am

how would i prevent that? also it's an object id, and that part of the script has worked previously, it's just stopped working recently for reasons i don't understand. i went over everything again and i can't understand why it no longer works

i'm gonna delete the rest of the script apart from that block and see if the rest of the script is what's effecting it

--------------

yep this was the case, so you were right, but now i'm very stuck. i've never come across this problem before though, i'm kind of learning as i go. can you pls help me?
User avatar
Arrogant SId
 
Posts: 3366
Joined: Sat May 19, 2007 11:39 am

Post » Wed May 19, 2010 7:41 am

how would i prevent that? also it's an object id, and that part of the script has worked previously, it's just stopped working recently for reasons i don't understand. i went over everything again and i can't understand why it no longer works

i'm gonna delete the rest of the script apart from that block and see if the rest of the script is what's effecting it

--------------

yep this was the case, so you were right, but now i'm very stuck. i've never come across this problem before though, i'm kind of learning as i go. can you pls help me?


It depends on how your quest works. Whether you want the stages to happen in a certain order or whether they can happen in any order. But basically it works the same for both cases, just set a variable once a stage was set and check for that variable to make sure the stage can't be set again. Like

short varif var == 0  if Player.GetItemCount item1ref == 1		  setstage questname 12  set var to 1  endifendif


If you want stage 12 to happen before stage 55 you could use this:

short varif var == 0  if Player.GetItemCount item1ref == 1		  setstage questname 12  set var to 1  endifelseif var == 1  if npc1.GetDead == 1 && npc2.GetDead == 1 && npc3.GetDead == 1 && npc4.GetDead == 1  setstage questname 55  set var to 2  endifendif

User avatar
Austin England
 
Posts: 3528
Joined: Thu Oct 11, 2007 7:16 pm

Post » Wed May 19, 2010 1:56 am

that makes sense, i'll give it a shot

- all working now, ty :) only thing is the CS is acting really weird, it's deleting addtopic and setstage commands at random which throws a spanner in the works every time i test it. really confusing, i know they were there, i've played through the first portions of the quest over and over again, but they're just disappearing
User avatar
jessica robson
 
Posts: 3436
Joined: Mon Oct 09, 2006 11:54 am

Post » Wed May 19, 2010 7:51 am

whoops dp
User avatar
Manuela Ribeiro Pereira
 
Posts: 3423
Joined: Fri Nov 17, 2006 10:24 pm

Post » Wed May 19, 2010 4:06 am

most of the script is working now except the faction expulsion part. i've managed to rid most of it from the quest script and attach it to certain objects, and i'm left with just this

scn MISHnfquest3scriptshort mishq34 == 0Begin GameModeif mishq34 == 0		if GetPCFactionMurder MishMoya 1		SetStage MISHnfquest3 80		set mishq34 to 1	endifendifend


can anyone see any problems with that? if i murder somebody of the faction mishmoya whilst the quest is running nothing happens
User avatar
Monika Fiolek
 
Posts: 3472
Joined: Tue Jun 20, 2006 6:57 pm

Post » Wed May 19, 2010 11:00 am

Probably a problem with the declaration block. You declare variables there, but you don't set them to values or check for values. So instead of

short mishq34 == 0

just use

short mishq34

A 'new' variable will always be zero so there is no need to set it to 0 anyway.
User avatar
FoReVeR_Me_N
 
Posts: 3556
Joined: Wed Sep 05, 2007 8:25 pm


Return to IV - Oblivion