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
Previous Page
subscribe
Author Topic: Little scripting help please.
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 11:06 pm
ok,
here is a thought. what if when you press your first button the "train" moves to the other end, waits for a few seconds, then returns to where it started from. then resets.
also if you are at the other button and press it, the train moves to the end where the second button is, waits a few seconds, then returns to the other end again. then resets.

or it could wait for the second trigger before the first one will work again.

Just an idea, don't know if it will work for you or not.
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: Tuesday, Dec. 14, 2004 01:57 am
the elevator script would still work for you...just look at how it is working, and modify it to suit your needs...2 buttons is not a problem, unless you want to be able to use the trigger while the train is moving...if that is the case...i dont think there is any scripting that will help you

use the elevator tut, and change the movement to horizontal, add a second trigger...pie! [angryalien]
Share |
Jesse127
General Member
Since: Aug 14, 2004
Posts: 58
Last: Apr 7, 2005
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Tuesday, Dec. 14, 2004 02:12 am
Hey my script for button 2 is in another script if i tell trigger #2 to wait for trigger #1 to be pressed will it read the second trigger since its in another gsc?
Share |
Jesse127
General Member
Since: Aug 14, 2004
Posts: 58
Last: Apr 7, 2005
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Tuesday, Dec. 14, 2004 02:34 am
Lol you guys gotta believe me when i say im trying lol. Ok when I think I got the elevator script good for my map and try it out i get a script runtime error. I dont remember the error totally but it says somethin like this lol. entity is not array on this elevator waittill("trigger");

Here is the script that i tryed to get working. I didnt know if you had to change the "elevator"'s in this script to door. Like i had in my other script but here it is.

main()
{
maps\mp\_load::main();

level.elevatorvar = "bottom";
elevator_start();
}

elevator_start()
{
trig = getent ("train_trigger", "targetname");
elevator = getent("train","targetname");
if(isdefined(elevator))
{
for(i=0;i {
elevator waittill("trigger");
elevator thread elevator_move();
}
}
}

elevator_move()
{

if (level.elevatorvar == "bottom")
{
thread elevatorup();
}

if (level.elevatorvar == "top")
{
thread elevatordown();
}

}



elevatorup()
{
elevatormodel = getent("train", "targetname");
elevatormodel movex(1912, 20);
elevatormodel waittill("movedone");
level.elevatorvar = "top";
thread elevator_start();
}

elevatordown()
{
trig = getent ("train_trigger2", "targetname");
elevatormodel = getent("elevatormodel", "targetname");
elevatormodel movex(-1912, 20);
elevatormodel waittill("movedone");
level.elevatorvar = "bottom";
thread elevator_start();
}
Share |
Jesse127
General Member
Since: Aug 14, 2004
Posts: 58
Last: Apr 7, 2005
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Tuesday, Dec. 14, 2004 02:48 am
Lol i should just make my train go around in a oval around my whole map. If I knew how lol. there would be lots of scripting probably because of all those turns. I would have to rotate the train a lot.
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: Tuesday, Dec. 14, 2004 03:21 am
Quote:
elevator_start()
{
trig = getent ("train_trigger", "targetname");
elevator = getent("train","targetname");
if(isdefined(elevator))
{
for(i=0;i
{
elevator waittill("trigger");
elevator thread elevator_move();
}
}
}

you have an error here
try this
Code:
elevator_start()
{
trig = getent ("train_trigger", "targetname");
elevator = getent("train", "targetname");

trig waittill("trigger", other);
elevator thread elevator_move();
}

if you call an array, that means that you have more than one location of an object simultaneously...so the way you are calling it...you have one trigger, and multiple elevators, the way i wrote it...you have one trigger and one elevator
[angryalien]

also, look at the way that the script for the elevator tut uses the elevatormoving...that way if your train is moving, it will disable the trigger(s) to prevent it from travelling off the map or out of the range that you specified
Share |
Restricted Access Topic is Locked
Page
Previous 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

»