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 (AndrewAMD), 16,038 guests, and 5 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
Detect collision without c_move ? #223782
08/26/08 17:28
08/26/08 17:28
Joined: May 2007
Posts: 46
R
ribsribs Offline OP
Newbie
ribsribs  Offline OP
Newbie
R

Joined: May 2007
Posts: 46
Hello all!

I would like to know how to detect if there was a collision between two entities (no need to glide or such, just detect) but without using c_move or simillar.

Here's the problem:

I have a LandPad, static, and a ship in which is attached the action to its movement. The ship is surrounded by a circle, another model, that reads the ship position to position itself.

The collision must be detected between the LandPad and that circle.

C_move exists in the action that is attached to the ship, not the circle.
I've thinked in moving the LandPad sooooo slooooow that we cannot understand but with c_move to detect collision with the circle around the ship, but i want to believe that there is another solution.

I hope i've made myself clear about the problem.

Thanks in advance!!

Last edited by ribsribs; 08/26/08 17:30.
Re: Detect collision without c_move ? [Re: ribsribs] #223799
08/26/08 18:51
08/26/08 18:51
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline
Expert
mpdeveloper_B  Offline
Expert

Joined: Feb 2006
Posts: 2,185
if you use c_move you could do something like this:

var z_; z_ = my.z; c_move(me, vector(0,0,100), nullvector, 0); my.z = z;

otherwise you could use c_trace and trace upwards from the pad.


- aka Manslayer101
Re: Detect collision without c_move ? [Re: mpdeveloper_B] #223800
08/26/08 18:52
08/26/08 18:52
Joined: Oct 2004
Posts: 1,655
T
testDummy Offline
Serious User
testDummy  Offline
Serious User
T

Joined: Oct 2004
Posts: 1,655
vec_dist with entity list

Re: Detect collision without c_move ? [Re: testDummy] #223802
08/26/08 18:58
08/26/08 18:58
Joined: May 2007
Posts: 46
R
ribsribs Offline OP
Newbie
ribsribs  Offline OP
Newbie
R

Joined: May 2007
Posts: 46
Hmm, Thanks a lot guys, but i need a polygon detection. It is not a usual LandPad. Think of it like a garage or a hole. It has boundaries and the circle on the ship... well, it's a circle.

Does C_Trace traces neareast polygons or object centers?

Re: Detect collision without c_move ? [Re: ribsribs] #223819
08/26/08 20:12
08/26/08 20:12
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline
Expert
mpdeveloper_B  Offline
Expert

Joined: Feb 2006
Posts: 2,185
check the manual. You can detect using polygon collision and get the vertex of the model, by using vec_for_vertex you should be able to get exact positions of the vertex that was hit. You can also use normal to detect which way the normals were facing. It does have some complex poly collision if you choose to use it, but be wary, any collision detection in 3DGS takes alot of framerate if there are multiple objects using it, c_trace takes the most out of all the commands.


- aka Manslayer101
Re: Detect collision without c_move ? [Re: mpdeveloper_B] #223857
08/26/08 23:42
08/26/08 23:42
Joined: May 2007
Posts: 46
R
ribsribs Offline OP
Newbie
ribsribs  Offline OP
Newbie
R

Joined: May 2007
Posts: 46
I'm desperate. Always the same thing in collisions frown
I've tried pretty much everything i could reach but i can't get the result i want.

Here are the actions attached to each entity:

function event_col()
{
if((event_type == event_entity)&&(you == Orbulon)){Vals.alpha=5;} //alpha change only to see if collision was detected
}

action LandPad()
{
Pad=me;
my.event = event_col;
my.polygon=on;
while(1)
{
move_mode=ACTIVATE_TRIGGER+IGNORE_PASSABLE;
ent_move(vector(0.001,0,0),nullvector);
wait(1);
}
}


action Orb()
{
Orbulon=me;
my.polygon=on;
while(1)
{
vec_set(my.x,Ship.x);
my.pan+=random(OrbulonRate)*time;
wait(1);

}
}

Thanks a lot for every reply and for the time spent!
By the way, A7 C here

And the screenshot to better get the situation:



Last edited by ribsribs; 08/26/08 23:45.
Re: Detect collision without c_move ? [Re: ribsribs] #223861
08/27/08 00:07
08/27/08 00:07
Joined: Oct 2004
Posts: 1,655
T
testDummy Offline
Serious User
testDummy  Offline
Serious User
T

Joined: Oct 2004
Posts: 1,655
Quoting ribsribs.
Quote:
By the way, A7 C here

If that is supposed to mean 'using A7 & Lite-C', than the "C-Script and WDL: The predecessors to lite-C" forum category, may be the wrong category for 'you' and / or this 'question'!?

Re: Detect collision without c_move ? [Re: testDummy] #223862
08/27/08 00:07
08/27/08 00:07
Joined: May 2007
Posts: 46
R
ribsribs Offline OP
Newbie
ribsribs  Offline OP
Newbie
R

Joined: May 2007
Posts: 46
C as in Commercial. I'm using WDLs

Re: Detect collision without c_move ? [Re: ribsribs] #223869
08/27/08 00:32
08/27/08 00:32
Joined: Oct 2004
Posts: 1,655
T
testDummy Offline
Serious User
testDummy  Offline
Serious User
T

Joined: Oct 2004
Posts: 1,655
OK.
If more precise collision is desired, than it may be appropriate to replace:
*calls to older function ent_move with calls to newer function c_move
*direct modifications to .pan, .tilt. roll, with calls to function c_rotate

Quoting mpdeveloper_B.
Quote:
It does have some complex poly collision if you choose to use it, but be wary, any collision detection in 3DGS takes alot of framerate if there are multiple objects using it, c_trace takes the most out of all the commands.

There is probably a fair amount of accuracy found in those statements.
The statements are probably pulled from a base of experience.
grin




Re: Detect collision without c_move ? [Re: testDummy] #223883
08/27/08 01:50
08/27/08 01:50
Joined: May 2007
Posts: 46
R
ribsribs Offline OP
Newbie
ribsribs  Offline OP
Newbie
R

Joined: May 2007
Posts: 46
Man, awesome. Works like a charm. Thanks a LOT!


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