Tip for scripters

lust

First time out of the vault
This might save you 30 min of investigation... I'm a newbie myself at F2 modding so some of the pros feel free to smack me down. Also, please add to this list if I left something out.


So, if you want to make a new script for a critter, you potentially have to edit:


Global.h: GVAR_TOWN_REP, all the quest states. Also addiction and karma is in here. If you don't want to edit Global.h you can use the GVAR_RESERVED_VARs but good luck bookkeeping.

Also, I haven't tried this yet (mod's not done)... but I assume if you edit global.h you have to rebuild the world with the new one.

<townname>.h: various local values/vars get defined here... the important one is a wrapper for the town rep

<mapname>.h: map-specific vars.

<critter>.ssl: the script for your critter behavior

scripts.h/scripts.lst: you need to stick the new script in here

<critter>.msg: dialog text nodes/floaters, which you reference in the .ssl. Also the text where it goes "You see..." is in here.


Addtional files:

command.h: marking cities on the map, having sex, "made man"/"prizefighter" type macros, macros for having the car or having NPCs, merchant restocking...

modreact.h: you might want to modify this if you have a global faction such as a "slaver," otherwise do it locally
 
you don't need to add anything to the global.h file, it's just easier if you do.. it just defines the glabal variable as numbers

you DO need to add the global variable to the vault13.gam file in the data directory of your mod

again. there is no need to create the <mapname> or <townname>.h files, you can just define everything you want in the script itself.. it's just easier if you intend to use the same define over and over again..


i highly recomend using the FSE ( link below ) as it has features to register the script, which puts all the needed entries in the needed files for you.. and also can create the .msg files that go with a script, as well as letting it add the text into the script itself as comments so you can see if you have the lines in the right place...
 
ColJack said:
you don't need to add anything to the global.h file, it's just easier if you do.. it just defines the glabal variable as numbers

you DO need to add the global variable to the vault13.gam file in the data directory of your mod

again. there is no need to create the <mapname> or <townname>.h files, you can just define everything you want in the script itself.. it's just easier if you intend to use the same define over and over again..


i highly recomend using the FSE ( link below ) as it has features to register the script, which puts all the needed entries in the needed files for you.. and also can create the .msg files that go with a script, as well as letting it add the text into the script itself as comments so you can see if you have the lines in the right place...

Heh it might be a flaw, but I've always programmed in pico or notepad. =) I checked out FSE and you might very well be right. Does it have a debugger?

I think it was when I had several <maps> in a <town> and I was using variables that needed to propagate to all the maps that I defined it in <town>.h -- I put the definition in the .h and included it in all the local maps. How would you do that locally? Do variables get kicked around inside the engine outside of scope?

Also, I was under the impression you needed the .h when you wanted to export variables such as for vendors (that's how I've been doing it, anyway).
 
Back
Top