Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AndrewAMD, alibaba, Konsti, 2 invisible), 1,418 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
something like an "in object" command? #398708
04/05/12 13:52
04/05/12 13:52
Joined: Mar 2011
Posts: 69
Munich (Germany)
LPF Offline OP
Junior Member
LPF  Offline OP
Junior Member

Joined: Mar 2011
Posts: 69
Munich (Germany)
what i need is a proper detection if an object is in another object or not: mainly i need water or lava thet can have any shape, and can change this shape at runtime (animated water/lava), so: if i have an animated passable water dragon, that my player can swim through, how can i test if my player is inside the polgonal shape or not?


..oooO .........
..(....)..Oooo..
...\..(...(....)..
....\_)....)../..
...........(_/...
...ICH WAR....
........HIER....
Re: something like an "in object" command? [Re: LPF] #398711
04/05/12 14:01
04/05/12 14:01
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
pXent_settriggerflag (ENTITY* entity, var type, var trigger)
This function uses the volume of a static physics entity as a trigger area that generates an ENABLE_TRIGGER event.
Parameters:
entity Registered PH_STATIC entity.
type NX_TRIGGER_ON_ENTER
NX_TRIGGER_ON_LEAVE
NX_TRIGGER_ON_STAY
NX_TRIGGER_ENABLE (sets all 3 flags together)
trigger 1 = on, 0 = off

Returns:
Trigger area number if successful, 0 otherwise.
Remarks:
This function also sets the entity's ENABLE_TRIGGER flag.
In the event function, the me/my pointer is the trigger area entity, the you pointer is the physics entity that collides with the trigger.
Physics trigger areas work with physics entities only, and are used in special cases when a non-rectangular trigger zone is required. For normal trigger zones that work with all entities, use the region_check command. Do not set trigger areas on dynamic (PH_RIGID) physics objects.
Speed:
Fast
Example:
function EventTrigger()
{
reset(my,TRANSLUCENT); //to visualize the collision
pX_setforcemode(NX_FORCE);
pXent_addexplosion(you,my.x,500,my.max_x/2); // you is the entity that collides with the trigger object
wait(-1);
set(my,TRANSLUCENT);
}
...
ENTITY* trigger_zone = ent_create("earth.mdl",vector(0,0,0),NULL);
pXent_settype(trigger_zone,PH_STATIC,PH_SPHERE);
pXent_settriggerflag(trigger_zone, NX_TRIGGER_ON_ENTER, 1);
trigger_zone.event = EventTrigger;
from a8 manual but i gues you looking for
something diffrent


Compulsive compiler

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1