Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (dr_panther, degenerate_762, AndrewAMD, Ayumi), 793 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Train to follow a rail (path) #431478
10/16/13 17:19
10/16/13 17:19
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline OP
Serious User
Steempipe  Offline OP
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
Hi,
I am looking for any resources, or hints, to program a train to follow a path of rails.
Thanks,
Eric

Re: Train to follow a rail (path) [Re: Steempipe] #431536
10/18/13 05:15
10/18/13 05:15
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
U need it in c-script ? If not this one from aum could help
Code:
action guard()
{

while(1) {

vec_set(my.skill2,my.x);

path_spline(me,my.x,my.skill1);
my.skill1 += 3*time_step;


vec_diff(my.skill5,my.x,my.skill2);
vec_to_angle(my.skill8,my.skill5);

my.pan += clamp(ang(my.skill8-my.pan)*0.25,-5,5)*time_step;
my.anim_index += 5 * time_step;
ent_animate(my,"run",my.anim_index,ANM_CYCLE);
wait(1);
}
}

Did not test just copy and pasted.


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Train to follow a rail (path) [Re: rayp] #431546
10/18/13 10:39
10/18/13 10:39
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline OP
Serious User
Steempipe  Offline OP
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
Thanks! I'll work with your paste and pointer to AUM. Eric


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