Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 10/25/26 03:42
Chat Room for Zorro Programmers
by Haitao_Ren. 10/25/26 03:14
Trading Journey
by Haitao_Ren. 10/25/26 03:14
Algorithmic trading course with Zorro
by Haitao_Ren. 10/25/26 03:12
Zorro tutorial ideas?
by Haitao_Ren. 10/25/26 02:47
Zorro plugin for Hyperliquid.xyz
by mayarik. 10/24/26 09:14
Tradestation missing in table of contents
by AndrewAMD. 10/23/26 14:35
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (3run, TipmyPip, opm), 7,722 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Haitao_Ren, JimSimons, julienp, julienper, KelleyAbbey
19247 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,125
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,125
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 | 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