Gamestudio Links
Zorro Links
Newest Posts
Purchase A8 full licence version
by ukgamer. 04/29/26 18:09
Z9 getting Error 058
by k_ivan. 04/25/26 19:13
ZorroGPT
by TipmyPip. 04/25/26 16:09
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 5,733 guests, and 39 spiders.
Key: Admin, Global Mod, Mod
Newest Members
ukgamer, valino, juergenwue, VladMak, Geir
19210 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
NOOB ERROR WITH SCRIPT, PLEASE HELP #77115
06/08/06 19:57
06/08/06 19:57
Joined: Jun 2006
Posts: 3
C
capcom203 Offline OP
Guest
capcom203  Offline OP
Guest
C

Joined: Jun 2006
Posts: 3
I went to this class a week ago and we used GameStudio 6 amd when i was there even the teacher of the class couldn't get our script to work in for my level.

The error is

<1>
script10.wdl 15:0 Error (126): Syntax Error - missing {


MY Script is

////////////////////////////////////////////////////////////////////////////////////

var video_mode = 7; // 800x600 pixels
var video_depth = 32; // 32 bit mode

////////////////////////////////////////////////////////////////////////////////////

string work10_wmb = "work10.wmb"; // define the string associated to the name of the level

////////////////////////////////////////////////////////////////////////////////////

function main()
{
level_load (work10_wmb);
while(1)
{
if(key_b){
camera.x = camera.x + 1;
}
wait(1);
}
}

action rotate_plane
{
var rotationstuff = 0;
while(1)
{
if(key_cuu){
my.tilt += 1;
}
if(key_cud){
my.tilt -= 1;
}
if(key_cul){
my.pan += 1;
}
if(key_cur){
my.pan -= 1;
}
if(key_w){
c_move(my, vector(5,0,0), nullvector, glide);
}
if(key_s){
c_move(my, vector(-5,0,0), nullvector, glide);
}
if(key_a){
c_move(my, vector(0,5,0), nullvector, glide);
}
if(key_d){
c_move(my, vector(0,-5,0), nullvector, glide);
}

camera.pan = my.pan;
camera.tilt = my.tilt;
camera.x = my.x;
camera.y = my.y;
camera.z = my.z;
wait(1);
}
}

the script is just for 1st person movement. Please help. And if there is a prewritten code or a step i missed when adding the script to my level please reply to this.


~RandomHero~
Re: NOOB ERROR WITH SCRIPT, PLEASE HELP [Re: capcom203] #77116
06/08/06 20:33
06/08/06 20:33
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline
Senior Expert
ulillillia  Offline
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
Took me just ten seconds to find it:

Code:

function main()
{
level_load (work10_wmb);
while(1)
{
if(key_b){
camera.x = camera.x + 1;
}
wait(1);
}
}



You have 3 }'s but only 2 {'s and that's what's causing it.


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: NOOB ERROR WITH SCRIPT, PLEASE HELP [Re: ulillillia] #77117
06/08/06 20:36
06/08/06 20:36
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Sorry uli but looks like you were 10 seconds to fast:

function main()
{
level_load (work10_wmb);
while(1)
{
if(key_b){
camera.x = camera.x + 1;
}
wait(1);
}
}

Re: NOOB ERROR WITH SCRIPT, PLEASE HELP [Re: Xarthor] #77118
06/08/06 20:40
06/08/06 20:40
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline
Senior Expert
ulillillia  Offline
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
Ah, I didn't see the brace after that if statement. I'm used of having it on the line below which is what messed me up. I rechecked it and there's nothing missing then. Although I'm not sure if it makes a difference, shouldn't the main function be at the very bottom?


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: NOOB ERROR WITH SCRIPT, PLEASE HELP [Re: ulillillia] #77119
06/08/06 20:44
06/08/06 20:44
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
@uli: Yeah took me to find out that there are brackets behind the if statement, and I also like it more in the next line

I would also try to move the function main to the bottom, but I dunno why it should caus a "Missing {" error

Re: NOOB ERROR WITH SCRIPT, PLEASE HELP [Re: capcom203] #77120
06/08/06 20:48
06/08/06 20:48
Joined: May 2006
Posts: 398
Bot190 Offline
Senior Member
Bot190  Offline
Senior Member

Joined: May 2006
Posts: 398
action rotate_plane
{
var rotationstuff = 0;
while(1) {
if(key_cuu){
my.tilt += 1;
}

{
if(key_cuu){
my.tilt += 1;
}
if(key_cud){
my.tilt -= 1;
}
if(key_cul){
my.pan += 1;
}
if(key_cur){
my.pan -= 1;
}
if(key_w){
c_move(my, vector(5,0,0), nullvector, glide);
}
if(key_s){
c_move(my, vector(-5,0,0), nullvector, glide);
}
if(key_a){
c_move(my, vector(0,5,0), nullvector, glide);
}
if(key_d){
c_move(my, vector(0,-5,0), nullvector, glide);
}
}
camera.pan = my.pan;
camera.tilt = my.tilt;
camera.x = my.x;
camera.y = my.y;
camera.z = my.z;
wait(1);
}
}
theres 2{ and 1}
add the letter in blue


Wait, there isn't a "Make My Game Now" button?
Re: NOOB ERROR WITH SCRIPT, PLEASE HELP [Re: Bot190] #77121
06/08/06 21:03
06/08/06 21:03
Joined: May 2006
Posts: 398
Bot190 Offline
Senior Member
Bot190  Offline
Senior Member

Joined: May 2006
Posts: 398
i just tryed the code and it works fine the way it is. i don't know whats wrong.


Wait, there isn't a "Make My Game Now" button?
Re: NOOB ERROR WITH SCRIPT, PLEASE HELP [Re: Bot190] #77122
06/08/06 21:14
06/08/06 21:14
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
bot190: also wrong the } of the while(1) loop is behind the wait(1);

I cannot see any failure aswell.
Is this really all of your code? no includings nothing after this script or before it?

EDIT:
You might also do the following:
Open WED -> open your level -> go to File -> Map Properties and see if in the "script box" the right file is loaded.

Last edited by Thunder; 06/08/06 21:16.
Re: NOOB ERROR WITH SCRIPT, PLEASE HELP [Re: Xarthor] #77123
06/08/06 21:50
06/08/06 21:50
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US
be sure to check your ENTIRE wdl file closely

you could have a loose { or ; someplace your not looking ( like a long empty space at the bottem with a { or ;

formatting your work helps to not only read it, but to find errors
here is your script above just as posted. I don;t readly see any formatting errors in it which is why it suggests you got other stuff in that wdl file then your posting

( i didn;t change a thing other than adjusted the formatting)
Code:


////////////////////////////////////////////////////////////////////////////////////

var video_mode = 7; // 800x600 pixels
var video_depth = 32; // 32 bit mode

////////////////////////////////////////////////////////////////////////////////////

string work10_wmb = "work10.wmb"; // define the string associated to the name of the level

////////////////////////////////////////////////////////////////////////////////////

function main()
{
level_load (work10_wmb);
while(1)
{
if(key_b)
{
camera.x = camera.x + 1;
}
wait(1);
}
}

action rotate_plane
{
var rotationstuff = 0;
while(1)
{
if(key_cuu)
{
my.tilt += 1;
}
if(key_cud)
{
my.tilt -= 1;
}
if(key_cul)
{
my.pan += 1;
}
if(key_cur)
{
my.pan -= 1;
}
if(key_w)
{
c_move(my, vector(5,0,0), nullvector, glide);
}
if(key_s)
{
c_move(my, vector(-5,0,0), nullvector, glide);
}
if(key_a)
{
c_move(my, vector(0,5,0), nullvector, glide);
}
if(key_d)
{
c_move(my, vector(0,-5,0), nullvector, glide);
}
camera.pan = my.pan;
camera.tilt = my.tilt;
camera.x = my.x;
camera.y = my.y;
camera.z = my.z;
wait(1);
}
}



Re: NOOB ERROR WITH SCRIPT, PLEASE HELP [Re: Xarthor] #77124
06/08/06 21:59
06/08/06 21:59
Joined: Oct 2004
Posts: 1,655
T
testDummy Offline
Serious User
testDummy  Offline
Serious User
T

Joined: Oct 2004
Posts: 1,655
Code:

////////////////Tabinated with Tabinator////////////////////////////////////////////////////////////////////

var video_mode = 7; // 800x600 pixels
var video_depth = 32; // 32 bit mode

////////////////////////////////////////////////////////////////////////////////////

string work10_wmb = "work10.wmb"; // define the string associated to the name of the level

////////////////////////////////////////////////////////////////////////////////////

function main()
{
level_load (work10_wmb);
while(1)
{
if(key_b){
camera.x = camera.x + 1;
}
wait(1);
}
}

action rotate_plane
{
/*Depending on the version of 3DGS used,
you may not be able to declare the local variable
and set it in the same instruction.*/
var rotationstuff = 0;
var rotationstuff; rotationstuff = 0;
// Merry Christmas!!!
while(1)
{
if(key_cuu){
my.tilt += 1;
}
if(key_cud){
my.tilt -= 1;
}
if(key_cul){
my.pan += 1;
}
if(key_cur){
my.pan -= 1;
}
if(key_w){
c_move(my, vector(5,0,0), nullvector, glide);
}
if(key_s){
c_move(my, vector(-5,0,0), nullvector, glide);
}
if(key_a){
c_move(my, vector(0,5,0), nullvector, glide);
}
if(key_d){
c_move(my, vector(0,-5,0), nullvector, glide);
}

camera.pan = my.pan;
camera.tilt = my.tilt;
camera.x = my.x;
camera.y = my.y;
camera.z = my.z;
wait(1);
}
}


I don't know why I even bother; I'm too slow to keep up with users like Grimber.

Last edited by testDummy; 06/08/06 22:07.
Page 1 of 2 1 2

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