Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AemStones, AndrewAMD, gamers, Kingware), 1,679 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
1st person move_skript #48285
06/24/05 18:34
06/24/05 18:34
Joined: Aug 2004
Posts: 593
Germany
Efrint Offline OP
Developer
Efrint  Offline OP
Developer

Joined: Aug 2004
Posts: 593
Germany
Hello,

I did a 1st person move skript. It includes c_move and jumping. It´s without animation... Here it is:

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////// (c) 2005 by ABRAXAS-GAMES ////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


ENTITY* spieler;
VAR laufen[3]=0,0,0;
VAR unten[3]=0,0,-3;


FUNCTION fall_event
{
if(event_type==event_block)
{
unten.z=0;
}
else
{
unten.z=-3;
}
if(event_type==event_entity)
{
unten.z=0;
}
else
{
unten.z=-3;
}
}

FUNCTION jump()
{
proc_kill(2);
unten.z=2;
wait(30); //the bigger the wait, the higher the jump
unten.z=-3;
}


ACTION krasser_hero
{
spieler=my;

my.event=fall_event;
while(1)
{
////camera////
camera.x=my.x;
camera.y=my.y;
camera.z=my.z;
camera.pan=my.pan;
camera.roll=my.roll;
camera.tilt=my.tilt;

////walking////
c_move (me,laufen,nullvector,GLIDE+IGNORE_PASSABLE);
c_move (me,unten,nullvector,IGNORE_PASSABLE);
////standanimation insert here/////

////controle////
if (key_cuu==1)
{

laufen=1;
///walkanimation insert here
}
else
{
laufen=0;
}

if (key_cud==1)
{

laufen=-1;
/////backward-walking animation insert here
}
if (key_cul==1)
{
my.pan+=5*time;
}
if (key_cur==1)
{
my.pan-=5*time;
}
if (key_space==1)
{
jump();
}


wait(1);
}
}

}


I hope, it´s usefull...credits would be fine...

Regards Efrint

Re: 1st person move_skript [Re: Efrint] #48286
06/24/05 19:41
06/24/05 19:41
Joined: Apr 2005
Posts: 1,058
Luzern
Nicolas_B Offline
Serious User
Nicolas_B  Offline
Serious User

Joined: Apr 2005
Posts: 1,058
Luzern
Mach doch dafür noch ne erweiterung.
Zum beispiel Schiessen, waffen aufnehmen u.s.w.
Aber entlich mal n 1st Script.
Grosses Lob!!!

Gruss Imp
-----------------------------------
3DGS Ressoucen

Was wäre die Schweiz ohne ausland?
...
Ein kontinent

Re: 1st person move_skript [Re: Efrint] #48287
06/24/05 21:49
06/24/05 21:49
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US
i twiddled with it a little to shorten it up, but its the same. hope you don't mind

Code:
 

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////// (c) 2005 by ABRAXAS-GAMES ////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


ENTITY* spieler;
VAR laufen[3]=0,0,0;
VAR unten[3]=0,0,-3;


FUNCTION fall_event
{
if(event_type==event_block || event_type==event_entity )
{
unten.z=0;
}
else
{
unten.z=-3;
}
}

FUNCTION jump()
{
proc_kill(2);
unten.z=2;
wait(30); //the bigger the wait, the higher the jump
unten.z=-3;
}


ACTION krasser_hero
{
spieler=my;
my.event=fall_event;
while(1)
{
laufen.x = (key_force.y*5*time)
my.pan += (key_force.x *5*time);
////walking////
c_move (me,laufen,unten,GLIDE+IGNORE_PASSABLE);
if (vec_length(laufen) == 0)
{
////standanimation insert here/////
}
////controle////
if (laufen.x != 0 )
{
///walkforwards backwards animation insert here
}
if (key_space==1)
{
jump();
}
////camera////
vec_set(camera.x,my.x);
vec_set(camera.pan,my.pan);
wait(1);
}

}




Re: 1st person move_skript [Re: Grimber] #48288
06/25/05 11:06
06/25/05 11:06
Joined: Aug 2004
Posts: 593
Germany
Efrint Offline OP
Developer
Efrint  Offline OP
Developer

Joined: Aug 2004
Posts: 593
Germany
no problem....thx....
one question: what means this: "if (laufen.x != 0 )" ? What means the "!" ?

Regards
Efrint

Re: 1st person move_skript [Re: Efrint] #48289
06/25/05 13:05
06/25/05 13:05
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US
! is "not" so != "does not equal"

i.e. same as if(laufen.x == 0)


you can also write it

if (!laufen.x)


it's the same thing just the first is easier for some to read than the second way which is a shortcut

Re: 1st person move_skript [Re: Grimber] #48290
06/25/05 14:09
06/25/05 14:09
Joined: Aug 2004
Posts: 593
Germany
Efrint Offline OP
Developer
Efrint  Offline OP
Developer

Joined: Aug 2004
Posts: 593
Germany
ok....thx


Moderated by  adoado, checkbutton, mk_1, Perro 

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