TimeShadow Posted December 28, 2015 Share Posted December 28, 2015 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 More sharing options...
Belthan Posted December 28, 2015 Share Posted December 28, 2015 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 More sharing options...
TimeShadow Posted December 29, 2015 Author Share Posted December 29, 2015 I will give it a try, although it's all new and have never done that. So I will study vanilla quests in game to see how it's done. ~Thanks Link to comment Share on other sites More sharing options...
Belthan Posted December 29, 2015 Share Posted December 29, 2015 I'm not aware of any vanilla scripts that work this way, but if you're looking for examples I do it all over the place in Coito Ergo Sum. Link to comment Share on other sites More sharing options...
mindboggles Posted December 29, 2015 Share Posted December 29, 2015 (edited) 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 December 29, 2015 by mindboggles Link to comment Share on other sites More sharing options...
Belthan Posted December 30, 2015 Share Posted December 30, 2015 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 More sharing options...
blove Posted December 31, 2015 Share Posted December 31, 2015 You could have your aid item add a token that fires a script. Cipscis has some examples. That script could then add another token that fires a script before the removeme. Link to comment Share on other sites More sharing options...
TimeShadow Posted December 31, 2015 Author Share Posted December 31, 2015 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 More sharing options...
RoyBatterian Posted January 7, 2016 Share Posted January 7, 2016 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 More sharing options...
Belthan Posted January 7, 2016 Share Posted January 7, 2016 By "scriptlets" do you mean result scripts for stages/terminals/packages/infos etc. as opposed to full quest/object/effect scripts? Link to comment Share on other sites More sharing options...
Recommended Posts