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
[-X-]Fried... [Forum]
zelimper [Forum]
Dugynight [Forum]
LPRay [Forum]
foyleman [Messa]
Blimp01 [Forum]
Allan90 [Forum]
rik4000 [Forum]
355thSGTCL... [Today]
zeroy [Forum]
LS-R1-mini [Today]
Welshy [Forum]
techno2sl [Today]
*UWS*KILL_... [Forum]

14 Members and 16 Guests
Chat MODSonline
0 People Now Chatting
MODSOnline TeamSpeak

download TeamSpeak

In-The-News
Monday, Dec. 1st
A message from foyleman
Sunday, Nov. 30th
MODSonair 156 Live
Friday, Nov. 28th
MODSonair Episode 155
Wednesday, Nov. 26th
MODSonair Forum Buttons
Monday, Nov. 24th
Holiday Gift Guide 2008 - PC
Latest Poll
Single or Multiplayer maps for World at War?
Single-Player 29.89%
Multiplayer 62.07%
WHAT!? The tools are out? 8.05%
Read More...
10 comments

Newsletter
Name:
Email:
Newsletter Archives
Your Membership
User Name:
Password:
Register.
In The Forums
Inner/Outer Radius Size
CoD:WW Level Des.. Posts: (5) Views: (52) by [-X-]FriedCoD
A message from foyleman
In The News.. Posts: (41) Views: (215) by foyleman
Appreciation
MODSonline.. Posts: (1) Views: (9) by Watter
pathnode placement
CoD:WW Level Des.. Posts: (18) Views: (110) by Sgt.Rampage
Google 468 Banner 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 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, rEdrUmMDK, Foxhound, Wyatt_Earp, Rasta, StrYdeR, The_Caretaker, Cypher2004, batistablr, Welshy
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access
Page
Previous Page Next Page
subscribe
Author Topic: script help?
ricardos
General Member
Since: Aug 22, 2007
Posts: 186
Last: Nov 30, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Wednesday, Aug. 27, 2008 05:18 pm
Ok , i did this pretty fast, and this is pretty easy too . but i only got the basics of the script now :


main(){

idl = getent ("idl","targetname"); // Inside door left
idr = getent ("idr","targetname"); // inside door right
oddl = getent ("oddl","targetname"); // outside door downstairs left
oddr = getent ("oddr","targetname"); // outside door downstairs right
odul = getent ("odul","targetname"); // outside door upstairs left
odur = getent ("odur","targetname"); // outside door upstairs right
lift = getent ("lift","targetname"); // lift model
trig = getentarray ("lift_trigger","targetname"); // trigger of the lift



// Upstairs

idl movex (40,0,0,2);
idr movex (40,0,0,2);
oddl movex (40,0,0,2);
oddr movex (40,0,0,2);
wait (2);
idl movez (90,0,0,5);
idr movez (90,0,0,5);
lift movez (90,0,0,5);
wait (2);
idl movex (-40,0,0,2);
idr movex (-40,0,0,2);
odur movex (-40,0,0,2);
odul movex (-40,0,0,2);



// Downstairs

idl movex (40,0,0,2);
idr movex (40,0,0,2);
odul movex (40,0,0,2);
odur movex (40,0,0,2);
wait (2);
idl movez (-90,0,0,5);
idr movez (-90,0,0,5);
lift movez (-90,0,0,5);
wait (2);
idl movex (-40,0,0,2);
idr movex (-40,0,0,2);
oddr movex (-40,0,0,2);
oddl movex (-40,0,0,2);

}

I'll go try to find out how to get it all working right.. with IF lift is downstairs.. then go to the first script.. IF lift is upstairs then do the second script.. i have to look how i do it.. or you can tell me :) that would be easier.. ill try to find it in the script of theother first.

ok a few question :

level.elevatorDown = true; // elevator starts at bottom: true/false
level.elevatorMoving = false; // elevator is not currently moving

Do i have to change the word elevator to lift? or is it ok this way? no right?

and then..

can you tell me how i put
If (level.elevatordown) .. then use the first script.. or if its up use the other one?
i really cant figure it out of the other script..

and last one..
How do i put out the trigger if the elevator is moving?

and where do i put the codes and stuff?



DUDE I THINK I DID IT !!!!!!!!!

main(){

idl = getent ("idl","targetname"); // Inside door left
idr = getent ("idr","targetname"); // inside door right
oddl = getent ("oddl","targetname"); // outside door downstairs left
oddr = getent ("oddr","targetname"); // outside door downstairs right
odul = getent ("odul","targetname"); // outside door upstairs left
odur = getent ("odur","targetname"); // outside door upstairs right
lift = getent ("lift","targetname"); // lift model
trig = getentarray ("lift_trigger","targetname"); // trigger of the lift


level.liftDown = true; // elevator starts at bottom: true/false
level.liftMoving = false; // elevator is not currently moving
thread lift_think();
}


lift_think() {
while (1) {
self waittill ("trigger");
if (!level.liftmoving);
thread uod();


oud() {
if (level.liftdown)
thread up();
if (level.liftup)
thread down();



up(); { // Going Up

idl movex (56,0,0,2);
idr movex (56,0,0,2);
oddl movex (56,0,0,2);
oddr movex (56,0,0,2);
wait (2);
idl movez (90,0,0,5);
idr movez (90,0,0,5);
lift movez (90,0,0,5);
wait (2);
idl movex (-56,0,0,2);
idr movex (-56,0,0,2);
odur movex (-56,0,0,2);
odul movex (-56,0,0,2);
}



down(); { // Going Down

idl movex (56,0,0,2);
idr movex (56,0,0,2);
odul movex (56,0,0,2);
odur movex (56,0,0,2);
wait (2);
idl movez (-90,0,0,5);
idr movez (-90,0,0,5);
lift movez (-90,0,0,5);
wait (2);
idl movex (-56,0,0,2);
idr movex (-56,0,0,2);
oddr movex (-56,0,0,2);
oddl movex (-56,0,0,2);
}



I'm gonna test it RIGHT NOW AAAAAAAAH IM SO EXITED I MADE MY OWN SCRIPT FOR FIRST TIME :P

GOD DAMNIT .. now i get errors .. as usual..
first in if (!level.liftmoving);
i just deleted that line because it wasnt that necesarry for now.. then i got an error in uod () {

(bad syntax)

i deleted the { but still.. damn errors everywhere..

i think i did it all wrong

edited on Aug. 27, 2008 05:45 pm by ricardos
Sevenz
General Member
Since: Apr 24, 2006
Posts: 1133
Last: Nov 28, 2008
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Wednesday, Aug. 27, 2008 06:04 pm
i hopefully fixed the syntax errors:


Code:


edited on Aug. 27, 2008 06:05 pm by Sevenz
The_Caretaker
Preferred Member
Since: Jun 8, 2004
Posts: 11559
Last: Oct 4, 2008
[view latest posts]
Level 10
Forum Moderator
Category: CoD2 Scripting
Posted: Wednesday, Aug. 27, 2008 06:13 pm
movex (distance,time,accelerate,decelerate);

you use movex (56,0,0,2);

in other words... you want something to move 56 units along the axis in 0 seconds, 0 seconds accelerating, and 2 seconds decelerating.

This won't work :p

Try

movex (56,2,0,0);

the same goes for all your movez lines.
ricardos
General Member
Since: Aug 22, 2007
Posts: 186
Last: Nov 30, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Thursday, Aug. 28, 2008 07:14 am
Thank you both so much =)
Offcourse i shouldve used ELSE :P
and stupid of me to mix up the places for accelerate and time :P

anyway , it's not working yet and this time i really don't understand the error:


Code:


I don't knwo whats wrong with idl .. I made a door and puted a origin in the most outside part of the door , selected em both .. Script> brushmodel .. name them targetname:idl

what could be this problem again?[eek]

edited on Aug. 28, 2008 07:22 am by ricardos
Sevenz
General Member
Since: Apr 24, 2006
Posts: 1133
Last: Nov 28, 2008
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Thursday, Aug. 28, 2008 10:34 am
check for typos

throw error if "idl" is not defined:

idl = getent ("idl","targetname");
assertex(isdefined(idl) == true, "idl is not defined, check for typos");
.KiLL3R.
General Member
Since: Oct 26, 2006
Posts: 1090
Last: Dec 2, 2008
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Thursday, Aug. 28, 2008 10:37 am
In your scripts sevenz, all them thingys are not defined in the threads, only the main() thread has them defined
Sevenz
General Member
Since: Apr 24, 2006
Posts: 1133
Last: Nov 28, 2008
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Thursday, Aug. 28, 2008 10:47 am
it's not my script, but you're right
.KiLL3R.
General Member
Since: Oct 26, 2006
Posts: 1090
Last: Dec 2, 2008
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Thursday, Aug. 28, 2008 10:56 am
see if you can work this out [casanova]


Code:
ricardos
General Member
Since: Aug 22, 2007
Posts: 186
Last: Nov 30, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Thursday, Aug. 28, 2008 12:13 pm
Sevenz writes...
Quote:
check for typos

throw error if "idl" is not defined:

idl = getent ("idl","targetname");
assertex(isdefined(idl) == true, "idl is not defined, check for typos");


im sorry , i don't really understand this . what are typos? (I'm not from an english speaking country ,i think you already found out:P so maybe because of that i dont get it , or just for the reason im stupid haha)

btw.. thanks .Kill3r. for the help , i have no idea how you made that. did you do that just out of your head? :O
anyway i got 1 error:


******* script runtime error *******
cannot cast undefined to string: (file 'maps/mp/liften.gsc', line 10)
stuff = getentarray(self.target,"targetname");
*
called from:
(file 'maps/mp/liften.gsc', line 5)
lifts thread init_lift();
*
called from:
(file 'maps/mp/mp_kut.gsc', line 4)
maps\mp\liften::main();
*
started from:
(file 'maps/mp/mp_kut.gsc', line 1)
main()
*


and to be honest.. i don't know why you did the Stuff part..
Can you maybe tell me what that's for , maybe ill learn a little more to make scripts myself then = )
.KiLL3R.
General Member
Since: Oct 26, 2006
Posts: 1090
Last: Dec 2, 2008
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Thursday, Aug. 28, 2008 02:14 pm
That script lets you have as many lifts as you want

How to use it:

1>
Make the use trigger - make brushes for the up and down stairs buttons and texture with tools>trigger, select both right click > trigger > use_touch

2>
Make the lift and make it a script_brushmodel, give it a "script_noteworthy" of "lift"

3>
Make the inner left and right doors script_brushmodels
Give the left one a "script_noteworthy" of "inside_door_left" and the right one "inside_door_right"

4>
Make the outer down stairs left and right doors script_brushmodels
Give the left one a "script_noteworthy" of "outside_door_down_left" and the right one "outside_door_down_right"

5>
Make the outer up stairs left and right doors script_brushmodels
Give the left one a "script_noteworthy" of "outside_door_up_left" and the right one "outside_door_up_right"

6>
Make sure you have nothing selected
Select one of the triggers then one of the brushes for the lift and press W, a line should appear connecting the 2 together
Do the same with the other doors
In the end you should have loads of lines connecting the trigger to the doors and stuff


I think the CoD2 connect thing is W
Restricted Access Restricted Access
Page
Previous Page Next Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting
All logos and trademarks and information in this site are property of MODSonline LLC © 2008.
The comments are property of their posters.
RSS news feeds for MODSonline can be found News.php.
MODSonline Subscriptions
Partners
Call of Duty Headquarters
XoXide
The Firing Box
Frag Universe
modbase.be
Battle for Europe COD2
CODAddicts - Call of Duty News & Downloads
Ask About
Advertising
Friends
SOF2 Files and Downloads
Volcano
Great Gamer
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 155
MODSonair Episode 154
MODSonair Episode 153
MODSonair Episode 152
MODSonair Episode 151
Next Show
The next MODSonair show will air LIVE on:

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