|
0 registered members (),
5,733
guests, and 39
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
NOOB ERROR WITH SCRIPT, PLEASE HELP
#77115
06/08/06 19:57
06/08/06 19:57
|
Joined: Jun 2006
Posts: 3
capcom203
OP
Guest
|
OP
Guest
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
Senior Expert
|
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: Xarthor]
#77118
06/08/06 20:40
06/08/06 20:40
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
Senior Expert
|
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: capcom203]
#77120
06/08/06 20:48
06/08/06 20:48
|
Joined: May 2006
Posts: 398
Bot190
Senior Member
|
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
Senior Member
|
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
Expert
|
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
Grimber
Expert
|
Expert
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
testDummy
Serious User
|
Serious User
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.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|