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
0 registered members (), 17,416 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
Page 1 of 2 1 2
Polygon Collision #130501
05/18/07 03:11
05/18/07 03:11
Joined: May 2006
Posts: 69
Canada
L
Leaf Offline OP
Junior Member
Leaf  Offline OP
Junior Member
L

Joined: May 2006
Posts: 69
Canada
Hey, I have imported a large .mdl file and whish to change the CollsionBox to a polygon CollsionBox so that it conforms to the model. I have some screen shots of what I've done but havn't got it working yet.

http://www.virtualxistance.com/images/poly1.jpg

http://www.virtualxistance.com/images/poly2.jpg

Maybe I have checked the wrong box?

or

Do I need to write a script file to activate the PolygonCollison?

Heres the source on it:

ACTION enemy_dummy {
my.shadow = on;
my.entity_type = 2;
my.enable_scan = on;
my.polygon = on;

WHILE (1) {
IF (my.hit_by_player == 1) {
my.move_x = player.move_x;
my.move_y = player.move_y;
my.move_z = player.move_z;

// move_mode = ignore_passable | glide; //replace c_move with these 2 lines in versions of gamestudio below 6.4
// ent_move(nullvector,my.move_x);
c_move(my,nullvector,my.move_x,use_aabb | ignore_passable | glide);


IF (player.animblend == blend || player.animblend < attack_a || my.animblend > attack_f) { my.hit_by_player = 0; }
}
IF (player.animblend >= stand && target_enemy == my && player_lock_on == 0) && (player.animblend < attack_a || player.animblend > attack_f) { target_enemy = null; }
IF (target_enemy == my && vec_dist(my.x,player.x) > 200) { target_enemy = null; }
wait(1);
}

}


}

Re: Polygon Collision [Re: Leaf] #130502
05/18/07 05:59
05/18/07 05:59
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
Write a seperate acion for the model terrain to.

action Poly_on
{
my.polygon = on;
}

then asign it.

Re: Polygon Collision [Re: Nems] #130503
05/18/07 06:58
05/18/07 06:58
Joined: May 2006
Posts: 69
Canada
L
Leaf Offline OP
Junior Member
Leaf  Offline OP
Junior Member
L

Joined: May 2006
Posts: 69
Canada
Okay ive added in a seperate action. Now It solves my player from floating to the top of the box. But, now the model is passable. What else do I need to include in the new action?

Re: Polygon Collision [Re: Leaf] #130504
05/18/07 08:41
05/18/07 08:41
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
1) Remove my.polygon = on in the dummy action. This flag should only be set for non-moving entities, so just put it in the structure model action;

2)
Quote:

POLYGON
If this flag is set, the model entity's real shape is used for OBB collision detection. Otherwise, an oriented bounding box or ellipsoid is used.




So, you´d better try using c_move with OBB system. Also, check if you are not overriding the polycollision system somewhere. By default var enable_polycollision should be 1;

Re: Polygon Collision [Re: demiGod] #130505
05/18/07 20:25
05/18/07 20:25
Joined: May 2006
Posts: 69
Canada
L
Leaf Offline OP
Junior Member
Leaf  Offline OP
Junior Member
L

Joined: May 2006
Posts: 69
Canada
Quote:

1) Remove my.polygon = on in the dummy action. This flag should only be set for non-moving entities, so just put it in the structure model action;

2)
Quote:

POLYGON
If this flag is set, the model entity's real shape is used for OBB collision detection. Otherwise, an oriented bounding box or ellipsoid is used.




So, you´d better try using c_move with OBB system. Also, check if you are not overriding the polycollision system somewhere. By default var enable_polycollision should be 1;




I don't quite get waht you saying on your first part of your reply. But I have checked to see if there is any conflicting collision statments, and it all seems to be left at default. I also have tried my new action in the "techdemon" but, no luck.

Re: Polygon Collision [Re: Leaf] #130506
05/18/07 20:39
05/18/07 20:39
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
Hey, what i mean in the first part is exactly what it says: remove my.polygon = on in the action enemy_dummy, that flag should not be set in moving entities.
You dont need that flag in the player action.

What you need is too assign my.polygon = on in WED or by script with an action attached to the MDL structure you have.

Also, why are you using the old system AABB? Try the OBB system for collision using c_move and be sure that the model isnt passable.

Re: Polygon Collision [Re: demiGod] #130507
05/18/07 20:54
05/18/07 20:54
Joined: May 2006
Posts: 69
Canada
L
Leaf Offline OP
Junior Member
Leaf  Offline OP
Junior Member
L

Joined: May 2006
Posts: 69
Canada
Ah ok, the:

// move_mode = ignore_passable | glide; //replace c_move with these 2 lines in versions of gamestudio below 6.4
// ent_move(nullvector,my.move_x);

is commented out



and I havea new action like NEM's said to add:

action Poly_on
{
my.polygon = on;
my.shadow = on;
}

That is without the Polygon button checked in the engine, but still doesn't work, with the new action assigned to the Model

Re: Polygon Collision [Re: Leaf] #130508
05/19/07 05:15
05/19/07 05:15
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
Sorry, you need to have this before any while calls in your actor action.


action my_player //etc

{
my.fat = on;
my.narrow = on;
wait(1);
c_setminmax(my);

my.passable = off;
my.enable_impact = on; and so on...
while(1)
{
do stuff...
}

Its all in the manual by the way..

Re: Polygon Collision [Re: Nems] #130509
05/19/07 07:35
05/19/07 07:35
Joined: May 2006
Posts: 69
Canada
L
Leaf Offline OP
Junior Member
Leaf  Offline OP
Junior Member
L

Joined: May 2006
Posts: 69
Canada
I still haven't gotten it to work

ACTION enemy_dummy {
my.shadow = on;
my.entity_type = 2;
my.enable_scan = on;

my.fat = on;
my.narrow = on;
wait(1);
c_setminmax(my);
my.passable = off;
my.enable_impact = on;
my.polygon = on;

WHILE (1) {
IF (my.hit_by_player == 1) {
my.move_x = player.move_x;
my.move_y = player.move_y;
my.move_z = player.move_z;

// move_mode = ignore_passable | glide; //replace c_move with these 2 lines in versions of gamestudio below 6.4
// ent_move(nullvector,my.move_x);
c_move(my,nullvector,my.move_x,use_aabb | ignore_passable | glide);


IF (player.animblend == blend || player.animblend < attack_a || my.animblend > attack_f) { my.hit_by_player = 0; }
}
IF (player.animblend >= stand && target_enemy == my && player_lock_on == 0) && (player.animblend < attack_a || player.animblend > attack_f) { target_enemy = null; }
IF (target_enemy == my && vec_dist(my.x,player.x) > 200) { target_enemy = null; }
wait(1);
}





}

Last edited by Leaf; 05/19/07 07:35.
Re: Polygon Collision [Re: Leaf] #130510
05/19/07 22:28
05/19/07 22:28
Joined: Jan 2007
Posts: 221
F
Fenriswolf Offline
Member
Fenriswolf  Offline
Member
F

Joined: Jan 2007
Posts: 221
As I said in the other thread and as demiGod has suggested, you probably have to remove the 'use_aabb' flag in the c_move function.
By setting this flag you are disabling the new collision system.

Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

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