Paralyzer weapon

Hmmm, two things:

Code:
#define do_en_check  en_dice_roll:=random(3,18); \
  if (((get_critter_stat(oTarget,STAT_en)) + 4) <= en_dice_roll) then begin \
    roll_successfull:=1; \
  end else begin \
    roll_successfull:=0; \
  end

Well, this is just my opinion. Usually in RPGs when somebody makes some kind of check, it's dude roll vs check roll and if dude roll is higher or equal than the check roll, then the dude successfully passes the check, and avoids nasty effects, etc... Looking at your macro it seems it's doing the opposite: if dude roll (end +4) is less or equal to the check roll (3d6) then dude successfully fail the check :P . It's only a matter of wording I guess, but it somehow confusing.

Code:
            do_en_check
            if (roll_successfull == 1) then begin
               float_msg(oTarget,"Ouch!",FLOAT_MSG_RED);
               if (not(iTflag BWAND DAM_KNOCKED_DOWN)) then begin 
                  iTflag := (iTflag BWOR DAM_KNOCKED_DOWN); 
               end
            end
            else begin
               if (not(iTflag BWAND DAM_KNOCKED_OUT)) then begin 
                  iTflag := (iTflag BWOR DAM_KNOCKED_OUT); 
               end
            end

In this code I read: if critter successfully fail (;)) the check then says "Ouch!" in a red manner and is knocked out (if the hit didn't provide already a KO effect). However, if the critter actually passes the check then is knocked out as well (if the hit didn't provide already a KO effect) but without saying a word. Maybe you want to remove that else block entirely?
 
pelicano said:
Well, this is just my opinion. Usually in RPGs when somebody makes some kind of check, it's dude roll vs check roll and if dude roll is higher or equal than the check roll, then the dude successfully passes the check, and avoids nasty effects, etc... Looking at your macro it seems it's doing the opposite: if dude roll (end +4) is less or equal to the check roll (3d6) then dude successfully fail the check :P . It's only a matter of wording I guess, but it somehow confusing.

Yes, you're right, I put the sign in the wrong direction.


Code:
do_en_check
            if (roll_successfull == 1) then begin
               float_msg(oTarget,"Ouch!",FLOAT_MSG_RED);
               if (not(iTflag BWAND DAM_KNOCKED_DOWN)) then begin 
                  iTflag := (iTflag BWOR DAM_KNOCKED_DOWN); 
               end
            end
            else begin
               if (not(iTflag BWAND DAM_KNOCKED_OUT)) then begin 
                  iTflag := (iTflag BWOR DAM_KNOCKED_OUT); 
               end
            end

In this code I read: if critter successfully fail (;)) the check then says "Ouch!" in a red manner and is knocked out (if the hit didn't provide already a KO effect). However, if the critter actually passes the check then is knocked out as well (if the hit didn't provide already a KO effect) but without saying a word. Maybe you want to remove that else block entirely?

Sorry to say, but you haven't read the code closely enough. When the EN roll is successful, the critter is knocked DOWN and not OUT. If it's knocked down, it means it will get up the next round and either attack the player or flee. You cannot search it.
It is only when the roll is a failure, that the critter actually loses consciousness. In Fallout, as you are certainly aware, unconscious critters remain on the ground for several rounds during which you can e.g. search them.

I also realised that the random(3,18) wasn't a fair rendition of the 3d6 roll. I modified the script to perform three separate d6 rolls and add them up. I also changed the way of determining success in a roll, as shown above. Here's the corrected version:

[spoiler:6d75095de9]
Code:
procedure start; 

#include "..\HEADERS\sfall.h" 
#include "C:\Gry\Fallout 2\Fallout 2 Mapper\scripts\HEADERS\DEFINE.H"
#include "C:\Gry\Fallout 2\Fallout 2 Mapper\scripts\HEADERS\COMMAND.H"

#define NAME                    SCRIPT_GLPRLYSR

/* aditional headers here */ 

#define do_en_check              roll1:=random(1,6); \
                                 roll2:=random(1,6); \
                                 roll3:=random(1,6); \
                                 en_dice_roll:=roll1 + roll2 + roll3; \
                                 if (((get_critter_stat(oTarget,STAT_en)) + 4) >= en_dice_roll) then begin \
                                    roll_successfull:=1; \
                                 end else begin \
                                    roll_successfull:=0; \
                                 end
#define is_paralyser_weapon      (obj_pid(oWeapon) == PID_TASER) //Add here appropriate weapon PID(s)

procedure start begin 
   variable begin 
      oTarget; iTarget_dmg; iTflag; 
      oAttacker; iAttacker_dmg; iAflag; 
      oWeapon; en_dice_roll:=0; roll_successfull:=0;
      roll1:=0; roll2:=0; roll3:=0;
   end 

   if (game_loaded) then begin
      set_global_script_type(0);
      register_hook(HOOK_COMBATDAMAGE); 
   end 
   else begin 
      oTarget := get_sfall_arg; 
      oAttacker := get_sfall_arg; 
      iTarget_dmg := get_sfall_arg; 
      iAttacker_dmg := get_sfall_arg; 
      iTflag := get_sfall_arg; 
      iAflag := get_sfall_arg; 
      oWeapon := get_sfall_arg; 
   
      /* Special Effects */ 
      if (is_paralyser_weapon) then begin 
         if (proto_data(obj_pid(oTarget),cr_body_type) == CR_BODY_ROBOTIC) then begin
            display_msg("The Paralyser doesn't seem to have any effect on this critter.");
         end
         else begin
            do_en_check
            if (roll_successfull == 1) then begin
               float_msg(oTarget,"Ouch!",FLOAT_MSG_RED);
               if (not(iTflag BWAND DAM_KNOCKED_DOWN)) then begin 
                  iTflag := (iTflag BWOR DAM_KNOCKED_DOWN); 
               end
            end
            else begin
               if (not(iTflag BWAND DAM_KNOCKED_OUT)) then begin 
                  iTflag := (iTflag BWOR DAM_KNOCKED_OUT); 
               end
            end
         end
      end 
      
      set_sfall_return(iTarget_dmg); 
      set_sfall_return(iAttacker_dmg); 
      set_sfall_return(iTflag); 
      set_sfall_return(iAflag); 
   end 
end
[/spoiler:6d75095de9]
 
pelicano said:
Anyway it looks good. Nasty weapon!

Indeed, should be quite effective at evening the odds when you're outnumbered. Or during slave raids (Ravager69? :wiggle: ). Though in my mod the weapon's range is only 10, so the enemies must come close to actually hit them.

Anyway, such a weapon might come in handy with all the damage formula and armour mods, which generally make you more vulnerable ;-)
 
To tell the truth, the Taser thing in my mod is in fact more of a stun-gun. As for HtH, I've always thought of the super cattle prod as a perfect candidate. :)

It would be no problem adding any weapon to the script :)
 
Of course, i don't know the specifics of your mod (or any scripting and such, so don't bite my head off if this is a dumb question or something :P ) but won't that weapon be overpowered; if the victim succeds it gets knock down, if it fails it gets KO?, and, do you plan to make the weapon be effective only against low-armored opponents? (knocking out a guy in PA with a stun gun doesn't sound too good...)
 
x'il said:
Of course, i don't know the specifics of your mod (or any scripting and such, so don't bite my head off if this is a dumb question or something :P )

It isn't dumb, and I don't intend to dismember you in any way :-)

but won't that weapon be overpowered; if the victim succeds it gets knock down, if it fails it gets KO?, and, do you plan to make the weapon be effective only against low-armored opponents? (knocking out a guy in PA with a stun gun doesn't sound too good...)

You're right, it's very powerful. But it's a quest item available only in one specific moment of the mod and only if you fulfill certain conditions. Plus, the ammo for it is scarce. Plus, the opponents are more powerful (well, they aren't really more powerful, but they usually attack in greater numbers) in my mod and that should even the odds a little bit.

And you're right too that heavily armoured opponents should be exempt from the negative effects. I'll update the script with such an option :-)
 
So, here's the updated script. The weapon will have no effect on critters with Electrical Damage Theshold greater than or equal to 10. So, basically any type of Power Armor and the Tesla Armor protect you entirely from the special KO effect.


[spoiler:2ab0ca8e6e]
Code:
procedure start; 

#include "..\HEADERS\sfall.h" 
#include "C:\Gry\Fallout 2\Fallout 2 Mapper\scripts\HEADERS\DEFINE.H"
#include "C:\Gry\Fallout 2\Fallout 2 Mapper\scripts\HEADERS\COMMAND.H"

#define NAME                    SCRIPT_GLPRLYSR

/* aditional headers here */ 

#define do_en_check              roll1:=random(1,6); \
                                 roll2:=random(1,6); \
                                 roll3:=random(1,6); \
                                 en_dice_roll:=roll1 + roll2 + roll3; \
                                 if (((get_critter_stat(oTarget,STAT_en)) + 4) >= en_dice_roll) then begin \
                                    roll_successful:=1; \
                                 end else begin \
                                    roll_successful:=0; \
                                 end
#define is_paralyser_weapon      (obj_pid(oWeapon) == PID_TASER) //Add here appropriate weapon PID(s)

procedure start begin 
   variable begin 
      oTarget; iTarget_dmg; iTflag; 
      oAttacker; iAttacker_dmg; iAflag; 
      oWeapon; en_dice_roll:=0; roll_successful:=0;
      roll1:=0; roll2:=0; roll3:=0;
   end 

   if (game_loaded) then begin
      set_global_script_type(0);
      register_hook(HOOK_COMBATDAMAGE); 
   end 
   else begin 
      oTarget := get_sfall_arg; 
      oAttacker := get_sfall_arg; 
      iTarget_dmg := get_sfall_arg; 
      iAttacker_dmg := get_sfall_arg; 
      iTflag := get_sfall_arg; 
      iAflag := get_sfall_arg; 
      oWeapon := get_sfall_arg; 
   
      /* Special Effects */ 
      if (is_paralyser_weapon) then begin 
         if (proto_data(obj_pid(oTarget),cr_body_type) == CR_BODY_ROBOTIC) then begin
            display_msg("The Paralyser doesn't seem to have any effect on this critter.");
         end
         else begin
            if (get_critter_stat(oTarget,STAT_dmg_thresh_electrical) >= 10) then begin
               display_msg("The Paralyser doesn't seem to have any effect on this critter.");
            end
            else begin         
               do_en_check

               if (roll_successful == 1) then begin
                  float_msg(oTarget,"Ouch!",FLOAT_MSG_RED);
                  if (not(iTflag BWAND DAM_KNOCKED_DOWN)) then begin 
                     iTflag := (iTflag BWOR DAM_KNOCKED_DOWN); 
                  end
               end
               else begin
                  if (not(iTflag BWAND DAM_KNOCKED_OUT)) then begin 
                     iTflag := (iTflag BWOR DAM_KNOCKED_OUT); 
                  end
               end
            end
         end
      end 
      
      set_sfall_return(iTarget_dmg); 
      set_sfall_return(iAttacker_dmg); 
      set_sfall_return(iTflag); 
      set_sfall_return(iAflag); 
   end 
end
[/spoiler:2ab0ca8e6e]
 
Back
Top