Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (TipmyPip, AndrewAMD, Quad, aliswee, degenerate_762), 970 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
model sticks and I'm stuck #418198
02/22/13 03:46
02/22/13 03:46
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
I need to keep the player from sticking to other entities. I can't use passable. I've tried for hours with vglide, move_friction, enable_entity and a dozen other things but getting nowhere. Here is the part of the player code where I would like to include it:

Code:
while(1)
{
if(my.mode == mode_move)  //move to location target
{
my.force_x = my.speed  * time_step;
vec_diff(temp,my.target_x,my.x);
vec_to_angle(my.ang_pan,temp);
temp_ang.pan = ang(my.ang_pan - my.pan);
if(temp_ang.pan > 0) { my.pan += min(my.agility * time_step,abs(temp_ang.pan));	}
if(temp_ang.pan < 0) { my.pan -= min(my.agility * time_step,abs(temp_ang.pan));	}
ent_animate(my, "walk", my.anim_index, ANM_CYCLE);
ent_move(my.force_x,my.force_y);
my.anim_index += 7 * time_step;
}
...
wait();
}



A6 Commercial.
Please don't refer me to the manual. Nothing I've found there has helped. Thanks.

Re: model sticks and I'm stuck [Re: JazzDude] #418199
02/22/13 04:00
02/22/13 04:00
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
Here's one attempt that didn't work.

Code:
if (event_type == event_entity)
{
vec_set (temp.x, normal.x);
vec_normalize (temp.x, 0.05);
if (temp.z<0) { temp.z = 0; } //don't move through the ground
vec_add(my.x,temp.x); //move -0.05 quants away from you entity
}


	}
}


Re: model sticks and I'm stuck [Re: JazzDude] #418246
02/22/13 15:13
02/22/13 15:13
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Code:
ent_move(my.force_x,my.force_y);


Are these really the right parameters?


Always learn from history, to be sure you make the same mistakes again...
Re: model sticks and I'm stuck [Re: JazzDude] #418247
02/22/13 15:56
02/22/13 15:56
Joined: Mar 2005
Posts: 969
ch
Loopix Offline
User
Loopix  Offline
User

Joined: Mar 2005
Posts: 969
ch
Hi Rod, maybe try to use c_rotate for rotating the entity?
Well...I don't really remember as I haven't touched 3dgs for years crazy

Re: model sticks and I'm stuck [Re: Loopix] #418253
02/22/13 16:35
02/22/13 16:35
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
Okay...got me looking further and this works:

move_mode = IGNORE_YOU + IGNORE_PASSABLE + IGNORE_PUSH + ACTIVATE_TRIGGER + GLIDE;
result = ent_move (my.force_x,my.force_y);

I was over-thinking it.
Thanks for stimulating my gearbox.

Re: model sticks and I'm stuck [Re: JazzDude] #418254
02/22/13 16:39
02/22/13 16:39
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
As far as I remember ent_move expected and absolute and a relative speed vector?


Always learn from history, to be sure you make the same mistakes again...
Re: model sticks and I'm stuck [Re: Uhrwerk] #418259
02/22/13 17:41
02/22/13 17:41
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
Yes. Force_x and Force_y are defined skills.

Re: model sticks and I'm stuck [Re: JazzDude] #418260
02/22/13 17:43
02/22/13 17:43
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
That is very counter-intuitive. You'd normally expect Force_x and Force_y to be components of the same vector, i.e. skills immediately following each other like skill1 and skill2. I'd have these skills named abs_force and rel_force.

But nevermind, as long as you know what they are...


Always learn from history, to be sure you make the same mistakes again...
Re: model sticks and I'm stuck [Re: Uhrwerk] #418261
02/22/13 17:46
02/22/13 17:46
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
Thanks. I'll try it your way. Sounds better.


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

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