Jump to content

Scripting Help!


TimeShadow

Recommended Posts

Does anyone know how to run a script from a script? I'm trying to get a script to run when you push a button on message. The message is activated via an item in the Aid Section of the Pipboy which runs a script, which present the player with a message with several button options.

Running the second (sorting) script which is long bypasses the character limitations (finite) of the script.

I tried using a "RunScipt" command in FOSE, but it does not exist. Is there a way to do this?

 

Here is a small part of the script with the "RunScript" function added:


If (Input == 8)			; Button - SORT [Aid] Items
	If ( StorageChip == 2)
	if ( Timer > 0)  && (player.GetItemCount AmmoElectronChargePack >= 1)
		Set Timer to Timer - GetSecondsPassed

	elseif ( Timer > 0) && (player.GetItemCount AmmoElectronChargePack < 1)
		Set StorageChip to 0
		ShowMessage aaPESCStorageFailMSG
	else
		Set StorageChip to 0
		player.removeItem AmmoElectronChargePack 1
		RunScript aaPESCAStroageChipAdvSortAidSCRIPT
	endif

	Endif	
Endif

Also does anyone know what language this script is written in, there are references that it is LISP or possibly Papyrus, but nothing that I can find?

 

Any help with this would be greatly appreciated.

 

Thank you,

 

~TS

Link to comment
Share on other sites

I create a dummy quest called GOSUB, and put common functions in the result script for the quest stages. You can then "call" those functions with something like:

 

SetStage GOSUB 50

 

One nice side effect is that a quest stage result script is guaranteed to run to completion when the stage is set, so you don't need to worry about timing issues.

Link to comment
Share on other sites

I create a dummy quest called GOSUB, and put common functions in the result script for the quest stages. You can then "call" those functions with something like:

 

SetStage GOSUB 50

 

One nice side effect is that a quest stage result script is guaranteed to run to completion when the stage is set, so you don't need to worry about timing issues.

Just be careful using that, the TTW team uncovered that spamming SetStage would lead to bloat.

 

Edit...Found the thread http://forums.bethsoft.com/topic/1533242-quest-stages-cause-save-bloat/

Edited by mindboggles
Link to comment
Share on other sites

Just be careful using that, the TTW team uncovered that spamming SetStage would lead to bloat.

 

Edit...Found the thread http://forums.bethsoft.com/topic/1533242-quest-stages-cause-save-bloat/

 

 

Interesting, thanks for the tip. Fortunately, while I did say I use the technique "all over the place", most of those places are called infrequently (for example, once per each issue of the magazine) so save bloat should be minimal, definitely not anything that runs every frame like the example in that thread.

Link to comment
Share on other sites

Belthan, that's your FNV mod I believe, unfortunately I don't have FNV loaded now, just FO3. I don't plan on loading it until I rebuild my rig (having some crashing issues and blue screens, video card is dying). I do want to get into this deeper as I have run into scripting limitations in the past, but for now I just shortened the script and limited it's (the mod) capabilities.

 

blove, I will look at Cipscis' examples as he has helped me in the past and is very good. I hope his examples apply here.

 

This does require more study on my part, now I'm working on a larger mod that I want to get out asap.

 

Thanks everyone for your help.

 

~TS

Link to comment
Share on other sites

The token method is probably the best way.

 

SetStage usage is just bad in general and it's not only save game bloat, but also causes the script engine to slow down over time and other issues, these should really only be used for one shot operations.

 

The thing you should never do is declare variables in scriptlets, this is what causes the most problems.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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