Hello, everyone!
I'd like to ask two questions about using sfall functions in an NPC script.
Q1:
The question is about drug items in Fallout 2. I'd like to read the value representing the time that a drug item lasts on the player. I read sfall's functions and found this:
Would that be the right function to do it? If yes, what offset should I provide and where/how to find it? Unfortunately, I know nothing about offsets, HEX and all that :/
What do I need it for: I'd like to set an event that will happen when a drug wears off. For example:
1. Dude uses a drug on themselves. The drug lasts for 60 minutes.
2. I set a local_var to game_time + 60 minutes (this value - 60 minutes - should be read from the drug proto).
3. When the drug expires, the game_time > local_var and something happens (e.g. global_var + 1)
Q2:
The other question is about lists (I think). I'd like an NPC to perform a sneak roll for every weapon item found in Dude's inventory. I believe I should make a list of all dude's weapons, then cycle through them and check Sneak, right?
Problem is, I only found list functions for cycling through items/scenery pieces/critters on a map. Is there any way I could check dude's weapons without having to check for every single weapon pid in the game?
***
I'll be extremely grateful for any insight you could share on these matters. Thank you very much in advance!
I'd like to ask two questions about using sfall functions in an NPC script.
Q1:
The question is about drug items in Fallout 2. I'd like to read the value representing the time that a drug item lasts on the player. I read sfall's functions and found this:
sfall function notes said:get/set_proto_data are used to manipulate the in memory copies of the .pro files fallout makes when they are loaded. The offset refers to the offset in memory from the start of the proto to the element you are reading, and is equal to the file offset minus 12.
Would that be the right function to do it? If yes, what offset should I provide and where/how to find it? Unfortunately, I know nothing about offsets, HEX and all that :/
What do I need it for: I'd like to set an event that will happen when a drug wears off. For example:
1. Dude uses a drug on themselves. The drug lasts for 60 minutes.
2. I set a local_var to game_time + 60 minutes (this value - 60 minutes - should be read from the drug proto).
3. When the drug expires, the game_time > local_var and something happens (e.g. global_var + 1)
Q2:
The other question is about lists (I think). I'd like an NPC to perform a sneak roll for every weapon item found in Dude's inventory. I believe I should make a list of all dude's weapons, then cycle through them and check Sneak, right?
Problem is, I only found list functions for cycling through items/scenery pieces/critters on a map. Is there any way I could check dude's weapons without having to check for every single weapon pid in the game?
***
I'll be extremely grateful for any insight you could share on these matters. Thank you very much in advance!