So I've been busy adding new stuff to sfall recently. Want to make a brief introduction.
1) Arrays as described in this thread are fully working. You will need new sslc version of course. Hopefully, NovaRain will provide it in coming 3.4 release.
2) Changed previous (optional) combat lighting fix. Now there should be less permanent light artifacts on the ground. However, some other side effect are in place (light stays while people getting knocked back by explosions). Other than that - should be no pitch black explosions (and flying rockets, plasma balls, molotovs) anymore! Need to adjust light radiuses for projectiles for better effect.
Also made it so burning guy animation also emit light. Will try to add light to flamer attack in future.
3) Added a bunch of new functions in "reg_anim_" family. There are a lot of them now, but I made it this way because it fits original set and uses exactly the same family of engine functions (I basically made more of the reg_anim functions exposed to scripting). Also there is an option to remove combat check for all of this functions, which will allow to use them during combat.
If some boring animation functions doesn't sound exciting, here's a short video example of how you can use reg_anim_animate_and_hide function:
This is exactly the same mechanism the engine uses for hard-coded explosions (grenades, dynamite, etc). It allows to make effects that disappear exactly at the moment when their animation is finished, allowing for some nice effects.
reg_anim_light allows, for example, to make strobing light.
reg_anim_take_out plays "take out weapon" animation by given weapon holding frame ID (even if there is no such weapon in inventory).
Others should be obvious.
4) Added new hook script hs_ammocost which allows to change how much ammo is reduced when firing weapon.
Also added INI option MISC.CheckWeaponAmmoCost which will add proper checks if there is enough ammo to use weapon (originally it checked if at least 1 round left) and also when calculating burst size (for example, if you set ammo cost to 2, have 7 bullets in your magazine and burst size is 4: it requires 4*2 = 8 bullets, but you only have 7, so you will get 7/2 = 3 shots which will spend 3*2=6 bullets with 1 left in chamber).
5) More control over vanilla critter_dmg function:
- it is now affected by set_target_knockback and remove_target_knockback functions
- hs_deathanim2 hook script is now called for deaths caused by this operator
This allows for some important features (basically did this for my traps system, like most of the other stuff).
6) Added new "metarule" function (yes, I know, it's bad design, but the underlying code is too complex to make a proper hookscript and adding 4 functions for this seemed like an overkill) to change various aspects of explosions in combat:
- force explosion for any damage type (for example, put DMG_fire here before using molotov: it will create explosion effect and inflict fire damage to primary and all secondary targets - wanamingos are in trouble!)
- change radius (limited to something like 8-10, should be enough unless you are making portable nuke )
- change explosions art FID (allows to add new explosion graphics)
- change explosion effects pattern (allows to change how many effects are created - originally there are 7 of them; right now it just leaves only 1, but it doesn't look right yet)
All changed parameters are effective until current "attack" action is finished. This is useful in conjunction with itemdamage hook script:
- use global script to attach to HOOK_ITEMDAMAGE
- calculate explosion parameters based on weapon used, etc.
- all of them will be reset after attack is finished, so you don't need to worry about resetting
1) Arrays as described in this thread are fully working. You will need new sslc version of course. Hopefully, NovaRain will provide it in coming 3.4 release.
2) Changed previous (optional) combat lighting fix. Now there should be less permanent light artifacts on the ground. However, some other side effect are in place (light stays while people getting knocked back by explosions). Other than that - should be no pitch black explosions (and flying rockets, plasma balls, molotovs) anymore! Need to adjust light radiuses for projectiles for better effect.
Also made it so burning guy animation also emit light. Will try to add light to flamer attack in future.
3) Added a bunch of new functions in "reg_anim_" family. There are a lot of them now, but I made it this way because it fits original set and uses exactly the same family of engine functions (I basically made more of the reg_anim functions exposed to scripting). Also there is an option to remove combat check for all of this functions, which will allow to use them during combat.
If some boring animation functions doesn't sound exciting, here's a short video example of how you can use reg_anim_animate_and_hide function:
Code:
obj := create_object(PID_EXPLOSION_EMP_1, tile_under_cursor, elevation(dude_obj));
reg_anim_begin();
reg_anim_animate_and_hide(obj, 0, -1);
reg_anim_destroy(obj);
reg_anim_end();
reg_anim_light allows, for example, to make strobing light.
reg_anim_take_out plays "take out weapon" animation by given weapon holding frame ID (even if there is no such weapon in inventory).
Others should be obvious.
4) Added new hook script hs_ammocost which allows to change how much ammo is reduced when firing weapon.
Also added INI option MISC.CheckWeaponAmmoCost which will add proper checks if there is enough ammo to use weapon (originally it checked if at least 1 round left) and also when calculating burst size (for example, if you set ammo cost to 2, have 7 bullets in your magazine and burst size is 4: it requires 4*2 = 8 bullets, but you only have 7, so you will get 7/2 = 3 shots which will spend 3*2=6 bullets with 1 left in chamber).
5) More control over vanilla critter_dmg function:
- it is now affected by set_target_knockback and remove_target_knockback functions
- hs_deathanim2 hook script is now called for deaths caused by this operator
This allows for some important features (basically did this for my traps system, like most of the other stuff).
6) Added new "metarule" function (yes, I know, it's bad design, but the underlying code is too complex to make a proper hookscript and adding 4 functions for this seemed like an overkill) to change various aspects of explosions in combat:
- force explosion for any damage type (for example, put DMG_fire here before using molotov: it will create explosion effect and inflict fire damage to primary and all secondary targets - wanamingos are in trouble!)
- change radius (limited to something like 8-10, should be enough unless you are making portable nuke )
- change explosions art FID (allows to add new explosion graphics)
- change explosion effects pattern (allows to change how many effects are created - originally there are 7 of them; right now it just leaves only 1, but it doesn't look right yet)
All changed parameters are effective until current "attack" action is finished. This is useful in conjunction with itemdamage hook script:
- use global script to attach to HOOK_ITEMDAMAGE
- calculate explosion parameters based on weapon used, etc.
- all of them will be reset after attack is finished, so you don't need to worry about resetting