DoomRL > Modding
Changing the ammo system?
Autoquark:
--- Quote from: yaflhdztioxo on March 31, 2013, 12:20 ---We have custom item properties? I thought that was beings only...
--- End quote ---
You definitely do, I've been using them.
--- Quote from: yaflhdztioxo on March 31, 2013, 12:20 ---If you are worried about modding, I think you could fix this by using a custom item property to keep track of which mode the weapon is in. In OnFire and OnFired, you can subtract 3 shots and add 3 accuracy, but only if the weapon is in "alt-fire-mode", and in OnAltFire you can add 3 shots and subtract 3 accuracy, but only if the weapon is in "normal-mode". It still isn't perfect because the effect of a mod sometimes depends on the item's current stats which may be in either mode, so you could also try resetting the stats to normal mode in OnEquipTick.
--- End quote ---
The problem with this is that OnEquipTick seems to be called before OnAltFire - at any rate, if I press alt fire then cancel the targeting, the alt fire stats remain until another tick has passed, so if I apply a mod pack immediately, it acts on the alt fire stats. The alt fire stats also remain if I immediately unequip the item, but this can be fixed with the OnRemove hook. So it almost works, but without any hook being called immediately after cancelling targeting, I don't see how I can make it perfect. Is there any chance we could get an OnCancelFire hook in the next version?
EDIT: I've decided to fix this by putting an extra check in all of my mod packs which will prevent a mod being applied in the one turn when the stats are wrong. It's not ideal, but as I'm not planning on using any of the original mod packs, it should work. I also have another question: From experimentation it seems that a being's scount can become negative without causing errors. What's the lowest value that it can be safely set to? Or are negative values not intended to be used at all?
EDIT2: Could I have an up to date list of the names of the ally prototype fields? When I use the values from the wiki, it doesn't recognise some of them.
tehtmi:
--- Quote from: Autoquark on March 31, 2013, 13:46 ---I also have another question: From experimentation it seems that a being's scount can become negative without causing errors. What's the lowest value that it can be safely set to? Or are negative values not intended to be used at all?
--- End quote ---
Scount is a 32-bit signed integer, so it can be as small as -2147483648. I found one bug relating to the player having a negative scount however. It may not occur very much in practice because it only happens on the player's turn (when the player's scount will usually be positive).
--- Quote ---EDIT2: Could I have an up to date list of the names of the ally prototype fields? When I use the values from the wiki, it doesn't recognise some of them.
--- End quote ---
Ally? I'm not sure what you're referring to.
Autoquark:
--- Quote from: tehtmi on April 03, 2013, 04:45 ---Scount is a 32-bit signed integer, so it can be as small as -2147483648. I found one bug relating to the player having a negative scount however. It may not occur very much in practice because it only happens on the player's turn (when the player's scount will usually be positive).
--- End quote ---
So far I'm only changing monster's scount values, so I guess I'll try allowing them to go negative. I'll post if anything odd happens.
--- Quote from: tehtmi on April 03, 2013, 04:45 ---Ally? I'm not sure what you're referring to.
--- End quote ---
Oops. I meant to say "Being". I think I typed ally because one of the error fields was "group" and I'd tried "ally" and "allegiance" as random guesses at what the new name was.
tehtmi:
Being prototype:
--- Code: ---core.register_blueprint "being"
{
-- fieldname = { required, type, [default] }
name = { true, core.TSTRING },
name_plural = { false, core.TSTRING },
id = { false, core.TSTRING }, -- doesn't need to be in the prototype table; id is passed to the declaration function
sound_id = { false, core.TIDIN("beings") },
ascii = { true, core.TSTRING },
color = { true, core.TNUMBER },
sprite = { true, core.TNUMBER },
coscolor = { false, core.TTABLE },
glow = { false, core.TTABLE },
overlay = { false, core.TTABLE },
hp = { false, core.TNUMBER , 10 },
armor = { false, core.TNUMBER , 0 },
attackchance= { false, core.TNUMBER , 75 },
todam = { false, core.TNUMBER , 0 },
tohit = { false, core.TNUMBER , 0 },
tohitmelee = { false, core.TNUMBER , 0 },
speed = { false, core.TNUMBER , 100 },
vision = { false, core.TNUMBER , 0 },
min_lev = { true, core.TNUMBER },
max_lev = { false, core.TNUMBER , 10000 },
corpse = { false, core.TANY, 0 },
danger = { true, core.TNUMBER },
weight = { true, core.TNUMBER },
xp = { false, core.TNUMBER },
bulk = { false, core.TNUMBER , 100 },
flags = { false, core.TFLAGS, {} },
ai_type = { true, core.TSTRING },
is_group = false, -- hard-coded prototype value; can't be specified
res_bullet = { false, core.TNUMBER, 0 },
res_melee = { false, core.TNUMBER, 0 },
res_shrapnel= { false, core.TNUMBER, 0 },
res_acid = { false, core.TNUMBER, 0 },
res_fire = { false, core.TNUMBER, 0 },
res_plasma = { false, core.TNUMBER, 0 },
desc = { true, core.TSTRING },
kill_desc = { false, core.TSTRING },
kill_desc_melee = { false, core.TSTRING },
weapon = { false, core.TANY },
OnCreate = { false, core.TFUNC },
OnAction = { false, core.TFUNC },
OnAttacked = { false, core.TFUNC },
OnDie = { false, core.TFUNC },
OnDieCheck = { false, core.TFUNC },
OnPickupItem = { false, core.TFUNC },
}
--- End code ---
Autoquark:
Thanks. Could you tell me what the names of the built in ai types are?
EDIT: Although I've set the weight of all the normal doomRL enemies to zero, the game is still generating special rooms full of lost souls, and it also seems to be generating imps on some levels. Is there any easy way to stop this?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version