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

Members Online

»
0 Active | 14 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: Little scripting help please.
Jesse127
General Member
Since: Aug 14, 2004
Posts: 58
Last: Apr 7, 2005
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Monday, Dec. 13, 2004 02:01 am
I need a little bit of scripting help. What im doing is making a train that just goes straight 1912 units. To make the train move you press this little button outside of the train. When you get to where it stops. There is another button there that you can press to go 1912 units in reverse. I have the script made for it and everything. Its just that when my train is at the first stop, and I jump out and go back to the button to make it go foward. It keeps going forward. Through the wall and everything. How can i get it so when i press that button again the train wont go any farther. I got it to work one time I just erased the waittill ("movedone") part but then the forward button doesnt work anymore. Will someone please try to help me with this and i hope you all understood that lol i cant explain things to well.
Share |
lauramaegan
General Member
Since: Aug 9, 2004
Posts: 630
Last: Feb 11, 2007
[view latest posts]
Level 6
Category: CoD Mapping
Posted: Monday, Dec. 13, 2004 02:33 am
Post your script. So we can see what you've got going on.
Share |
Jesse127
General Member
Since: Aug 14, 2004
Posts: 58
Last: Apr 7, 2005
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Monday, Dec. 13, 2004 02:47 am
Ok here is my 2 scripts.

trainforward.gsc

main()
{
thread door_slider ();
}

door_slider ()
{
door = getent ("train", "targetname");
trig = getent ("train_trigger", "targetname");
while (1)
{
trig waittill ("trigger");
wait (1);
door movex (1912, 20, 0, 0.5);
door waittill ("movedone");

}
}



trainbackwards.gsc

main()
{
thread door_slider ();
}

door_slider ()
{
door = getent ("train", "targetname");
trig = getent ("train2_trigger", "targetname");
while (1)
{
trig waittill ("trigger");
wait (1.5);
door movex (-1912, 20, 0, 0.5);
door waittill ("movedone");

}
}

Share |
lauramaegan
General Member
Since: Aug 9, 2004
Posts: 630
Last: Feb 11, 2007
[view latest posts]
Level 6
Category: CoD Mapping
Posted: Monday, Dec. 13, 2004 02:53 am
If i had to guess you need to reset the threads after they are completed. so they look like this:
trainforward.gsc

main()
{
thread door_slider ();
}

door_slider ()
{
door = getent ("train", "targetname");
trig = getent ("train_trigger", "targetname");
while (1)
{
trig waittill ("trigger");
wait (1);
door movex (1912, 20, 0, 0.5);
door waittill ("movedone");
thread door_slider();
}
}



trainbackwards.gsc

main()
{
thread door_slider ();
}

door_slider ()
{
door = getent ("train", "targetname");
trig = getent ("train2_trigger", "targetname");
while (1)
{
trig waittill ("trigger");
wait (1.5);
door movex (-1912, 20, 0, 0.5);
door waittill ("movedone");
thread door_slider();
}
}
Share |
Jesse127
General Member
Since: Aug 14, 2004
Posts: 58
Last: Apr 7, 2005
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Monday, Dec. 13, 2004 03:00 am
Ok man ill go try that out thanks.
Share |
Jesse127
General Member
Since: Aug 14, 2004
Posts: 58
Last: Apr 7, 2005
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Monday, Dec. 13, 2004 03:36 am
Sorry man it doesnt work, thanks a lot for trying to help me though.
Share |
getmapsfergy
General Member
Since: Mar 15, 2004
Posts: 42
Last: Mar 24, 2005
[view latest posts]
Level 2
Category: CoD Mapping
Posted: Monday, Dec. 13, 2004 04:48 am
i would suggest taking a look at the elevator tut/map/prefab. Pretty sure you need to put if..then statements in the script..so that its basically...

if train is at switch A..move forward
if train is at switch B...move backward

don't know the scripting language to write it out...but take a look at those tuts for help!
Share |
StrYdeR
General Member
Since: May 11, 2004
Posts: 11671
Last: Oct 7, 2021
[view latest posts]
Level 10
Admin
Forum Moderator
Im a HOST of MODSonair
Category: CoD Mapping
Posted: Monday, Dec. 13, 2004 04:50 am
lmao...was just about to type the same thing...but was removing the double post

the elevator tut will show you how to define if the train is moving...and if so...to disable the triggers

[angryalien]
Share |
Jesse127
General Member
Since: Aug 14, 2004
Posts: 58
Last: Apr 7, 2005
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Monday, Dec. 13, 2004 05:45 am
lol ok thanks guys ill look at it. I think i have it downloaded already.
Share |
Jesse127
General Member
Since: Aug 14, 2004
Posts: 58
Last: Apr 7, 2005
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Monday, Dec. 13, 2004 10:46 pm
Hey guys i dont think that elevator script will work with the map i made. Because it has the go up and go down button in the same script. Ill see if i can explain what im trying to do in my map a little more. Ok im trying to make this train move (its not really a train but it slides on these rails lol) its got 2 buttons with 1 trigger for each button ok. The first button moves the train foward the second one moves the train back to the first one. Im trying to get them to work so that when i press them twice they dont go through the wall. I still have the same scripts as i posted up there.

Im very new to this scripting thing lol.
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

»