It probably uses "item_get_type". The types are listed in "header_items.py" and you can get item nos from "ID_items.py".Bridge_Troll said:How should it know which armor slot to use. Kinda seems a bit random to me.
It probably uses "item_get_type". The types are listed in "header_items.py" and you can get item nos from "ID_items.py".Bridge_Troll said:How should it know which armor slot to use. Kinda seems a bit random to me.
No item shares the same id with another.Bridge_Troll said:Already thought that. Problem is that these no_<item> have all the same ids
How should it know which armor slot to use. Kinda seems a bit random to me.
Ye, but it didn't show any ids for these items. Was tinkering around a bit and found them. Was junst printing the parts of the player slots that had no item at spawn and got the ids for them, it's 1 to 4 for PW._Sebastian_ said:No item shares the same id with another.
The engine automatically decides which armor slot should be used.
Silly question, but you're running this on client yes?Bridge_Troll said:No time to waste, next question
game.addPrsnt seems to be not defined anywhere. I don't know what to do there. I included all the common headers, but no where I am able to find the function addPrsnt.
function onDeath()
--trigger param 1: dead agent id
--trigger param 2: killer agent id
--trigger param 3: 0 = killed, 1 = wounded
--trigger result: 1 = force kill, 2 = force wounded
local AgentID = getTriggerParam(1);
local KillerAgentID = getTriggerParam(2);
local action = getTriggerParam(3);
print("@Trigger: agentid "..AgentID);
print("@Trigger: agentid "..KillerAgentID);
return true;
end
game.addTrigger("mst_conquest", game.const.ti_on_agent_killed_or_wounded, 0, 0, onDeath);
Bridge_Troll said:Hey, me again.
Got a small problem with the on_agent_killed_or_wounded trigger. Seems as if it always returns -1 for the Agent and the KillerAgent.
I add the trigger by doing this:
AgentID and KillerAgentID are always -1 for some reason, not sure why tho.Code:function onDeath() --trigger param 1: dead agent id --trigger param 2: killer agent id --trigger param 3: 0 = killed, 1 = wounded --trigger result: 1 = force kill, 2 = force wounded local AgentID = getTriggerParam(1); local KillerAgentID = getTriggerParam(2); local action = getTriggerParam(3); print("@Trigger: agentid "..AgentID); print("@Trigger: agentid "..KillerAgentID); return true; end game.addTrigger("mst_conquest", game.const.ti_on_agent_killed_or_wounded, 0, 0, onDeath);
function onDeath()
--trigger param 1: dead agent id
--trigger param 2: killer agent id
--trigger param 3: 0 = killed, 1 = wounded
--trigger result: 1 = force kill, 2 = force wounded
local AgentID = game.store_trigger_param(0,1);
local KillerAgentID = game.store_trigger_param(0,2);
local action = game.store_trigger_param(0,3);
print("Trigger param1: "..AgentID);
print("Trigger param2: "..KillerAgentID);
print("Trigger param3: "..action);
--If player was killed, add him to the kill list
if ( action == 0 ) then
--print(AgentID.." died by "..KillerAgentID )
--RespawnCtr:addKilledPlayer(AgentID);
end
return true;
end
game.addTrigger("mst_conquest", game.const.ti_on_agent_killed_or_wounded, 0, 0, onDeath);
I had that thought for a moment, yes, however at the moment the trigger actual fires, these variables have to be set, since it can only be fired if there already is a spawned agent that gets hit, at least that seems logical too me. I am currently checking other triggers, but they seem to work fine.Muzzle C said:Just a thought. Since Lua gets executed before MS could it be that ids are not yet registered at that point.. Just thinking out loud. You could try workaround with ti_agent_hit and check whether damage is greater than receiver's hp.
Damn, alright there is one thing I remembered while talking to a friend of mine just now who just installed it as well.AgentSmith said:I tested it and it works just fine. Maybe there's something wrong with your operations header?
Change the following (line 432):
=============================================
if (opcode in [try_begin,
try_for_range,
try_for_range_backwards,
try_for_parties,
try_for_agents]):
=============================================
to
=============================================
if (opcode in [try_begin,
try_for_range,
try_for_range_backwards,
try_for_parties,
try_for_agents,
try_for_prop_instances,
try_for_players,
try_for_dict_keys,
]):
=============================================
I am about to give up. All operations work fine and all triggers are working just right, except the ti_on_agent_killed_or_wounded. Even stranger is, that it seems to still correctly recognize whether you've died or not. But the AgentID's are lost somewhere.AgentSmith said:I don't get why you don't just use the normal native + wse operations header. Seems like that would avoid a lot of trouble![]()
Was about to ask if it works in MS. Weird...Bridge_Troll said:Well, back to normal MS then. Just added the lua_call in the mission_templates and let it call a function on the trigger, which works fine now. Bit of a workaround, but ye.
I don't know either. I added this to the trigger in the module systemAgentSmith said:Was about to ask if it works in MS. Weird...
(lua_push_int,":dead_agent_id"),
(lua_push_int,":killer_agent_id"),
(lua_push_int,":killed_or_wounded"),
(lua_call,"@onDeath",3),