Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,449 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: collision_event [Re: Blade280891] #248716
01/28/09 19:20
01/28/09 19:20
Joined: Apr 2008
Posts: 437
dracula Offline
Senior Member
dracula  Offline
Senior Member

Joined: Apr 2008
Posts: 437
Could someone kindly tell me why this simple code doesn't detect the collision against the walls of the level (blocks created in WED) ?

function test_event()

{
sys_exit("bye bye ...");
}

action test_action()
{
my.emask |= EVENT_IMPACT;
my.event = test_event;

while(1)
{
c_move(my_model,vector(10,0,0),nullvector,GLIDE);
wait(1);
}

}

Everything else works.

Drac.

Re: collision_event [Re: dracula] #248721
01/28/09 19:31
01/28/09 19:31
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Because colliding with blocks triggers the EVENT_BLOCK event.
Thus you need to add it to your emask

Re: collision_event [Re: Xarthor] #248725
01/28/09 19:46
01/28/09 19:46
Joined: Apr 2008
Posts: 437
dracula Offline
Senior Member
dracula  Offline
Senior Member

Joined: Apr 2008
Posts: 437
my.emask |= EVENT_BLOCK;

Doesn't work ??

Re: collision_event [Re: dracula] #248729
01/28/09 19:57
01/28/09 19:57
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline OP
Senior Member
Jaxas  Offline OP
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
function test_event()

{
if(event_type == EVENT_BLOCK) sys_exit("bye bye ...");
}

action test_action()
{
my.emask |= EVENT_BLOCK;
my.event = test_event;

while(1)
{
c_move(my_model,vector(10,0,0),nullvector,GLIDE);
wait(1);
}

}


Check manuel,all truth in there wink


The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)
Re: collision_event [Re: Jaxas] #248732
01/28/09 20:07
01/28/09 20:07
Joined: Apr 2008
Posts: 437
dracula Offline
Senior Member
dracula  Offline
Senior Member

Joined: Apr 2008
Posts: 437
Thanks, however, the collision doesn't run the sys_exit event frown frown

ps you also need wait(1) before the while(1); loop or it crashes.

Drac

Re: collision_event [Re: dracula] #248739
01/28/09 20:56
01/28/09 20:56
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline OP
Senior Member
Jaxas  Offline OP
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
try this:

function test_event()

{
swit(event_type == EVENT_BLOCK) sys_exit("bye bye ...");
}
switch (event_type)
{
case EVENT_BLOCK:
sys_exit("bye bye ...");
return; //try with return and without(just remove this line
}


The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)
Re: collision_event [Re: Jaxas] #248759
01/28/09 22:12
01/28/09 22:12
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline
Expert
Locoweed  Offline
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
Originally Posted By: Jaxas
Check manuel,all truth in there wink


Lol, I wouldn't go so far as to say all truth lies within the lovely 3DGS manual, but yes, it usually helps.


Professional A8.30
Spoils of War - East Coast Games
Re: collision_event [Re: Locoweed] #248805
01/29/09 08:24
01/29/09 08:24
Joined: Apr 2008
Posts: 437
dracula Offline
Senior Member
dracula  Offline
Senior Member

Joined: Apr 2008
Posts: 437
The code still doesn't work.

In the "manual" if you index search for 'emask' and see what you get.

Re: collision_event [Re: dracula] #248808
01/29/09 08:33
01/29/09 08:33
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
The line in the test_action should be
my.emask |= ENABLE_BLOCK;

And the event function should work fine with
function test_event() { if(event_type == EVENT_BLOCK) sys_exit("bye bye ..."); }


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: collision_event [Re: EvilSOB] #248810
01/29/09 08:45
01/29/09 08:45
Joined: Apr 2008
Posts: 437
dracula Offline
Senior Member
dracula  Offline
Senior Member

Joined: Apr 2008
Posts: 437
Hi Evil,

Thanks, I didn't spot the obvious !

Drac.

Page 2 of 3 1 2 3

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

Gamestudio download | 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