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
Engine not recognizing "while" and other keywords. #118366
03/20/07 06:54
03/20/07 06:54
Joined: Jan 2007
Posts: 36
Montana
webgovernor Offline OP
Newbie
webgovernor  Offline OP
Newbie

Joined: Jan 2007
Posts: 36
Montana
Hi All,

This is very interesting to me, here is my code (the problem parts):
Code:
 var video_mode = 7; // 800x600 pixels
var screen_color[3] = 150,0,0; // dark blue

var a = 0;
var b = 0;
var c = 0;

// inventory


var inv_i = 6; //maximum properties
var inv_slot; //slot number
var inventory[3000]; // actual inventory


// inventory properties
var inv_id = 0;
var inv_name = 1;
var inv_value = 2;
var inv_weight = 3;
var inv_type = 4;
var inv_equipted = 5;

//usage example = inventory[inv_slot*inv_i+inv_property]

var i = 1;

while(i < 25)
{
inventory[i*inv_i + inv_value] = 52 + i;
i += 1;
}




function show_slot(slot,property)
{

a = inventory[slot*inv_i + property];

}



And here is the error message(s):

Code:
  
1) Parameter Unknown while bad keyword in { }
2) Parameter Unknown inventory bad keyword in { }
3) Parameter Unknown i bad keyword in { }



Ya know what's even more messed up? Every time I run the engine, if I retype the array name of "inventory" without changing ANYTHING then it will work the next time I execute the script, but right after I close and run it again I get the same errors... I have NO idea what's going on here.

Any help on this is UBER appreciated, and yes, I have completed the C-Script tutorial, and yes, I did search for this problem in the forums.

Once again, I really appreciate any help on this matter.

-Aaron

Re: Engine not recognizing "while" and other keywo [Re: webgovernor] #118367
03/20/07 07:22
03/20/07 07:22

A
Anonymous
Unregistered
Anonymous
Unregistered
A



your while isn't in a function/action...

mercuryus

Re: Engine not recognizing "while" and other keywo [Re: ] #118368
03/20/07 08:41
03/20/07 08:41
Joined: Jan 2007
Posts: 36
Montana
webgovernor Offline OP
Newbie
webgovernor  Offline OP
Newbie

Joined: Jan 2007
Posts: 36
Montana
.....Jesus... I can't believe I missed that!!! Oh man!

I freaked out for an hour or so until I posted... how the hell did I miss that!?!

Thanks Mercuryus, I'll be sure to not squander people's time with stupid mistakes any longer...

Oh man...

Re: Engine not recognizing "while" and other keywo [Re: webgovernor] #118369
03/20/07 08:59
03/20/07 08:59

A
Anonymous
Unregistered
Anonymous
Unregistered
A



no problem - we all make such mistakes and are happy for help.

Re: Engine not recognizing "while" and other keywo [Re: ] #118370
03/20/07 11:17
03/20/07 11:17
Joined: Jun 2005
Posts: 4,875
broozar Offline
Expert
broozar  Offline
Expert

Joined: Jun 2005
Posts: 4,875
... you used to be a php scripter before? cause your code looks this way... especially the "i" counter and the actionless loop.

Re: Engine not recognizing "while" and other keywo [Re: broozar] #118371
03/20/07 11:28
03/20/07 11:28
Joined: Jan 2007
Posts: 36
Montana
webgovernor Offline OP
Newbie
webgovernor  Offline OP
Newbie

Joined: Jan 2007
Posts: 36
Montana
Yeah, I used to program for Level60Design, doing strictly PHP/MySQL stuff, excellent eye Broozar. You're the first person to notice.


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