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
2 registered members (OptimusPrime, AndrewAMD), 14,580 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
Need help with c_rotate ! #153928
09/13/07 16:41
09/13/07 16:41
Joined: Sep 2007
Posts: 9
Worms
T
True25 Offline OP
Newbie
True25  Offline OP
Newbie
T

Joined: Sep 2007
Posts: 9
Worms
my script:

#include <acknex.h>
#include <default.c>

Entity* wizard;

function main()
{
video_mode = 8;
level_load("level1.wmp")
}

action wizard_with_pointer()
{
wizard = my;
my.ambiente = 100;
}

an i get error :

1. video_mode = 8; / Read only mode
2. level_load("level1.wmp") / script error last line
3. my.ambiente = 100; / Parameter unknown ..

what do i wrong ?

Last edited by True25; 09/14/07 12:04.
Re: Need help with action ! [Re: True25] #153929
09/13/07 16:54
09/13/07 16:54
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
Firstly, try to save your script to .c instead of .wdl
then change followings :

Entity* wizard; change to ENTITY* wizard;
my.ambiente = 100; change to my.ambient = 100;

Re: Need help with action ! [Re: vlau] #153930
09/13/07 16:56
09/13/07 16:56
Joined: Sep 2007
Posts: 9
Worms
T
True25 Offline OP
Newbie
True25  Offline OP
Newbie
T

Joined: Sep 2007
Posts: 9
Worms
lol ok ^^ thanks .

Re: Need help with action ! [Re: True25] #153931
09/13/07 17:02
09/13/07 17:02
Joined: Sep 2007
Posts: 9
Worms
T
True25 Offline OP
Newbie
True25  Offline OP
Newbie
T

Joined: Sep 2007
Posts: 9
Worms
my.ambiente = 100; ... parameter unknown !

i think i have something forgett in my map

can you write me an example how get i the object to walk ?

Re: Need help with action ! [Re: True25] #153932
09/13/07 17:12
09/13/07 17:12
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
Have you read my previous post? it should be my.ambient=100

Quote:


can you write me an example how get i the object to walk ?





Code:

var moveSpeed = 2;
action myObject()
{
c_setminmax(my);
while(my)
{
ent_animate(my,"walk",my.skill1,ANM_CYCLE);
my.skill1 += moveSpeed * time_step;
my.skill1 %= 100;

c_move(my,vector(moveSpeed*time_step,0,0),nullvector,GLIDE);
wait(1);
}
}



Just an example. Usually you can find your answer by
searching the forum or read the AUM.

Last edited by vlau; 09/13/07 17:15.
Re: Need help with action ! [Re: vlau] #153933
09/13/07 17:21
09/13/07 17:21
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
function main()
{
video_mode = 8;
level_load("level1.wmp");
}


missing semicolon

Re: Need help with action ! [Re: Lukas] #153934
09/13/07 20:37
09/13/07 20:37
Joined: Sep 2007
Posts: 9
Worms
T
True25 Offline OP
Newbie
True25  Offline OP
Newbie
T

Joined: Sep 2007
Posts: 9
Worms
thanks for help

the model walk nice work. perhaps you can explain how can i control this object example with "W" to Walk and "S" to Stop ? thanx.

Re: Need help with action ! [Re: True25] #153935
09/14/07 05:50
09/14/07 05:50
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
It's easy, just modify this line :

c_move(my,vector((key_w-key_s)* moveSpeed*time_step,0,0),nullvector,GLIDE);

While holding 'W' object walk forward, 'S' walk backward and
stop while none of them are pressed.

And add this line to turn if you like :

c_rotate(my,vector((key_a-key_d)* moveSpeed * time_step,0,0),USE_AXIS);

Pressing 'A' and 'D' to turn left and right.

Re: Need help with action ! [Re: vlau] #153936
09/14/07 12:00
09/14/07 12:00
Joined: Sep 2007
Posts: 9
Worms
T
True25 Offline OP
Newbie
True25  Offline OP
Newbie
T

Joined: Sep 2007
Posts: 9
Worms
thanks ..

i would like to use

c_rotate(my,vector((key_a-key_d)* moveSpeed * time_step,0,0),USE_AXIS);

if(Key_d) { } to turn right

- but how should be the angel ? thanks

- it is possible after one action the animation to bring to frame 1
example: ent_animate(my,"run",0,ANM_CYCLE); but not so hard .. softly


Last edited by True25; 09/14/07 12:14.
Re: Need help with action ! [Re: True25] #153937
09/14/07 13:27
09/14/07 13:27
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
You may set my.frame to the first frame of the 'run' animation
after my.skill1 is reached 100.

my.frame = ##; // check the ## from MED->Manage Frames.


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