Separate names with a comma.
Discussion in 'Fallout General Modding' started by Dude101, Jul 30, 2007.
You need to add those Turkish characters to the fonts (fontX.fon/aaf), not something sfall can do.
Anybody can give a hint how to print text in the in game monitor/log/status information window for debug purposes?
Any other ways for debug output?
I have read through https://sfall.bgforge.net and didn't find reference to that.
Never mind. Found it.
There's also "debug_msg" which can be more useful for debugging purposes.
Awesome. Thank you for hint!
Is it customary to request more hooks or configuration to be added to sFall or it is all on the requestors? I am fine either way just don't want to invent a new process if one already exists.
Specifically, right now I am looking for following functionality/hooks:
SP awarded per level formula. It is not in Stats.ini now. Either adding configuration for it there or adding a level up hook which modders can intercept and override awarded SP should do.
Book functionality. Which skill each book affects and SP awarded computation. There is already Books.ini but it does not allow assigning multiple skills per book or select affected skill or calculate awarded SP amount, etc. The hook would be more flexible in this case.
Modifying derived stats on critters based on condition. There is CombatTurn hook but I am not sure this is the right place for it as these combat parameters are also accessible outside of combat as well.
Mass modification of items/critters parameters. I guess easiest way would be to do it in loop but when? At game creation, game load, in files? Are there any hooks for such global modification purpose?
Modifying drug effects. There is Drugs.ini but it reads "Note: for vanilla drugs, you can only override the values of NumEffect and AddictTime parameters". Any hook that I can use to customize it? UseObjOn can be used at use moment but how to control following timed effects?
Also I see Skills.ini uses the concept of "SP spent" in BasedOnPoints parameter. How does it work with skill advancement cost? Let's say initial skill 0% advanced to 125% for 150 SP (100 * 1 + 25 * 2). If BasedOnPoints=1 is it now at 125 cost thresholds based on 125% skill increase or at 150 cost threshold based on total SP spent?
Also how this "SP spent" or "skill advanced" values can be extracted in the script? Thank you.
Any way to guarantee mod execution order when they change same thing? Like if I want my mod to override everything else?
I think the standard way is through this link:
This is for modifying awarded sp per level:
The formula btw is: (IN * 2) + 5
This can be addressed in at least 3 easy ways, which don't require any new functionality from sfall:
1. You can change the script of the particular book to add the skill you want.
2. You can change dude_obj script to add the skill points once you read a certain book.
3. You can use a use hook and check if the used item was a book, then giving skill points.
Note that some books, IIRC, have hard-coded behaviors, so you might want to create a new proto if you want to get rid of these behaviors.
What do you mean in "on condition"?
Is this what you are looking for? https://sfall.bgforge.net/stats/
Check out proto_data and object_data
Pretty much same as books.
Dont know about the first part, but check out this:
Use mod_skill_points_per_level script function.
It will be based on total SP spent instead.
Use get_critter_skill_points script function to get SP spent on a skill.
Use the prefix 'a' in the script name of your mod. e.i. gl_a_name
note: prefix z - reserved for sfall mods purposes.
Thank you for response and sorry for my sometimes newbie questions.
Good stuff. However it is not entirely clear what it means by that.
"This is a modification of what would otherwise happen, rather than a replacement."
Does it mean that original value is passed to the function as parameter and then function may return something else if it desires?
Yep. I thought about this too as a last resort if Books.ini cannot do that.
Do I understand correctly that all hooks are replacing the original behavior? If not, does it happen before or after?
Err. The problem with drugs is that they have delayed effects. I can surely hook their usage but how do I hook time delayed events?
Unfortunately, there functions do not answer "how much SP was spent on skill" or "how much skill was advanced above the initial".
RE: Skills.ini mechanics
I just set it like that and tested.
First 25 spent SPs gave me +25% increase in skill level
Then SP / skill level cost changed to 2
Second 50 SPs game me +25% increase
Then SP / skill level cost changed to 3
So the breakdown table in Skills.ini is by additional skill level as returned get_critter_skill_points function and not by available SP spent!
I guess there is a big terminology confusion here.
SP, aka available SP, aka SP pool - is the amount of points available to be used to advance any skill. It is displayed in character interface under skills list in "skill points" counter.
This value is returned by get_available_skill_points function.
Skill level aka skill % is the actual level of certain skill.
This amount of skill level added on top of base is returned get_critter_skill_points function.
Maybe it would be better to reword it in Skills.ini like that to avoid confusion?
;Set to 1 to base skill costs on number of additional points in a skill excluding what comes from their stats and other bonuses
Great hint. Thank you.
One thing confuses me, though. These two register methods have opposite ordering.
scripts are executed in reverse order of how they were registered
All scripts hooked to a single hook point with this function are executed in exact order of how they were registered
So it seems that if I use "a" prefix and use register_hook_proc_spec it will be executed first which is the opposite of what I am looking for.
Is there a simple way to loop through all pids? Is there a global array of all pids?
Are all pids used without gaps? If so is there a max pid so I can loop until it?
If none of the above works how to determine that given pid does not correspond to any proto? This way I can break execution as soon as I can encounter it.
What's wrong with using for loop?
The maximum number of protos for a type (items, critters, etc.) is 65535. You can check the return value with get_proto_data(pid, PROTO_PID), it returns -1 if the specified proto cannot be found.
Check EcCo's script source for the example.
I'm not sure. My guess is it means the final "result" is reduced or inflated to reach the replacement value, as opposed to completely ignoring the calculation process. In other words, all code is executed.
Each hook has a description in which it is specified rather it is executed before or after the action. I think in general it does not replace original behavior, but read comments for each hook to be sure.
This is also to be scripted. For example; you want to make jet give you an additional bonus to gambling for 2 days. You keep a variable with time-when-took-jet time(the game uses 'ticks' to keep track of time), and check if two days have passed. So current_time - time-when-took-jet = 2 days (10 ticks per second, so 172800 second times 10.)
Nothing wrong with it. I actually prefer it. Was just looking for right conditions. Thank you for pointing this out.
Make sense. Thank you.
I am sorry for probably stupid question but what is SSL language and where can I get reference to it?
Internet search by "SSL" is obviously not returning what I am looking for.
That's the scripting language specifically made for Fallout 1 and 2. Kinda weird you ask this now because you've already started working on scripting.
As for reference, you can start from the documents included in the official mapper (see Fallout Database thread for download) or the modding wiki, and check script source of UP/RP/EcCo/etc. for practical examples.