Various modding questions

Cyrus

It Wandered In From the Wastes
I have a bunch of Qs which I'd appreciate your help with. Keeping them in one thread for cleanliness.


1. If there is a procedure called procedure_1 in Script_1.ssl, and there is another procedure also called procedure_1 in another script file called Script_2.ssl, will they interfere with each other? What actually happens?



2. If a procedure is registered to a given gamehook in one script file, and another procedure is registered to the same gamehook in another script file, what happens? I suppose when the hook gets "hooked" then a procedure should be called and executed. but if two different procedures in two different scripts are registered to the same hook...?

In Fo2Tweaks for example register_hook_proc(HOOK_COMBATDAMAGE, procedure_name) is called once in gl_g_knockback.ssl and once in gl_g_damage_mod.ssl. Although the procedure name is different.

I need to understand this so i don't make incompatible code with other people's code, in case of merging.
 
Last edited:
1. No they won't, as long as you don't export/import the said procedure from the two scripts to others (i.e. mix-calling them in the same 3rd script).
2. Check the first part in hookscript.txt if you're planning to make your hook script work with others.
 
Thanks NovaRain.

3. Can I create a 2 dimensional map array and use only dots (.) to get or set the variables?

For example:
Code:
Table1 = {"Gun1", "Gun2", "Gun3", "Gun4"};

Table1.Gun1 = { "DMG_min": 5, "DMG_max": 10, "Range": 20};

Gun1_range = Table1.Gun1.Range;

Table1.Gun1.Range = Gun1_Range + 5;


4. How do I add a new key to an existing map?
 
Thanks for reply,

My emphasis was more on dot usage: Var1.Var2.Var3

sslc doc says:
you can chain dot and bracket syntax to access elements of multi-dimensional arrays:
collectionList[5].objectList[5].name += " foo";

You know, I read this line and didn't understand well enough last night, but now as I read it again I think I can understand it a little better. I think I CAN use it that way.
 
Last edited:
I have written a script that reduces AP cost for unarmed special attacks (jab, palmstrike, hipkick, etc). the AP cost hookscript is triggered A LOT! so it runs very often (not my fault, nature of the hookscript). So I want to make sure I write the code as efficiently as possible to prevent excess execution time.

I have the choice between writing it so it only applies to dude_obj, or to all critters. The thing is I don't know if other critters even have the option to use these special attacks. If they are unable to use them then there is no need to write to accommodate them. It would make the code more efficient to eliminate it for them.

The special attacks have 3 requirements, Skill check, stat check, and level check. There are many critters that do pass the skill and stat checks, however I'm not sure if critters have a "level", or perhaps the game is designed not to require a level check for them. Because I don't know this I can't determine if critters other than dude_obj have access to special attacks.

Does anyone know the answer to this?


Here is the code for reference:
Code:
#include "headers/fo2tweaks/fo2tweaks.h"


variable new_apcost = 0;
variable critter_arg;
variable atktype_arg;
variable aimed_arg;

procedure start;
procedure apcost_handler;


procedure start begin
  if game_loaded then begin
    register_hook_proc(HOOK_CALCAPCOST, apcost_handler);
    ndebug("initialized");
  end
end


procedure apcost_handler begin
  critter_arg = get_sfall_arg;
  atktype_arg = get_sfall_arg;
  if atktype_arg < 11 then return; // Not an unarmed special attack, bypassing.

 
  if ((atktype_arg == ATKTYPE_JAB) or (atktype_arg == ATKTYPE_PALMSTRIKE) or (atktype_arg == ATKTYPE_PIERCINGSTRIKE)) then begin
    new_apcost = 4;
  end
  else begin
    if ((atktype_arg == ATKTYPE_HIPKICK) or (atktype_arg == ATKTYPE_HOOKKICK) or (atktype_arg == ATKTYPE_PIERCINGKICK)) then begin
      new_apcost = 5;
    end
    else begin
      return; // Primary kick types. Bypassing.
    end
  end

  aimed_arg = get_sfall_arg;
  if aimed_arg == 1 then new_apcost = (new_apcost + 1);

  if (has_trait(TRAIT_PERK, critter_arg, PERK_bonus_hth_attacks)) then new_apcost = (new_apcost - 1);

  set_sfall_return(new_apcost);
end
Also if you know of anyway I can make the execution chain of this code more efficient please point out to me. Thank you.
 
Last edited:
I have written a script that reduces AP cost for unarmed special attacks (jab, palmstrike, hipkick, etc). the AP cost hookscript is triggered A LOT! so it runs very often (not my fault, nature of the hookscript). So I want to make sure I write the code as efficiently as possible to prevent excess execution time.

I have the choice between writing it so it only applies to obj_dude, or to all critters. The thing is I don't know if other critters even have the option to use these special attacks. If they are unable to use them then there is no need to write to accommodate them. It would make the code more efficient to eliminate it for them.

The special attacks have 3 requirements, Skill check, stat check, and level check. There are many critters that do pass the skill and stat checks, however I'm not sure if critters have a "level", or perhaps the game is designed not to require a level check for them. Because I don't know this I can't determine if critters other than obj_dude have access to special attacks.

Does anyone know the answer to this?

Also if you know of anyway I can make the execution chain of this code more efficient please point out to me. Thank you.

I am thinking of using switch instead of nested ifs...
Code:
#define SCRIPT_REALNAME "gl_cy_calcapcost"

#include "headers/fo2tweaks/fo2tweaks.h"


variable new_apcost = 0;


procedure start;
procedure apcost_handler;


procedure start begin
  if game_loaded then begin
    register_hook_proc(HOOK_CALCAPCOST, apcost_handler);
    ndebug("initialized");
  end
end


procedure apcost_handler begin
  variable critter_arg = get_sfall_arg;
  variable atktype_arg = get_sfall_arg;
  variable aimed_arg = get_sfall_arg;



  if ((atktype_arg == ATKTYPE_JAB) or (atktype_arg == ATKTYPE_PALMSTRIKE) or (atktype_arg == ATKTYPE_PIERCINGSTRIKE)) then begin
    new_apcost = 4;
  end
  else begin
    if ((atktype_arg == ATKTYPE_HIPKICK) or (atktype_arg == ATKTYPE_HOOKKICK) or (atktype_arg == ATKTYPE_PIERCINGKICK)) then begin
      new_apcost = 5;
    end
    else begin
      return;
    end
  end

  if aimed_arg == 1 then new_apcost = (new_apcost + 1);

  if (has_trait(TRAIT_PERK, critter_arg, PERK_bonus_hth_attacks)) then new_apcost = (new_apcost - 1);

  set_sfall_return(new_apcost);

end


I don't know why change the ap cost for these, you plan to add more boxing fights? Because i and i think many guys here dont use unarmed, i use this only at temple of trial and then never.

It have a reason why special attacks have so many ap cost, with this the balance is nearly zero.
 
People don't use unarmed because unarmed is under powered compared to guns. If we improve unarmed then it will be more interesting. This is one of the ways you make things worthwhile and more interesting.

Default game values are not good. Changes like this give the player the option to enjoy the game the way they want. Values can always be changed.
 
People don't use unarmed because unarmed is under powered compared to guns. If we improve unarmed then it will be more interesting. This is one of the ways you make things worthwhile and more interesting.

Default game values are not good. Changes like this give the player the option to enjoy the game the way they want. Values can always be changed.

The problem is you get early a gun,and then unarmed is not useful anymore. Because you find enough stuff, and can buy and find enough ammo.

How will you survive a early fight against 4 raiders 1 with hunting rifle other with 10 mm pistol and others with melee weapons?not with unarmed and for later game, you dont have a chance when comes stronger enemies with strong weapons.
 
You make valid points and I understand where you are coming from. But see that this change is still better than vanilla. There are many ways to play the game and many of those ways are less efficient than the "best ways" to play. However we do still play in less "efficient" ways because of ...fun!

The default AP costs for unarmed special attacks are WAY too high and they make those attack options completely useless and moot. It may not be possible to get everything in the game in a really nice balance, but its still good to inch closer. I think this is a good change.

It also allows to assign ANY number you want to those attacks in the future.
 
Does anyone know the answer to this?
I personally don't, but I THINK that the execution time, and the amount of "work" the CPU will have to do is negligible. A script becomes CPU intensive in other cases, such as complicated mathematical calculation. A famous example is finding the root number of a very large number: The CPU has to make many (I'm guessing much much more than a billion, depending on the number itself) of operations to calculate this.
In your example, it looks totally negligible.

EDIT: Also I think most (if not all) critters in use in the game are level 1, and with varying skills and stats. Many attributes and functions can only be applied to dude_obj, such as add_trait or perk.
 
Last edited:
Unarmed is for master players who want to play a finessed game, unlike those 'lowlifes' who walk around carrying cheap firearms making "pew - pew" noises every few minutes.

:flameon:
 
Unarmed is for master players who want to play a finessed game, unlike those 'lowlifes' who walk around carrying cheap firearms making "pew - pew" noises every few minutes.

:flameon:

Ok lets play Fallout Online you come with unarmed, and i come with Minigun.

You maybe look to many Bruce Lee films haha.

I will see you unarmed against a Enclave Soldier or Frank Horrigan but without Cheats.
 
Last I checked, we were making mods for Fallout 2 and not FOnline.
 
Most of my games have centered around unarmed & melee fighters... In the late game my characters would adopt a strong pistol for times when they could not reach an opponent within their turn, or could not afford to cross the field away from their immediate concerns (the directly adjacent fight).

I do not understand lowering AP costs for advanced moves. We all know (I assume) that APs directly equate to 'use of time', and I cannot imagine that these actions take less time; and they afford greater benefits than the standard [faster/cheaper] attacks.

I have to believe that the developers played and tested the game for years, settling upon the best costs relative to each discipline. AP changes will allow additional attacks per round to average characters—and they can be wearing a power fist when they do them.
 
Last edited:
Yes but here are guys play with cheats, and think they are pros.

He played to many times WOW i think.

I've never played World of Warcraft, wouldn't touch that crap with a 10ft pole...I like to play Fallout 2 solo, with a unarmed character, on the most difficult setting, and still I can wipe everything on the map, or just run away if things get too hot. Running away is also a valid method to survive the wastelands.
 
I was given a 10 day free trial of WoW; I had never played. I installed it, and played it for about 15 minutes. I uninstalled it... and that was my last experience with it.
 
I like to play Fallout 2 solo, with a unarmed character, on the most difficult setting, and still I can wipe everything on the map, or just run away if things get too hot. Running away is also a valid method to survive the wastelands.
This is usually how I play too. Sometimes I throw the trait Jinxed to the mix just to keep things more interesting.

Hell, I even played Fallout Tactics solo and unarmed last time I played it too. That game was going well for a while:
GE1voX3.jpg
 
Back
Top