script not allowing this

Post » Thu Aug 25, 2011 8:38 am

i can't seem to get this script working.

what it does is when you equip the gun it checks what ammo is loaded, when you shoot the gun it rolls a timer then uses the determined ammo to change a quest short value

scn OBSERVERblasterfloat waitsmallshort ammobegin onequip	if player.getequipped ammomicrobreederMLMOBSERVERspawner		set ammo to 1	endif	if player.getequipped ammomicrobreederMLMOBSERVERspawner2		set ammo to 2	endifendbegin onfire	set waitsmall to waitsmall + getsecondspassed		if waitsmall >= 0.8			if ammo == 1				set 1observerspawnedcontrol.helperspawned to 1			endif			if ammo == 2				set 1observerspawnedcontrol.psycospawned to 1			endif			set waitsmall to 0			set ammo to 0		endifend


this script is the quest script i'm directing the weapon script at

this one controlls 2 different NPCs, it handles moving them between different xmarkers and the time they spend in the game world when first spawned

scn ObserverSpawnedCharsKeepershort dooncefloat htimerfloat ptimershort helperspawnedshort psycospawnedbegin gamemode	if doonce == 0		set helperspawned to 0		set psycospawned to 0		set doonce to 1	endif	if psycospawned == 2		set ptimer to ptimer + Getsecondspassed		if ptimer >= 30			set psycospawned to 0			set ptimer to 0		endif	endif	if helperspawned == 2		set htimer to htimer + getsecondspassed		if htimer >= 30			set helperspawned to 0			set htimer to 0		endif	endif	if helperspawned == 0		observergrenadespawnedref.moveto spawnedhelpermarkerREF		observergrenadespawnedref.disable	endif	if psycospawned == 0		observergrenadespawned2ref.moveto spawnedattackermartkerREF		observergrenadespawned2ref.disable	endif	if helperspawned == 1		observergrenadespawnedref.moveto OBSERVERMobleHmarkREF		set helperspawned to 2		observergrenadespawnedref.enable	endif	if psycospawned == 1		observergrenadespawned2ref.moveto OBSERVERMobileSpawnREF		set psycospawned to 2		observergrenadespawned2ref.enable	endifend

User avatar
Ross Thomas
 
Posts: 3371
Joined: Sat Jul 21, 2007 12:06 am

Post » Thu Aug 25, 2011 5:35 am

When you say "it does not work", that doesn't give us much to go on. Do you mean geck won't let you save it? Then use geck powerup from newvegasnexus to see the syntax error. Whenever I see a variable name that starts with a number like "1observerspawnedcontrol" I am suspicious; in many cases the scripting language tries to interpret this as a number and fails.
User avatar
Cayal
 
Posts: 3398
Joined: Tue Jan 30, 2007 6:24 pm

Post » Thu Aug 25, 2011 6:39 am

davidlallen is correct - the GECK's compiler has issues finding editorIDs that start with a number, like 1observerspawnedcontrol. If you change it to, say, observerspawnedcontrol, then your script shouldn't have this issue.

I've never been a fan of putting a sorting prefix like "aaa" at the start of editorIDs. Partly because I think it makes a mod look messy (even when that's not the case), and otherwise because there are much cleaner ways of sorting forms in order to find yours easily. For example, you could sort by the formID column (initially hidden in the object tree, to the right of the editorID column), or you could add a unique string to your editorIDs that is somehow related to your username and/or the name of your mod and use the object tree's "filter" function.

Cipscis
User avatar
Avril Louise
 
Posts: 3408
Joined: Thu Jun 15, 2006 10:37 pm


Return to Fallout: New Vegas