Hello guys!
I wonder on how to use and create triggers in my 3D scene.So for example , if i go into a door , igot into another part of the map , or into a new map.
I read something about luna script but i am not sure about this.
How to create and use triggers
Re: How to create and use triggers
Scripts won't help you to create such things. You need to find a way you can get collisions between objects, in you situation trigger(plane,box,mesh,..) and some other object.
I don't think I read the same thing about luna script, because from what I read it's used for web app development..
I don't think I read the same thing about luna script, because from what I read it's used for web app development..
Working on game: Marrbles (Currently stopped).
Re: How to create and use triggers
You have to code a trigger-system yourself. Basically it's like serengeor mentioned - you check for collisions. So you create invisible meshes and then check for collisions between those and the objects of interest each frame.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: How to create and use triggers
Yes , using a mesh as a invisible bounding box was what I thought too.
The thing with the luna script was because I saw it in the wow folder of my friend , and it contains some coords...but nevermind.
I will see if I have the know-how to do it.
Thanks so far
The thing with the luna script was because I saw it in the wow folder of my friend , and it contains some coords...but nevermind.
I will see if I have the know-how to do it.
Thanks so far
Re: How to create and use triggers
I just use a vector to store all triggers and use a for-loop to check collision with player every frame.
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
Re: How to create and use triggers
Thats a very good idea with the vector. Thanks will try it this way
Re: How to create and use triggers
if you want to boost performance you can try not to check collision every single frame. you can check it like every xx miliseconds so that the performance will improve slightly. the downside is, it is less accurate, not good for fast moving objects. if your object moves very slow, you can reduce the collision-check rate even further.
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
Re: How to create and use triggers
Im used to create invisible boudning boxes and detect interation to, but what I would suggest if you want tons of triggers in your map, to partition them (using a tree like structure) and then evaluate (using a for-loop) depending on your position if it is possible to interact with something in your region or subregion. This can be efficient if you have tons of npc's, destructible environment or if you simply want a full interaction with your environement.
#include <Iyad.h>