Script Troubleshooting

Lexx

Testament to the ghoul lifespan
Moderator
Modder
Here is another one, folks. I need brainstorming.

Trying to add a new script. In the mapper the script appears twice and the script also doesn't work. Obvious conclusion: Something is fucked up.

I can't figure out what exactly. Scripts.lst only has one entry and it has a correct newline at the end. Scrname.msg also is ok, though even if I don't add any entry there, the script appears twice in the mapper.

What is it I have overlooked? I feel like doing this for the very first time ever...


/edit: Ok, whatever that was, I fixed it. Removed all traces of the script, then - instead of the Sfall script editor - I used FSE to register the script. After that everything worked as usual...
 
Last edited:
Here is something new:

kR7Mu4.png


Anyone knows what is causing this? Commented out pretty much everything I could in that script, and yet whenever I switch into barter mode, the above happens. I know that I fixed such a thing already years ago, but... that was years ago.

/Edit: Thanks for the rubber ducking, guys. Fixed it. The proto had barter flag set to no... Ofc it doesn't work then.
 
Last edited:
Ok, this one is a question I really can't answer by myself. Question is... Is the following possible?

I want to spawn a text message in the log window *once* when the game is started / you load a savegame. If you load a savegame again, the text message will *not* appear again. BUT if you close the game, start it again, then load a savegame... the text message appears again.

So I would need a variable that starts at 0, will be set to 1 when the game runs / a savegame has been loaded the first time, and then will be set to 0 again when the game gets closed in whatever kind of way.

Possible or not? Come on, sfall scripters.
 
It'd still help to know why exactly you want to be able to do this, so we can try and help think of possible workarounds. For instance, get_uptime keeps "running" after you exit the game, so could in theory be used to give someone who restarts the game after some period a certain message.
 
Just a little fluff, nothing super fancy. A kind of "welcome"-message on startup to greet the player.
 
Just a little fluff, nothing super fancy. A kind of "welcome"-message on startup to greet the player.

Can't be done without using dirty hacks and AllowUnsafeScripting=1, which may be deprecated in the future, so not recommended.
 
I am not 100% sure right now, but I think AllowUnsafeScripting=1 is required for my mod anyway. /Edit: Or maybe not. Just tried it and some of the important features are all still working.. strange

In any case, as soon as I am using the lates ddraw.dll my sleep menu doesn't work anymore. Therefore, I'll have to use some older version anyway...
 
AllowUnsafeScripting is only needed if you want to add your own functions to sfall (read_byte, etc. you can check the sfall function list doc for more info). You won't need it for any of the existing ones.
 
I think it was used for editing the worldmap travelscreen. Years ago, a friend helped me to change the Fo2 worldmap interface to the look of the Fo1 worldmap interface. That means, changing it to this:

vhFHnW.png


At some point there came an sfall update and it stopped working, though... Kinda sucks, because I would still love to use that one instead of the Fo2 interface. I simply don't have that many town locations.

/Edit: I think it was done via disabling the scrollbuttons, changing the interface positions and then simply replacing the existing graphics to match the new positions.
 
Last edited:
Back
Top