ThegreatBenDoyle
First time out of the vault
It could also be used for dual wielding pistols
It could also be used for dual wielding pistols
I have a partial solution for the what's in the inactive hand problem, this may provide you with a start for a complete solution
variable Count:=inven_count(dude_obj);
display_msg("Slot 1 "+obj_pid(inven_ptr(dude_obj,Count-1))); //Armor
display_msg("Slot 2 "+obj_pid(inven_ptr(dude_obj,Count-2))); //Right Hand
display_msg("Slot 3 "+obj_pid(inven_ptr(dude_obj,Count-3))); //Left Hand
If a specific slot is not being used, the open slot returns an item PID from general inventory that I have been unable to predict, not that I tried to.
For instance, if the left slot has nothing in it then some item from inventory not in armor or right hand will be returned.
Update: Or maybe you could use critter_add_trait to change dudes light radius and intensity when the flashlight goes on or off.
And I have two scripting questions.
Is it possible to return the actual attack roll from combat. Not the number needed to hit but the random number the engine compares to the to hit number. If so how is it done.
How can a global script keep looping to a given procedure without using a hook. I'm trying to trap karma changes and there's no hook for that. I've tried using add_timed_event with self_obj and dude_obj. I've also went brute force and had the procedure call itself but the loop stops after 340 iterations.
I am fiddling with a Perk I'm calling Two Gun Kid, if I manage to get it to work it will allow using a pistol of the same type, but allowing different ammo, in each hand.
I was even pondering using map scripts to keep track of whether or not the flashlight (or any light) was activated. However, the problem comes in when you try to account for the player removing the flashlight from the hand and placing it in the backpack. If the player did that, without a check of the inactive hand, then the player could essentially have the flashlight on all the time on any map, without using one of the hand slots.
I think @MIB88 means that it is still allowing unlimited party size, I was the one confused.
So yes, Cult of Personality allows unlimited followers .
Not sure if troll or just stupid. There is no "the check". There can be any check in a script that scripting language allows.And here you are, a perfect example. You really ought to see somebody about that. But I doubt you can be helped.
But, one last time: The code you posted is basic... An easy enough check. Again, try to get this through your thick skull: the check only works for the active hand. One hand at a time... Not both. If your character is holding two different weapons one in each hand, do they both fire when you Attack? No, because they are not both active. The game checks for things in your active hand.
Sure. So all this time you've been wanting to create a flashlight that specifically works in off hand and doesn't work in active hand? Your excuses are pathetic.Our original requirement? No. You got it wrong. We were not talking about checking if a specific item is in any hand. The original requirement was how to get the game to acknowledge that something is specifically in the inactive hand... Left or right hand is irrelevant. The code that you keep posting does not do that.
procedure start begin
register_hook_proc(HOOK_INVENTORYMOVE, flashlight_handler);
end
procedure flashlight_handler
Slot := get_sfall_arg;
ItemOn := obj_pid(get_sfall_arg);
ItemOff := obj_pid(get_sfall_arg);
if Slot == 1 or Slot ==2 then
if ItemOff==PID_Flashllight then
set gvar to off
This is a modification of code from a script I'm working on. The variables are declared at top level for use throughout the script.
The attack roll is for a script for G11 bursts. The G11 has such a high cyclic rate that the last round of it's three round burst leaves the barrel before the gun recoils. What I want to do is determine the effects of the burst by how much the to hit number is made by such as, if made exactly only one bullet would actually strike, if made by one one bullet with a 50% chance of another, and perhaps criticals in a similar manner. I will also try to add targeted bursts. I will try to add a long burst mode for all burst capable guns that don't exhaust the magazine in one burst.
Looks great.2 shot animation for pistol in combat armor, let me know what you think. https://www.dropbox.com/s/xt0bsq05jmu55g8/HMCMBTHK.FRM?dl=0
Yes I have your latest, I'm using it for my, currently, feeble attempts at modding.Thanks for the code. I will see what I can do with this.
As for what you are trying to do, it completely makes sense. I don't know how exactly it could be done, though. Do you have the latest Megamod? There is a hook script in there: hs_tohit. Maybe there is something in there you can use.