Tamkis
Lua Grasshopper
Just a quick but somewhat dumb question on LUA's HurtMsg Hook: What is the best way to print the message itself for getting damaged by weapons? In a vanilla netgame match, if for example, I (Tamkis) get hit by user RandomDude's RailRing, the message that prints is "Tamkis got hit by RandomDude's Rail Ring". Does the function automatically print the string in the console?
I am trying to edit the message printed when user are hit with some custom weapons. Could I have an example on how to use (and most importantly, print a message) in the same format above using a Rail Ring as an example?
I am trying to edit the message printed when user are hit with some custom weapons. Could I have an example on how to use (and most importantly, print a message) in the same format above using a Rail Ring as an example?
HurtMsg
Hook format: addHook("HurtMsg", functionname)
Function format: function(player_t player, mobj_t inflictor, mobj_t source)
Used to create custom hurt messages for players, or to change an existing one. Executes when an object is being damaged during the use of P_DamageMobj. player is the player that was hurt, inflictor is the mobj that hurt the player, and source is the mobj responsible for the inflictor's existence. Note that inflictor and/or source may be nil, and should be checked for existence and validity before being accessed or checked to prevent errors. Returning true will override the message printed to the console by taking damage in multiplayer, and returning false will run alongside it instead.
Last edited: