Rick Posted December 2, 2009 Share Posted December 2, 2009 So to set a target you drag an entity to another. Does this trigger any sort of event in the receiving target entity or is there a way I can force the Spawn() method to be called? The reason I ask is because I'm playing around with a switch criteria to determine what scripts to play for a volume trigger. My idea is that this could be designed in the editor. Let's say I have 2 switches in my scene. I name them, "TookCamera" and "KilledGuard". I then would like to make these 2 targets of my volume trigger. The reason I want to know about this event inside my volume trigger is so that I can actually add a property radio button for the switch that gets added with the name of the switch. This way in the properties of the volume trigger I can say run this function on collision IF TookCamera is ON and KilledGuard is OFF and run this other function on collision if TookCamera is OFF and KilledGuard is ON etc. This would allow some pretty dynamic gameplay and all we would need to make it work is some kind of way of knowing when a target was added/removed. Quote Link to comment Share on other sites More sharing options...
Josh Posted December 2, 2009 Share Posted December 2, 2009 I'm not sure I understand this. Maybe you should consider logic entities, where you are basic dragging an If statement into the scene. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
TylerH Posted December 2, 2009 Share Posted December 2, 2009 Oh wow, I completely forgot that now that we can have Lua scripted entities we can code up Logic entities. I will throw some together and post them up for others to utilize. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Rick Posted December 2, 2009 Author Share Posted December 2, 2009 That's possible also. Is there currently a way to know when a target is set, or would I need to poll in the Update() method to search for targets assigned to the entity? I was just thinking the volume trigger would have come properties like: CollideScriptFile = "mycollide.lua" CollisionOption1 -- these options could be static or maybe dynamic if possible Function = "MyCollide1" -- what function to run that is in mycollide.lua TookCamera On/Off -- this is what I was talking about. TookCamera would be the name of a switch you dragged into your scene. When you make it the target of this trigger it would dynamically add this property setting KilledGuard On/Off CollisionOption2 Function = "MyCollide2" TookCamera On/Off KilledGuard On/Off CollisionOption3 Function = "MyCollide3" TookCamera On/Off KilledGuard On/Off So what this is saying is when the player collides with this volume trigger, it would run different scripts based on the settings of some switches. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.