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
2 registered members (Quad, AndrewAMD), 1,007 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
Specific Collision #305864
01/17/10 22:13
01/17/10 22:13
Joined: Mar 2009
Posts: 186
V
Valdsator Offline OP
Member
Valdsator  Offline OP
Member
V

Joined: Mar 2009
Posts: 186
While making some simple games, I've run into one problem that I can not figure out. How do you make something only collide with specific objects. Ex: The box can only collide with "wall05" (which would be the name of an entity).

I'm hoping this is possible.

Re: Specific Collision [Re: Valdsator] #305889
01/18/10 07:16
01/18/10 07:16
Joined: Feb 2009
Posts: 84
Deutschland/Niedersachsen
GorNaKosh Offline
Junior Member
GorNaKosh  Offline
Junior Member

Joined: Feb 2009
Posts: 84
Deutschland/Niedersachsen
You could use str_for_entname(STRING*, ENTITY*); in the event-function to check every specific collision combination.

An other possibility could be to set FLAG2 to models that should be ignored (in WED or via script) and use IGNORE_FLAG2 in your c_move functions.

The third chance I can show you is to use the push-value. With this feature you can make moving Entities collide with Entities that have a higher push-value only. To activate this you have to set IGNORE_PUSH in your c_move function.

greez
Gor Na Kosh

Re: Specific Collision [Re: GorNaKosh] #305976
01/18/10 19:17
01/18/10 19:17
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
... or set a Skill of all models to a different number. Example:
All wall05: skill60 = 1
All Enemies : skill60 = 2
All Items: skill60 = 3
and so on...

Now you can check in your event what you hits with a switch() queries.

Re: Specific Collision [Re: Widi] #306793
01/24/10 23:27
01/24/10 23:27
Joined: Mar 2009
Posts: 186
V
Valdsator Offline OP
Member
Valdsator  Offline OP
Member
V

Joined: Mar 2009
Posts: 186
Thanks. :]

Another question, is it possible to check if an object is colliding with something under it, like the floor. Because I might want a variable to change only when the player is on top of the floor, not falling and touching the side.

Re: Specific Collision [Re: Valdsator] #307413
01/29/10 04:15
01/29/10 04:15
Joined: Mar 2009
Posts: 186
V
Valdsator Offline OP
Member
Valdsator  Offline OP
Member
V

Joined: Mar 2009
Posts: 186
Never mind, figured it out. Used c_trace. tongue But, is it possible to have 2 c_traces for 1 object? Because right now I'm making the jumping controls, and everything works great, but I want the player to start immediately falling when he bonks his head under something (and besides, I might want to use c_trace for other things too, like enemy bullets and such).

Thanks in advance.

Re: Specific Collision [Re: Valdsator] #307414
01/29/10 04:41
01/29/10 04:41
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
you can use as many c_traces as you like, there's no limit, though you should bear in mind this is a slow function so ideally use it sparingly, (16+ per frame is no hassle, but don't have 20 entities doing 16 traces each).

(remember that 'you' will change)

Re: Specific Collision [Re: MrGuest] #307552
01/29/10 22:51
01/29/10 22:51
Joined: Mar 2009
Posts: 186
V
Valdsator Offline OP
Member
Valdsator  Offline OP
Member
V

Joined: Mar 2009
Posts: 186
Is there a way to name c_traces though? Since I then use trace_hit, and I need a way to define which one I'm talking about.

Re: Specific Collision [Re: Valdsator] #307554
01/29/10 23:06
01/29/10 23:06
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Save the trace_hit in a var or array after every c_trace.


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