Jump to content

Doing some simple scripting when: Max script line length (512 characte


smjn

Recommended Posts

I am trying to add 4 headgear to allow night vision, the original script was:

scn 000PipLightSpellScript


Begin ScriptEffectStart

if (player.getequipped DLC02ArmorPowerT51bHelmetWasteland==0 && player.getequipped DLC02ArmorPowerT51bHelmet==0 && player.getequipped DLC02ArmorStealthWasteland==0 && player.getequipped DLC03ArmorEnclaveHelmet==0 && player.getequipped ArmorTeslaHelmet==0 && player.getequipped ArmorPowerT51bHelmet==0 && player.getequipped ArmorPowerHelmetOutcast==0 && player.getequipped ArmorPowerHelmetBrotherhoodOfSteel==0 && player.getequipped ArmorPowerHelmet==0 && player.getequipped ArmorEnclaveHelmet==0)
	player.AddSpellNS 000PipboyLightAbility
else
endif

End


Begin ScriptEffectFinish

if player.isspelltarget 000PipboyLightAbility
	player.removespell 000PipboyLightAbility
endif

End

	

 

And my own revised is:

scn 000PipLightSpellScript


Begin ScriptEffectStart

if (player.getequipped DLC02ArmorPowerT51bHelmetWasteland==0 && player.getequipped DLC02ArmorPowerT51bHelmet==0 && player.getequipped DLC02ArmorStealthWasteland==0 && player.getequipped DLC03ArmorEnclaveHelmet==0 && player.getequipped ArmorTeslaHelmet==0 && player.getequipped ArmorPowerT51bHelmet==0 && player.getequipped ArmorPowerHelmetOutcast==0 && player.getequipped ArmorPowerHelmetBrotherhoodOfSteel==0 && player.getequipped ArmorPowerHelmet==0 && player.getequipped ArmorEnclaveHelmet==0 && player.getequipped ArmorReconHelmet==0 && player.getequipped ArmorReconPowerHelmetOutcast==0 && player.getequipped ArmorTribalPowerHelmet==0 && player.getequipped ArmorAshurPowerHelmet==0)
	player.AddSpellNS 000PipboyLightAbility
else
endif

End


Begin ScriptEffectFinish

if player.isspelltarget 000PipboyLightAbility
	player.removespell 000PipboyLightAbility
endif

End

	

 

However, whenever I try to save I keep getting this error code... just how do I resolve this?-- With my limited knowledge, I can't seem to know what to do. Any pointers? How can I break up the line length in the right fashion so that the script would work properly? Thanks.

Edited by smjn
Link to comment
Share on other sites

Try adding them all to a new formlist and instead of getequipped armoritem use getequipped newformlist. You could alternately evaluate for true and move your addspellns below your else. Saves a few "==0" but probably not enough.
Link to comment
Share on other sites

Just as a quick note, you can always just use another if and endif in scripts

 

Begin ScriptEffectStart 
       if  player.getequipped DLC02ArmorPowerT51bHelmetWasteland==0 && player.getequipped DLC02ArmorPowerT51bHelmet==0 && player.getequipped DLC02ArmorStealthWasteland==0
       if  player.getequipped DLC03ArmorEnclaveHelmet==0 && player.getequipped ArmorTeslaHelmet==0 && player.getequipped ArmorPowerT51bHelmet==0 && player.getequipped ArmorPowerHelmetOutcast==0
       if  player.getequipped ArmorPowerHelmetBrotherhoodOfSteel==0 && player.getequipped ArmorPowerHelmet==0 && player.getequipped ArmorEnclaveHelmet==0 
               player.AddSpellNS 000PipboyLightAbility 
       else 
       endif
       endif
       endif
End

Link to comment
Share on other sites

Thanks, just what I was looking for. Now then, how to implement this into the mod itself... that's going be a problem.

 

Alright, gave it a go and my updated simple addition is:

scn 000PipLightSpellScript


Begin ScriptEffectStart

if ((player.getequipped DLC02ArmorPowerT51bHelmetWasteland) || (player.getequipped DLC02ArmorPowerT51bHelmet) || (player.getequipped DLC02ArmorStealthWasteland) || (player.getequipped DLC03ArmorEnclaveHelmet) || (player.getequipped ArmorTeslaHelmet) || (player.getequipped ArmorPowerT51bHelmet) || (player.getequipped ArmorPowerHelmetOutcast)) == 0
if ((player.getequipped ArmorPowerHelmetBrotherhoodOfSteel) || (player.getequipped ArmorPowerHelmet) || (player.getequipped ArmorEnclaveHelmet) || (player.getequipped ArmorReconHelmet) || (player.getequipped ArmorReconHelmetOutcast) || (player.getequipped ArmorTribalPowerHelmet) || (player.getequipped ArmorAshurPowerHelmet)) == 0
	player.AddSpellNS 000PipboyLightAbility
else
endif
endif

End


Begin ScriptEffectFinish

if player.isspelltarget 000PipboyLightAbility
	player.removespell 000PipboyLightAbility
endif

End

 

When I try to save, it gives me these error codes:

 

SCRIPTS: Script '000PipLightSpellScript', line 7:
Unknown variable or function 'AddSpellNS'.

Context: DEFAULT
---
SCRIPTS: Script '000PipLightSpellScript', line 7:
Syntax Error
player.AddSpellNS 000PipboyLight Ability
Could not parse this line.

Context: DEFAULT
---
SCRIPTS: Script '000PipLightSpellScript', line 4:
Mismatched begin/end block starting on line 4.

Context: DEFAULT
---
SCRIPTS: Script '000PipLightSpellScript', line 4:
Mismatched begin/end block.

Context: DEFAULT

 

I also tried vforvic's addition to no avail.

Edited by smjn
Link to comment
Share on other sites

smjn - Hello!

 

AddSpellNS is a FOSE (Fallout Script Extender) function, the vanilla GECK will not recognise it hence the error message.

 

If you are using FOSE commands in a script or editing an existing script with FOSE commands you have to open the FOSE version of GECK.

 

From the Bethsoft page:

 

" How to use FOSE with the GECK

 

Scripts written with FOSE's new functions must be created via the GECK after it's been loaded through fose_loader.exe. To use FOSE with the GECK:

 

1 Extract fose_loader.exe and the necessary dll files to your Fallout directory.

2 Open a command prompt window and navigate to that directory.

3 Type this into the command prompt:

 

fose_loader.exe -editor

 

A more convenient method is to automate this command through a shortcut:

 

1 Create a shortcut to fose_loader.exe.

2 Right-click on the shortcut and open the properties window.

3 Add "-editor" to the Target field. "

 

More info on GECK/FOSE here:

 

http://geck.bethsoft.com/index.php/Fallout_Script_Extender

 

I use the second shortcut method as it's a lot more convenient.

 

The FOSE version of GECK works just the same (it works like the game, it's the normal GECK with FOSE just running with it) only you can use the FOSE commands.

 

Hope this helps!

 

Prensa

Edited by prensa
Link to comment
Share on other sites

Try adding them all to a new formlist and instead of getequipped armoritem use getequipped newformlist. You could alternately evaluate for true and move your addspellns below your else. Saves a few "==0" but probably not enough.

You should really consider this. It's a lot easier in the long run, because if you decide to add more items, you just drop them in the form list and it's done. No scripts or line length issues to worry about.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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