Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Collision with entity, platform or enemy? #300343
12/01/09 16:36
12/01/09 16:36
Joined: Dec 2009
Posts: 8
S
Spkka Offline OP
Newbie
Spkka  Offline OP
Newbie
S

Joined: Dec 2009
Posts: 8
Hey, I got a problem while checking player collision with enemy entities. I also got moving platforms etc which are also entities.
I know I can use EVENT_ENTITY, but how can I figure out wether or not the entity is an enemy? The entities are placed in the WED, so not created with ent_create.

Thanks in advance

Re: Collision with entity, platform or enemy? [Re: Spkka] #300363
12/01/09 17:57
12/01/09 17:57
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Use a skill for that. For example: enemys.skill70 = 1, Platforms = 2, Items = 3 and so on. Now in your event you can read the you.skill70 from the Entity that make the collision with your Player. You can use the following code:

if(!you) {return;} // collision with blocks...
switch(you.skill70)
{
case 1: collision_enemy_func(); break;
case 2: collision_platform_func(); break;
case 3: collision_item_func(); break;
}

Re: Collision with entity, platform or enemy? [Re: Widi] #300379
12/01/09 20:54
12/01/09 20:54
Joined: Dec 2009
Posts: 8
S
Spkka Offline OP
Newbie
Spkka  Offline OP
Newbie
S

Joined: Dec 2009
Posts: 8
Thank you

Re: Collision with entity, platform or enemy? [Re: Spkka] #300380
12/01/09 21:21
12/01/09 21:21
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Widi's idea is good but you may choose to use a skill number
a lot less than 70.
It may he helpfult to remind/inform you that only skills 1 through to 20
are available through WED.

So if you choose a skill below 21, you can SET your "enemy-type" skill
stright from inside WED, without mucking about in script.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial

Moderated by  HeelX, Spirit 

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