Jump to content

GECK: Problem with Quest Variable


irswat

Recommended Posts

I have a Quest called SniperModQuest01 with an attached script called SniperModQuest01SCRIPT

ScriptName SniperModQuest01SCRIPT

short Sniper01DOD
short Sniper02DOD

Begin GameMode



End

I have another script that uses these variables

ScriptName SniperTowerDeathScript1


Begin OnActivate


	Set SniperModQuest01.Sniper01DOD to GameDay



End

it saves and compiles with no error. This script is called when the sniper dies and stores the day.

 

I have a respawn script that is supposed to check if the sniper is dead and if 3 days has passed:

ScriptName SpawnTowerSniper01

int respawn=0

Begin GameMode

If GSSniper01.GetDead
	If ((SniperModQuest01.Sniper01DOD+GameDay<=30)&&(GameDay-SniperModQuest01.Sniper01DOD>=3))
		Set respawn to 1
	else if ((SniperModQuest01.Sniper01DOD+GameDay<=30)&&((30-SniperModQuest01.Sniper01DOD)+GameDay>=3)
		Set respawn to 1
	endif
endif
	
	If respawn==1
		GSSniperMarker01.PlaceAtMe SMSniper01 1
	endif
	
End

I get an error on LINE 8. Unknown variable or function 'Sniper01DOD' The script will not save or compile. I'm baffled. Why does the death script save and compile but this respawn script wont? I was also getting an error about nested if statements not allowed. What alternatives do I have.

The reason I have to go through all of this is because the NPC respawn checkbox doesn't seem to do anything. The box is checked but my snipers aren't respawning after 3 days.

Any ideas? If I can get over this hurdle I can finish this mod quickly. It should be nice.

 

Link to comment
Share on other sites

The respawn checkbox makes things respawn on the next cell reset. Cells reset after 3 days of not being loaded, iirc. Cells load when they're within I want to say a 7 cell block around the player, so you need to stay a decent ways away from the area for a while.

 

As for your script, try spacing out the + operator between your variables (always good practice anyway).

 

I replied about your nested if issue in the other thread, but I'll put it here too, the else if condition is "elseif" all in one word.

Link to comment
Share on other sites

If you have ticked the Respawn box in the NPC window of all the NPCs you're using (and their templates, if any), then they should respawn.

I see absolutely no reason to go through all the trouble of trying to respawn them manually, via a script. I would suggest you first follow Gribb's advice and wait 72 hours in a far away location, then return and check again. If they still do not respawn, then you may have done something wrong.

Link to comment
Share on other sites

the tower is in goodsprings. I waited using 'T' 72 hours in Primm. That should be far enough yea?

Yes, that's more than enough. I used respawning NPCs before in one of my mods, and it worked perfectly without any special settings (other than the Respawn box). Can you please take a screenshot of the NPC window of one of the NPCs in question, and post it here (just to make sure everything looks OK)?

Link to comment
Share on other sites

Check the faction relation on that faction. It probably has no allies, and will even attack itself, if they attacked each other. You'll probably just want to make your own faction and configure it to ensure that they're friendly to each other but nobody else.

Link to comment
Share on other sites

how do I keep the snipers from leaping down from the towers? Do I need to navmesh or is there an easier way?

Once I get these minor issues sorted and I'm satisfied with the difficulty of the towers I will be placing snipers throughout the wastelands hidden in ghillie suits. My first quest will involve driving an AI driven hummer through a stretch of the Mojave with sniper towers everywhere. The player will be shooting from the passenger seat. I think it will be an interesting challenge. Maybe I will try my hand at some AI scripting after that. I'd like to make it so these snipers dont show up on radar when they shoot, they stay put, can fire from long distances, and will kill even a leveled player in a few shots.

Eventually I would like to create an underground complex that connects the various towers, and create some quests involving the eradication of the forces that occupy these towers. Should be fun.

Thanks for all of your help thus far!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...