Proper syntax is:
OnEquip = function (self,being)
your_actions
end,
Thanks I am trying that right away.
EDIT : alright this works however I can't make more than one function to work on an item, when I try to put a second one, like for :
OnEquip = function (self,player)
player.res_acid = player.res_acid+50 end
OnRemove = function (self,player)
player.res_acid = player.res_acid-50 end
The crashlog tells me that the last line of the second one (where I remove the res bonus) is expected to close my whole item declaration even though neither notepad++ nor I see a syntax error.
here I just changed the enabled functions but the issue is still the same (second function in order fucking up)
Embedding the second function in the first allows the game to launch but will ultimately cause an error on use.
--------------------------
Damage_Add is still a valid item attribute. I've manipulated it in 0997 with success before. Other options for boosting damage on equip would be adjusting the player's todamall trait.
Don't know why, it just did not accept damage_add, unless it takes upper casing into account, I don't think I made a mistake. Also I don't want to boost the overall player damage, just the weapons, so the "XdY+Z" notation is perfect.
Now for critiques. Why are you adding these adjustments to the OnEquip hook when you can just modify the item directly?
For damage I don't, that's is unrelated. Sorry if I was not clear about it. I do this for the later (resistances), which aren't handled by weapons.
You are also increasing/decreasing attributes by fixed amounts. For resistances I *think* that's the right way to do it but for movetime it NEEDS to be a multiplier (player.movetime = player.movetime * 1.05). If you don't do this the math gets wonky fast and can easily be exploited for good or for ill.
That clears some things up, thanks.
Player sounds may or may not be modifiable. The sound engine is still one of the weak spots in DoomRL modding. IF they can be changed it would be with this code:
beings["soldier"].sound_melee = core.resolve_sound_id("your_sound")
You can reuse another being's sound by replacing "your_sound" with their sound name. For instance, "soldier.melee" would be the player's default punching noise. If you have a custom sound in your /sound directory then you would replace "your_sound" with its extension-less name.[/quote]
I'll try that, however I noticed the sound_ID were different from the actual sound file names eg : the ID for the shotgun fire is "shotgun" but the filename is "dsshotgn". How does the game differentiate ID from filename?
As for quick_weapon that cannot be abused. Only cursed weapons block the equip/unequip logic.
My aim isn't to prevent the weapon from just being unequipped but also to prevent the player from changing weapon at all, ie : note being able to switch to the "prepared" slot.