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
1 registered members (TipmyPip), 18,618 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
Page 1 of 2 1 2
error max, please help #212109
06/20/08 13:39
06/20/08 13:39
Joined: Jul 2006
Posts: 76
uk london
F
FireArm Offline OP
Junior Member
FireArm  Offline OP
Junior Member
F

Joined: Jul 2006
Posts: 76
uk london
I finally decided to use lite-c so my script i made im rewriting.

So far i converted about 50% of my script, after line 40 there are errors.
But i got a new bug i cant fix on my own(probley something very easy to fix)

i got error

Error in 'MAIN' line 39; 'max' undeclared identifer
<fall_speed.z = max (-20 * time, fall_speed.z); // 35 = falling speed>
.
Cant compile PROJECT.C

Any idea's which could be wrong?.

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


ENTITY* gplayer;
var walk_percentage; //anmation percent
var can_walk = 1; //the player can move
var distance_to_ground; // the distance between player's origin and the ground not yet used
var distance_check; // use this to check distance
var fall_speed; //set fall speed
VECTOR* temp;
VECTOR* distance_check;
VECTOR* fall_speed;


function main()
{
video_switch(7,0,1); // set full screen and 800/600 with no depth change
fps_max = 200; //set the frame rate this way game will run the same on all pc's
level_load("Project1.wmb"); //load the level
wait(2); // wait until the level is loaded
camera.tilt = -12;//set camera tilt
}


action player_actions() //player action
{
gplayer = me; //ponit the model is gplayer
set(my,SHADOW); //shadow on
while(1) //loop
{
if (can_walk == 1) // if you can walk
{
vec_set(temp,gplayer.x);//set temp to be equal to gplayer
vec_set(camera,vector(temp.x-200,temp.y,gplayer.z+50));//set camera to follow
vec_set(distance_check,gplayer.x); //distance_check = gplayer
distance_check.z -= 5000; //set 5000 quants below player's origin
distance_to_ground = c_trace (my.x, distance_check.x, IGNORE_ME | USE_BOX);
fall_speed.z = - (distance_to_ground - 17); // 17 = experimental value
fall_speed.z = Max (-20 * time, fall_speed.z); // 35 = falling speed
if (key_w) //if keyboard W is pressed move forward
{
c_move(my,vector(9.6* time_step,0,fall_speed.z),nullvector,GLIDE); //move
ent_animate(my, "walk", walk_percentage, ANM_CYCLE); // "walk" animation loop
walk_percentage += 12 * time_step; // 3 = animation speed for "walk"
}
else
{
c_move(my,vector(0,0,fall_speed.z),nullvector,GLIDE); //dont move but appy gravity
ent_animate(my, NULL, 0, 0); // reset all the animations
}

if (key_a) //if keyboard A is pressed pan + 2
{
my.pan+=8 * time_step; //if keyboard A is pressed pan + 2
}

if (key_d) //if keyboard A is pressed pan - 2
{
my.pan-=8 * time_step; //if keyboard A is pressed pan - 2
}

wait(1); //wait to next frame
}

wait(1);
}
}

FONT arial_font = "Arial",0,20; // Arial, bold, a character has a height of 20 points
STRING worldtext_str = "My First Project"; // string says MY First Project
TEXT world_txt =
{
pos_x = 10;
pos_y = 10;
string (worldtext_str) ;
flags = VISIBLE;
font = arial_font;
} // this above displays the text top left


please help

Re: error max, please help [Re: FireArm] #212114
06/20/08 13:50
06/20/08 13:50
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
maxv

FONT*
STRING*


"empty"
Re: error max, please help [Re: FireArm] #212115
06/20/08 13:50
06/20/08 13:50
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
max is changed to maxv afaik.


3333333333
Re: error max, please help [Re: Quad] #212116
06/20/08 13:55
06/20/08 13:55
Joined: Jul 2006
Posts: 76
uk london
F
FireArm Offline OP
Junior Member
FireArm  Offline OP
Junior Member
F

Joined: Jul 2006
Posts: 76
uk london
thanks and i got the error with time do i change that to time_step?

Re: error max, please help [Re: FireArm] #212119
06/20/08 14:02
06/20/08 14:02
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Originally Posted By: FireArm
thanks and i got the error with time do i change that to time_step?


exactly!


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: error max, please help [Re: Helghast] #212120
06/20/08 14:09
06/20/08 14:09
Joined: Jul 2006
Posts: 76
uk london
F
FireArm Offline OP
Junior Member
FireArm  Offline OP
Junior Member
F

Joined: Jul 2006
Posts: 76
uk london
thanks.
is there a page in the manual that shows me all these?.

Re: error max, please help [Re: FireArm] #212123
06/20/08 14:29
06/20/08 14:29
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Originally Posted By: FireArm
thanks.
is there a page in the manual that shows me all these?.


use the search function, it will result into a page something along the lines like: unsupported script, and it will tell you to what the code has been updated (or not wink ).

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: error max, please help [Re: Helghast] #212126
06/20/08 14:42
06/20/08 14:42
Joined: Jul 2006
Posts: 76
uk london
F
FireArm Offline OP
Junior Member
FireArm  Offline OP
Junior Member
F

Joined: Jul 2006
Posts: 76
uk london
Thanks.
i just got one last error now.

i get a crash error when i run the the game.
Error E1513 player_actions

so i better post my script this one is a bit tricky for me.
#include <acknex.h>
#include <default.c>


var walk_percentage; //anmation percent
var can_walk = 1; //the player can move
var distance_to_ground; // the distance between player's origin and the ground not yet used
VECTOR* temp;
VECTOR* distance_check;
VECTOR* fall_speed;

function main()
{
video_switch(7,0,0); // set full screen and 800/600 with no depth change
fps_max = 200; //set the frame rate this way game will run the same on all pc's
level_load("Project1.wmb"); //load the level
wait(2); // wait until the level is loaded
camera.tilt = -12;//set camera tilt
}


action player_actions() //player action
{
set(my,SHADOW); //shadow on
while(1) //loop
{
if (can_walk == 1) // if you can walk
{
vec_set(temp.x,player.x);//set temp to be equal to gplayer
vec_set(camera,vector(temp.x-200,temp.y,player.z+50));//set camera to follow
vec_set(distance_check,player.x); //distance_check = gplayer
distance_check.z -= 5000; //set 5000 quants below player's origin
distance_to_ground = c_trace (player.x, distance_check.x, IGNORE_ME | USE_BOX);
fall_speed.z = - (distance_to_ground - 17); // 17 = experimental value
fall_speed.z = maxv (-20 * time_step, fall_speed.z); // 35 = falling speed
if (key_w) //if keyboard W is pressed move forward
{
c_move(my,vector(9.6* time_step,0,fall_speed.z),nullvector,GLIDE); //move
ent_animate(my, "walk", walk_percentage, ANM_CYCLE); // "walk" animation loop
walk_percentage += 12 * time_step; // 3 = animation speed for "walk"
}
else
{
c_move(my,vector(0,0,fall_speed.z),nullvector,GLIDE); //dont move but appy gravity
ent_animate(my, NULL, 0, 0); // reset all the animations
}

if (key_a) //if keyboard A is pressed pan + 2
{
my.pan+=8 * time_step; //if keyboard A is pressed pan + 2
}

if (key_d) //if keyboard A is pressed pan - 2
{
my.pan-=8 * time_step; //if keyboard A is pressed pan - 2
}

wait(1); //wait to next frame
}

}
}

Re: error max, please help [Re: FireArm] #212137
06/20/08 15:40
06/20/08 15:40
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
your running a lite-c project here?

action/function is replaced by void (however function still works).
that should fix it...

also, you gotta initialise variables at the beginning, so set these 2:

var walk_percentage;
var distance_to_ground;

to:

var walk_percentage = 0;
var distance_to_ground = 0;



that's about it smile

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: error max, please help [Re: Helghast] #212140
06/20/08 16:08
06/20/08 16:08
Joined: Jul 2006
Posts: 76
uk london
F
FireArm Offline OP
Junior Member
FireArm  Offline OP
Junior Member
F

Joined: Jul 2006
Posts: 76
uk london
thanks but still getting the error.
i can't see no errors in the script but yet the error remains.

Last edited by FireArm; 06/20/08 16:42.
Page 1 of 2 1 2

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