Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 8 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty
Category: CoD Mapping
CoD mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: 'Bad Syntax' Please help sort
_SpuD_
General Member
Since: Jan 30, 2007
Posts: 190
Last: Jun 22, 2008
[view latest posts]
Level 4
Category: CoD Mapping
Posted: Monday, Oct. 1, 2007 09:05 pm
Please can someone help me see what is wrong with these scripts??

I no iots these scripts as if i remvoe them it works [banghead]

Code:
main()
{
thread double_doors();
thread double_doors2();
thread double_doors3();
thread double_doors4();
}

thread double_doors()
{
trig = getent("double_door_trigger","targetname");
leftdoor1 = getent("leftdoor1","targetname");
rightdoor1 = getent("rightdoor1","targetname");
while(1)
{
trig waittill("trigger");
leftdoor1 rotateto((0,0,90),1);
rightdoor1 rotateto((0,0,-90),1);
wait(2);

leftdoor1 rotateto((0,0,-90),1);
rightdoor1 rotateto((0,0,90),1);
}
}


thread double_doors2()
{
trig = getent("double_door_trigger2","targetname");
leftdoor2 = getent("leftdoor2","targetname");
rightdoor2 = getent("rightdoor2","targetname");
while(1)
{
trig waittill("trigger");
leftdoor2 rotateto((0,0,90),1);
rightdoor2 rotateto((0,0,-90),1);
wait(2);

leftdoor2 rotateto((0,0,-90),1);
rightdoor2 rotateto((0,0,90),1);
}
}

thread double_doors3();
{
trig = getent("double_door_trigger3","targetname");
leftdoor3 = getent("leftdoor3","targetname");
rightdoor3 = getent("rightdoor3","targetname");
while(1)
{
trig waittill("trigger");
leftdoor3 rotateto((0,0,90),1);
rightdoor3 rotateto((0,0,-90),1);
wait(2);

leftdoor3 rotateto((0,0,-90),1);
rightdoor3 rotateto((0,0,90),1);
}
}

thread double_doors4();
{
trig = getent("double_door_trigger3","targetname");
leftdoor3 = getent("leftdoor3","targetname");
rightdoor3 = getent("rightdoor3","targetname");
while(1)
{
trig waittill("trigger");
leftdoor3 rotateto((0,0,90),1);
rightdoor3 rotateto((0,0,-90),1);
wait(2);

leftdoor3 rotateto((0,0,-90),1);
rightdoor3 rotateto((0,0,90),1);
}
}


and...

Code:

main()
{
thread cage();
}

thread cage()
{
trig = getent("cage_trigger","targetname");
cageleft1 = getent("cageleft1","targetname");
cageright1 = getent("cageright1","targetname");
while(1)
{
trig waittill("trigger");
cageleft1 rotateto((0,0,90),1);
cageright1 rotateto((0,0,-90),1);
wait(2);

cageleft1 rotateto((0,0,-90),1);
cageright1 rotateto((0,0,90),1);
}
}


Please help [sad]

Thanks

SpuD

Edit: Also i have made changes to the map recompiled and run it but its just the same as before [banghead][banghead][banghead]

Its so anooying !!!

edited on Oct. 1, 2007 05:11 pm by spudy12
Share |
djheps
General Member
Since: Oct 5, 2006
Posts: 52
Last: Oct 4, 2007
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Monday, Oct. 1, 2007 09:49 pm
Hi -SpuD-

From what I can tell, you have the same code except for a different door.

Code:
thread double_doors4();
{
trig = getent("double_door_trigger3","targetname");
leftdoor3 = getent("leftdoor3","targetname");
rightdoor3 = getent("rightdoor3","targetname");
while(1)
{
trig waittill("trigger");
leftdoor3 rotateto((0,0,90),1);
rightdoor3 rotateto((0,0,-90),1);
wait(2);

leftdoor3 rotateto((0,0,-90),1);
rightdoor3 rotateto((0,0,90),1);
}
}


That's the code from double_doors4(); and you're calling door3 instead of door4 lol. Instead of leftdoor3 make it leftdoor4 and so on and so forth... update the getent's too.

Unless you're planning to move double_door3() again, I suggest changing it and see if it works.

And finally, on your second script you have
Code:
main()
{
thread cage();
}

thread cage()
{
trig = getent("cage_trigger","targetname");
cageleft1 = getent("cageleft1","targetname");
cageright1 = getent("cageright1","targetname");
while(1)
{
trig waittill("trigger");
cageleft1 rotateto((0,0,90),1);
cageright1 rotateto((0,0,-90),1);
wait(2);

cageleft1 rotateto((0,0,-90),1);
cageright1 rotateto((0,0,90),1);
}
}


Remove the SECOND thread cage() and replace it with just cage(). That may be why it doesn't work.

Hope this helps!
Share |
TexasRebel
General Member
Since: May 1, 2006
Posts: 373
Last: Aug 20, 2013
[view latest posts]
Level 5
Category: CoD Mapping
Posted: Tuesday, Oct. 2, 2007 01:00 am
Man in my rush to give u an answer to your double door problem the other day, I wrote a mistake in it. As djheps says remove the thread from the functions that are written outside of main().
Share |
_SpuD_
General Member
Since: Jan 30, 2007
Posts: 190
Last: Jun 22, 2008
[view latest posts]
Level 4
Category: CoD Mapping
Posted: Tuesday, Oct. 2, 2007 03:57 pm
Ok thanks guys :D

I have taken out what i think you mean

Code:

main()
{
thread double_doors();
thread double_doors2();
thread double_doors3();
thread double_doors4();
}

double_doors()
{
trig = getent("double_door_trigger","targetname");
leftdoor1 = getent("leftdoor1","targetname");
rightdoor1 = getent("rightdoor1","targetname");
while(1)
{
trig waittill("trigger");
leftdoor1 rotateto((0,0,90),1);
rightdoor1 rotateto((0,0,-90),1);
wait(2);

leftdoor1 rotateto((0,0,-90),1);
rightdoor1 rotateto((0,0,90),1);
}
}


double_doors2()
{
trig = getent("double_door_trigger2","targetname");
leftdoor2 = getent("leftdoor2","targetname");
rightdoor2 = getent("rightdoor2","targetname");
while(1)
{
trig waittill("trigger");
leftdoor2 rotateto((0,0,90),1);
rightdoor2 rotateto((0,0,-90),1);
wait(2);

leftdoor2 rotateto((0,0,-90),1);
rightdoor2 rotateto((0,0,90),1);
}
}

double_doors3();
{
trig = getent("double_door_trigger3","targetname");
leftdoor3 = getent("leftdoor3","targetname");
rightdoor3 = getent("rightdoor3","targetname");
while(1)
{
trig waittill("trigger");
leftdoor3 rotateto((0,0,90),1);
rightdoor3 rotateto((0,0,-90),1);
wait(2);

leftdoor3 rotateto((0,0,-90),1);
rightdoor3 rotateto((0,0,90),1);
}
}

double_doors4();
{
trig = getent("double_door_trigger4","targetname");
leftdoor4 = getent("leftdoor4","targetname");
rightdoor4 = getent("rightdoor4","targetname");
while(1)
{
trig waittill("trigger");
leftdoor4 rotateto((0,0,90),1);
rightdoor4 rotateto((0,0,-90),1);
wait(2);

leftdoor4 rotateto((0,0,-90),1);
rightdoor4 rotateto((0,0,90),1);
}
}


just about to try :D

Wtf still BAD Syntax!!

Whats wrong with that??!?[banghead][banghead][banghead][banghead][banghead][banghead][banghead]


edited on Oct. 2, 2007 11:58 am by spudy12

edited on Oct. 2, 2007 12:00 pm by spudy12
Share |
djheps
General Member
Since: Oct 5, 2006
Posts: 52
Last: Oct 4, 2007
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Tuesday, Oct. 2, 2007 04:05 pm
Make sure that in your threads you DON'T have a ";" semicolon. I just noticed that some of your threads have

double_doors4(); <--- a semi colon. Don't use a semi colon, just leave it blank like

double_doors4()

This applies to all of your scripting.

edited on Oct. 2, 2007 12:07 pm by djheps
Share |
djheps
General Member
Since: Oct 5, 2006
Posts: 52
Last: Oct 4, 2007
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Tuesday, Oct. 2, 2007 04:09 pm
Sorry for Double-Post but if it might be easier for you, here's the correct code:

Code:
main()
{
thread double_doors();
thread double_doors2();
thread double_doors3();
thread double_doors4();
}

double_doors()
{
trig = getent("double_door_trigger","targetname");
leftdoor1 = getent("leftdoor1","targetname");
rightdoor1 = getent("rightdoor1","targetname");
while(1)
{
trig waittill("trigger");
leftdoor1 rotateto((0,0,90),1);
rightdoor1 rotateto((0,0,-90),1);
wait(2);

leftdoor1 rotateto((0,0,-90),1);
rightdoor1 rotateto((0,0,90),1);
}
}


double_doors2()
{
trig = getent("double_door_trigger2","targetname");
leftdoor2 = getent("leftdoor2","targetname");
rightdoor2 = getent("rightdoor2","targetname");
while(1)
{
trig waittill("trigger");
leftdoor2 rotateto((0,0,90),1);
rightdoor2 rotateto((0,0,-90),1);
wait(2);

leftdoor2 rotateto((0,0,-90),1);
rightdoor2 rotateto((0,0,90),1);
}
}

double_doors3()
{
trig = getent("double_door_trigger3","targetname");
leftdoor3 = getent("leftdoor3","targetname");
rightdoor3 = getent("rightdoor3","targetname");
while(1)
{
trig waittill("trigger");
leftdoor3 rotateto((0,0,90),1);
rightdoor3 rotateto((0,0,-90),1);
wait(2);

leftdoor3 rotateto((0,0,-90),1);
rightdoor3 rotateto((0,0,90),1);
}
}

double_doors4()
{
trig = getent("double_door_trigger4","targetname");
leftdoor4 = getent("leftdoor4","targetname");
rightdoor4 = getent("rightdoor4","targetname");
while(1)
{
trig waittill("trigger");
leftdoor4 rotateto((0,0,90),1);
rightdoor4 rotateto((0,0,-90),1);
wait(2);

leftdoor4 rotateto((0,0,-90),1);
rightdoor4 rotateto((0,0,90),1);
}
}
Share |
Bloodlust
General Member
Since: Apr 7, 2004
Posts: 101
Last: Jan 14, 2015
[view latest posts]
Level 4
Category: CoD Mapping
Posted: Tuesday, Oct. 2, 2007 04:13 pm
djheps writes...
Quote:
Make sure that in your threads you DON'T have a ";" semicolon. I just noticed that some of your threads have

double_doors4(); <--- a semi colon. Don't use a semi colon, just leave it blank like

double_doors4()

This applies to all of your scripting.

edited on Oct. 2, 2007 12:07 pm by djheps



what he means to say is:

never put a semi-colon on a function name

wrong: double_doors2();
right: double_doors2()


you DO need to add a semi-colon if you THREAD the function though. such as:
level thread double_doors2();


you just dont need the semi-colon when defining a function.
Share |
_SpuD_
General Member
Since: Jan 30, 2007
Posts: 190
Last: Jun 22, 2008
[view latest posts]
Level 4
Category: CoD Mapping
Posted: Tuesday, Oct. 2, 2007 04:23 pm
Wiked Thankyou everyone thats helped me [biggrin]

It works now!

Fianlly no more [banghead] lol



[machine_gun][banghead][sniper]

Amazing how a semicolon can screw everything up LOL


One last question about the rotation of the doors at the moment they start sideways and move sideways :D

would i need to just fiddle around with the angles to get it right? or is there a set angle it only works at 90 or something??

Thanks again everyone [biggrin][biggrin]


edited on Oct. 2, 2007 12:26 pm by spudy12

edited on Oct. 2, 2007 12:27 pm by spudy12
Share |
TexasRebel
General Member
Since: May 1, 2006
Posts: 373
Last: Aug 20, 2013
[view latest posts]
Level 5
Category: CoD Mapping
Posted: Tuesday, Oct. 2, 2007 05:53 pm
fiddle with the angles and also the rotate command :

hers a script tutorial for the other rotate and move functions.

http://www.modsonline.com/Tutorials-read-121.html

i think you can also use the rotateyaw function instead of rotateto
Share |
Bloodlust
General Member
Since: Apr 7, 2004
Posts: 101
Last: Jan 14, 2015
[view latest posts]
Level 4
Category: CoD Mapping
Posted: Wednesday, Oct. 3, 2007 02:00 am
not sure if its implemented in COD 2 or not, but with COD 4 you can also use rotateyaw and rotatepitch.

also be sure you have an origin in your door so it knows where to start the rotation.
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty : CoD Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»