MODSonline
  Welcome Guest to MODSonline Home | Forums | Register | Login
Main-Menu
Home
Login
Register
Add Download
Add News
Add Tutorial *
Forums

Advertise
Affiliate Store US *
Affiliate Store UK *
Affiliate Store CA *
Angry Letter Generator
Avatar Upload
Calendar of Games
Contact
Downloads
FAQs
Forums
Member List
Member Projects
News
News Grabber *
Policy
Polls
Private Messages
Reviews
Screenshot Gallery
Search
Servers - Game
Store - Shirts *
Subscribe
Topics
Tutorials
Weblinks
Wiki *
Tutorials
CoD Mapping
CoDUO Mapping
CoD2 Mapping
CoD4 Mapping
CoDWW Mapping
CoD FAQs
HL2 Mapping
HL2 FAQs
SOF1 Mapping
Crysis Mapping
Q4 Mapping
Doom 3 Mapping
Doom 3 FAQs
UT2K3 Mapping
SOF2 Mapping
SOF2 FAQs

Lightray Modeling
General Modeling
General Modding
Adobe Photoshop
Common Mapping Errors

Readme.txt Generator
Members-Online
INSANE{H|S} [Forum]
taske [Downl]

2 Members and 11 Guests
Chat MODSonline
0 People Now Chatting
MODSOnline TeamSpeak

download TeamSpeak

In-The-News
Sunday, Jan. 4th
MODSonair 161 Live
Friday, Jan. 2nd
MODSonair Episode 160
Thursday, Jan. 1st
HAPPY NEW YEAR MODSONLINE AND ALL
Sunday, Dec. 28th
MODSonair 160 Live
Saturday, Dec. 27th
MODSonline Holiday Pwnage
Latest Poll
Modsonair audio or video?
Video from here on. 48.57%
Sticking with audio. 2.86%
Either is good. 17.14%
What is modsonair? 31.43%
Read More...
4 comments

Newsletter
Name:
Email:
Newsletter Archives
Your Membership
User Name:
Password:
Register.
In The Forums
Final Error... Hopefully!!!
CoD 4 Level Desi.. Posts: (6) Views: (98) by INSANE{H|S}
~ CodCreators.com ~
Offsite Links an.. Posts: (1) Views: (15) by eXsolved
Zombies Crashing?
CoD:WW Zombie/Co.. Posts: (4) Views: (33) by nirvashtype007
Players enter game when running from Launcher??
CoD:WW Multiplay.. Posts: (3) Views: (23) by {PP}Bloodletter
Art of War Central Quake 4 Mods for Dummies
CoDWW Download
Forums
MODSonline.com 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 Level Design
CoD mapping and level design.
Moderators: foyleman, rEdrUmMDK, Foxhound, Wyatt_Earp, Rasta, StrYdeR, The_Caretaker, Cypher2004, supersword, supersword, batistablr, Welshy
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access
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 Level Design
Posted: Monday, Oct. 1, 2007 05: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
djheps
General Member
Since: Oct 5, 2006
Posts: 52
Last: Oct 4, 2007
[view latest posts]
Level 3
Category: CoD Level Design
Posted: Monday, Oct. 1, 2007 05: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!
|TM|TexasRebel
General Member
Since: Apr 30, 2006
Posts: 258
Last: Nov 16, 2008
[view latest posts]
Level 5
Category: CoD Level Design
Posted: Monday, Oct. 1, 2007 09:00 pm
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().
_SpuD_
General Member
Since: Jan 30, 2007
Posts: 190
Last: Jun 22, 2008
[view latest posts]
Level 4
Category: CoD Level Design
Posted: Tuesday, Oct. 2, 2007 11:57 am
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
djheps
General Member
Since: Oct 5, 2006
Posts: 52
Last: Oct 4, 2007
[view latest posts]
Level 3
Category: CoD Level Design
Posted: Tuesday, Oct. 2, 2007 12: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
djheps
General Member
Since: Oct 5, 2006
Posts: 52
Last: Oct 4, 2007
[view latest posts]
Level 3
Category: CoD Level Design
Posted: Tuesday, Oct. 2, 2007 12: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);
}
}
Bloodlust
General Member
Since: Apr 7, 2004
Posts: 97
Last: Mar 25, 2008
[view latest posts]
Level 3
Category: CoD Level Design
Posted: Tuesday, Oct. 2, 2007 12: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.
_SpuD_
General Member
Since: Jan 30, 2007
Posts: 190
Last: Jun 22, 2008
[view latest posts]
Level 4
Category: CoD Level Design
Posted: Tuesday, Oct. 2, 2007 12: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
|TM|TexasRebel
General Member
Since: Apr 30, 2006
Posts: 258
Last: Nov 16, 2008
[view latest posts]
Level 5
Category: CoD Level Design
Posted: Tuesday, Oct. 2, 2007 01: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
Bloodlust
General Member
Since: Apr 7, 2004
Posts: 97
Last: Mar 25, 2008
[view latest posts]
Level 3
Category: CoD Level Design
Posted: Tuesday, Oct. 2, 2007 10:00 pm
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.
Restricted Access Restricted Access
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty : CoD Level Design
All logos and trademarks and information in this site are property of MODSonline LLC © 2009.
The comments are property of their posters.
RSS news feeds for MODSonline can be found News.php.
Intergi
Partners
CODAddicts - Call of Duty News & Downloads
Call of Duty Headquarters
XoXide
The Firing Box
Frag Universe
Battle for Europe COD2
modbase.be
Ask About
Advertising
Friends
Great Gamer
Canada Kicks Ass Clan
SOF2 Files and Downloads
Ask About
Advertising
Link to Us
MODSonair
View in iTunes
Please help us to raise in the ranks of podcasting and subscribe to our itunes feed using the link above.
MODSonair Releases
MODSonair Episode 160
MODSonair Episode 159
MODSonair Episode 158
MODSonair Episode 157
MODSonair Episode 156
Next Show
The next MODSonair show will air LIVE on:
01/11/2009 12:00 EST

Time remaining:
Copyright © 2009 MODSonline
Tresware Content Management System Copyright © 2009 Tresware
Website Designed and Hosted   Tresware