Community Forum

Problem with TriggerCallback

Forum Overview >> Scripting

CategoryScripting
Created04.07.2010 11:18


Andreas Großschedl (Unknown) 04.07.2010 11:21
Hi!

I have a Problem to reach the Trigger Callback function. I tried this:

Map_Kuhstall = {};

_G.KuhstallonCreate = function(id)
--print("Kuhstall Geladen(Trigger)");
Map_Kuhstall:MilchkammerTriggerLoad(id)
end;

function Map_Kuhstall:MilchkammerTriggerLoad(id)
print("Kuhstall (MKTrigger id): " .. id);
print("Name: " .. getName(id));

addTrigger(id, "MKTrigger", self);
self.MKTrigger=Map_Kuhstall.MKTrigger;

end;

function Map_Kuhstall:loadMap(name)
print("loadMap (name): " .. name);
end;

function Map_Kuhstall:deleteMap()
end;

function Map_Kuhstall:delete()
end;

function Map_Kuhstall:mouseEvent(posx, posy, isDown, isUp, button)
end;

function Map_Kuhstall:keyEvent(unicode, sym, modifier, isDown)
end;

function Map_Kuhstall:update(dt)
end;

function Map_Kuhstall:draw()
end;

function Map_Kuhstall:MKTrigger(triggerId, otherId, onEnter, onLeave, onStay)

print("MK Trigger Callback"..otherId);
if onEnter then
if otherId==Player.rootNode then
print("Spieler im Trigger MK"..Player.rootNode);
end;
end;

end;

addModEventListener(Map_Kuhstall);


the script will be loaded, but i dont get to the MKTrigger function.

Heady Planet-ls (Headshot XXL) 04.07.2010 11:33
You should "self.MKTrigger=Map_Kuhstall.MKTrigger;" delete. And check the collisionsmask of the trigger is "ff".

Andreas Großschedl (Unknown) 04.07.2010 11:58
Thank you - collision mask was not ff! But what does this mean?

Sven Köhler (Unknown) 04.11.2010 01:16
Try g_currentMission.player.rootNode ;-)

MfG Sven


Note: Log in to post. Create a new account here.