Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,203 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Whats wrong with my code? #157859
09/30/07 03:19
09/30/07 03:19
Joined: Oct 2006
Posts: 45
J
juggalo10101 Offline OP
Newbie
juggalo10101  Offline OP
Newbie
J

Joined: Oct 2006
Posts: 45
When i execute my code i get a bunch of syntax errors, any help?
Code:
 define health,skill1;
define ammo,skill2;
define maxammo,skill3;
define weaponid,skill4;
define maxweapon, skill5; //to tell whats the max weapon id user has
//player1
action player1 {
while {
player = my;
me = player;
my.health = 100;
my.ammo = 32;
my.weaponid = 1;
my.maxweapon = 1;
if (my.health=>100)
{
my.health=100;
}
if (my.ammo =<1)
{
reload();
}
if (my.weaponid==1)
{
my.maxammo = 32;
}
function reload ()
{
my.ammo = my.maxammo;
}
}
if (key_w==1)
{
ent_move(1,0);
ent_animate(me,"run",NULL,NULL);
}
}



Re: Whats wrong with my code? [Re: juggalo10101] #157860
09/30/07 03:34
09/30/07 03:34
Joined: Aug 2005
Posts: 390
Florida
O
oldschoolj Offline
Senior Member
oldschoolj  Offline
Senior Member
O

Joined: Aug 2005
Posts: 390
Florida
You did the defines correct, or near correct on your last post.

Code:
#define health skill1
#define ammo skill2
#define maxammo skill3
#define weaponid skill4
#define maxweapon skill5 //to tell whats the max weapon id user has
//player1
action player1()
{
player = my;
my.health = 100;
my.ammo = 32;
my.weaponid = 1;
my.maxweapon = 1;
while (1)
{

if (my.health=>100) my.health=100;
if (my.ammo =<1) reload();
if (my.weaponid==1) my.maxammo = 32;
}
}

function reload ()
{
my.ammo = my.maxammo;
if (key_w==1)
{
ent_move(1,0);
ent_animate(me,"run",NULL,CYCLE);
}
}



But I gotta say the way your setting this is up is gonna give ya trouble in the future. There are some nice tutorials on litec. I'd check them out.

Last edited by oldschoolj; 09/30/07 03:36.

you can find me with my face in the keyboard, unshaven, listening to some nameless techno tragedy, and hashing through code over a cold cup a stale joe. __________________________________ yours truly
Re: Whats wrong with my code? [Re: oldschoolj] #157861
09/30/07 04:55
09/30/07 04:55
Joined: Oct 2006
Posts: 45
J
juggalo10101 Offline OP
Newbie
juggalo10101  Offline OP
Newbie
J

Joined: Oct 2006
Posts: 45
i am still getting unknown parameter errors for things like m.health = 100

Re: Whats wrong with my code? [Re: juggalo10101] #157862
09/30/07 09:54
09/30/07 09:54
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
Did you include acknex.h and default.c?

Re: Whats wrong with my code? [Re: Lukas] #157863
09/30/07 15:10
09/30/07 15:10
Joined: Oct 2006
Posts: 45
J
juggalo10101 Offline OP
Newbie
juggalo10101  Offline OP
Newbie
J

Joined: Oct 2006
Posts: 45
lemme try....
still no i'm going to look at soem other codes and see what mine doesnt have

Re: Whats wrong with my code? [Re: juggalo10101] #157864
10/01/07 02:53
10/01/07 02:53
Joined: Oct 2006
Posts: 45
J
juggalo10101 Offline OP
Newbie
juggalo10101  Offline OP
Newbie
J

Joined: Oct 2006
Posts: 45
i fixed it I just had to rewrite it

Re: Whats wrong with my code? [Re: juggalo10101] #157865
10/01/07 23:10
10/01/07 23:10
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

I believe that writting skill[0] is faster than writting skill1
(They are the same)


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