Fallout 2 mod Megamod version 2.46 Bug Reports and Suggestions - Closed

It could also be used for dual wielding pistols

I suppose that is one possible future application, but that is not something I think I could pull off. However, there is another fix for that, too. Mr. Fixit! to the rescue! Combine two similar pistols into one item. That new item would have weapon stats equal to two of those weapons (plus any penalties) and could have it's own unique art (if some talented/dedicated artist had the time to create it). I think it was Mr.Wolna who created the Golden eagle mod that had a dual-wielding Little Jesus enemy...
 
Last edited:
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.
 
Last edited:
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.

This kinda makes sense to me. I mean, anything in the inactive must be considered inventory. But, as you've said: how do you predict what will be called? Or, put another way, how do you exclude everything else in the inventory? Hmm....
Thanks. I will see if I can figure out a way to use this.

Update: Or maybe you could use critter_add_trait to change dudes light radius and intensity when the flashlight goes on or off.

I could use a global/map variable or add something to the obj_dude script to modify the light level. That is the easy part. The problem comes in, though, when the player tries to exploit it. Without a means of tracking to make sure it is still in the active or inactive hand, the player could turn it on, drop it or place it in inventory without turning it off, and the light would still be on the character. (Although, I could add a check to make sure the light stays in inventory.) I am trying to prevent that exploit, too.

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.

Oh, wow. I don't have an answer to either one of those. But... Well, I am curious about the first one regarding the attack roll. What would you do with that number? I might have a possible workaround if I knew what your intention with it was...

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.

This sounds very cool. I truly hope you get this working.

@ThegreatBenDoyle
Well, sfall does allow additional animation codes to be used. That would be great if you could make some animations. I know it is a pain... a very tedious process. But I would definitely like to see something new like that.
 
Last edited:
It depends on vonzorch I guess, would the perk allow the gun firing sound to play twice? That will determine if I make both guns fire at once or one then the other.
 
You could use something like this to prevent the exploit..

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.

For Two Gun Kid they should fire at the same time. The game has pistols taking far too long to shoot. I actually shoot, if rather poorly, but I can put 17 rounds into two man size silhouette targets separated about 90 degrees in less than 15 seconds, two shots then change targets, with a magazine change after the first 9 rounds. I have done a gun mod which makes it possible to fire all auto pistols using 1ap with Fast Shot and Bonus rate of fire.
 
Last edited:
Same time is easier to draw anyway, if you want I could make them fire more than once as well since it wouldn't require any additional frames.
 
Reports:

Coldheart's lair

-The traps on the lower level work as normal and rt-click Traps skill let's you disarm them but the upstairs traps give the error 'no traps found'

Gecko
- like someone else reported, the Enclave plains encounter after contact in the Psoiden #5 computer doesn't always fire off. If you save just before leaving Gecko and load the game the encounter never happens (I tried reloading 8 times and leaving gecko/returning about 3 times each reload) although you do get the message in the box that says: "You encounter men in special armor" (paraphrased)
-error in Skeeter's dialog. If you brought him his Super Snap-on toolkit and then he asks you to retrieve the 3 handed plasma thingie and you have already taken the free weapon modification from retrieving the toolkit then his dialog gets corrupted. If you keep the plasma part off your person then he asks where it is, if you have it then he says the last dialog of the previous conversation that you've had (for me it was with Cassidy and with Vic on 2 different saves). So some dialog end pointer is missing. You do get the 350 exp and the message for bringing him his plasma part but you do not get the free weapon mod.
--The dialog does work if you don't take the free weapon mod before giving him his plasma part. He'll thank you for the part and then offer you a free weapon mod. So something to do with the free weapon mod pointers in the scripts. They can't be stacked for 2 freebies and if you take the first freebie then the plasma turn-in script fails.
 
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.

Not sure if this is helpful, but I noticed that a light came on around Klint or Sulik when they were accessing their inventory while they had a SMG and envenomed spear in hands. I am controlling them with the ddraw.ini choice for control over companions. If the inventory access script causes a light to turn on can you cause a opponent creature to be accessing their inventory thus causing a light to be on around them during the companion or player's turn?
 
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 :dance:.

CH 10 is pretty steep requirement even when having Gifted trait I couldn't seem to get to 10 CH and be able to get some decent fighting perks, not even Better Criticals unless I dropped to EN 2 which seems to get me killed in first rounds from low HP's or dropping to IN 4 which isn't as fun as I'd hoped.

BUT, Cult o Personality character would be a general and not need to do much DMG themselves.

The logistic problems of moving can be so irritating. The Modoc mine map with Klint, Sulik, Vic and was hard to maneuver at the start point I had to push them all about to get through. Just imagine having 12 companions on some of the entry points of the maps! They weren't made for it and you'd maybe never be able to push folks around and get through.

It sounds fun to try but I'm expecting there to be a hell of a lot of frustrating micro-manipulation of the companions when entering maps.
 
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.
Not sure if troll or just stupid. There is no "the check". There can be any check in a script that scripting language allows.

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.
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.
 
obj_pid(critter_inven_obj(obj_dude, INVEN_TYPE_LEFT_HAND))
obj_pid(critter_inven_obj(obj_dude, INVEN_TYPE_RIGHT_HAND))

Burn, you moron. Those both return 0 when checking the inactive hand, no matter what is in that hand.
Give it a rest.
 
All right, this is embarassing, but it appears you're right. I'm sorry, I take it all back.
 
Last edited:
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.

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.


@alatari
Thank you for the bug reports. I will add them to my list. However, I have a question regarding the Gecko/Enclave encounter: Did you ever get that encounter? It doesn't happen right away. There is a time delay. You make them angry, leave the power plant, and then some time later you encounter them. It isn't supposed to happen right away. You would not encounter them until your next visit to Gecko, say, after visiting Vault City and returning again. And even then, it only occurs if you enter the main Gecko map. You can bypass the encounter if you go right to the junkyard map. (I need to fix that.)
 
Last edited:
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.
Yes I have your latest, I'm using it for my, currently, feeble attempts at modding.
I think I have a way using how_much(val), but Sfall Script Editor gives me an error when I try to use it, and how_much gets treated like a constant 0. I'll go whine to Phobos2077 about it on GitHub. The other method would to do the die roll in the script, but that would probably require script_overrides, but the command reference isn't clear about how it is used and nothing in the mapper scripts gives an example. I believe you said something about using Noid's Ruby compiler. I'll try to get it to work on my Linux system, but I've never used Ruby.
 
Back
Top