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 4
Category: CoD4 MP Mapping
CoD 4 mapping and level design for multiplayer.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Previous Page Next Page
subscribe
Author Topic: Elevator
*]SAS[*Foamy
General Member
Since: Nov 22, 2009
Posts: 102
Last: Mar 10, 2010
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Wednesday, Jan. 20, 2010 02:40 am
attachment: (94.2Kb)
here are my map files
its all in one zip [duh]
Share |
cskiller86
General Member
Since: Nov 23, 2009
Posts: 528
Last: Oct 25, 2011
[view latest posts]
Level 6
Category: CoD4 MP Mapping
Posted: Wednesday, Jan. 20, 2010 10:46 am
For some reason, I can't download that.

Anyway, please rename your script to mp_yourmapname_elevator.gsc, because just _elevator is too generic and it can interfere with some other files. It's a good practice to name your scripts mp_yourmapname_scriptname.gsc.

IMPORTANT: Make sure you call your new script in your main gsc (mp_yourmapname.gsc) by adding the following line:
Code:
maps\mp\mp_yourmapname_elevator::main();
.
Then add this to your Zone File
Code:
rawfile,maps\mp\mp_yourmapname_elevator.gsc

I'm not sure that script is the best way to learn about moving brushes. I suggest you start simple with a tutorial on this site.

Your elevator should be made of normal brushes. All the brushes + an origin brush (which should be placed under the elevator floor) should form a script_brushmodel named elevator.
The triggers should be named switch. You'll want these triggers near the areas where the buttons would be.

I'll try to explain this script as best as I know
Code:
main()
{
  level.elevatorDown = true; //the elevator should be created at the bottom floor in Radiant
  level.elevatorMoving = false; //the elevator isn't moving
  thread elevator_start(); //runs the elevator_start code
}

elevator_start()
{
  elevator = getentarray ("switch","targetname"); //in the script the switches triggers will be reffered as elevator
  if ( isdefined(elevator) ) //if the triggers exist
  for (i = 0; i < elevator.size; i++) //this makes a list with the number of triggers
  elevator[i] thread elevator_think(); //for each trigger the elevator_think code will be run
}

elevator_think()
{
  while (1)
  {
   self waittill ("trigger"); //waits until the trigger_use has been triggered (the button has been pushed)
   if (!level.elevatorMoving) //if the elevator isn't already moving
   thread elevator_move(); //then run the code
  }
}

elevator_move()
{
  elevatormodel = getent ("elevator", "targetname"); //the script_brushmodel will be reffered as elevatormodel in the script
  level.elevatorMoving = true; //elevator is moving
  speed = 10; //speed at which it travel
  height =581; //distance between floors; you should change this to what you have
  if (level.elevatorDown) //if the elevator is at the bottom floor
  {
   elevatormodel playsound ("elevator"); //play this sound; you may have to create a soundalias for this (see Deek's tutorial on adding sound)
   elevatormodel movez (height, speed);//move elevator up with that speed
   elevatormodel waittill ("movedone"); //waits until the elevator has stopped
   level.elevatorDown = false; //elevator is at the top floor now
  }
  else //if the elevator wasn't at the bottom floor
  {
   elevatormodel playsound ("elevator");
   elevatormodel movez (height - (height * 2), speed); // move elevator down
   elevatormodel waittill ("movedone"); //waits until the elevator has stopped
   level.elevatorDown = true; //elevator is at the bottom floor now
  }
  level.elevatorMoving = false; //elevator is not moving
}

Hope it will make more sense now.

PS If anyone sees a mistake, please correct me.
Share |
*]SAS[*Foamy
General Member
Since: Nov 22, 2009
Posts: 102
Last: Mar 10, 2010
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Wednesday, Jan. 20, 2010 06:10 pm
ok well i will try to make the Elevator one more time and do what you said

Share |
*]SAS[*Foamy
General Member
Since: Nov 22, 2009
Posts: 102
Last: Mar 10, 2010
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Thursday, Jan. 21, 2010 04:20 am
i just don't get it i set it up like you say but still it does not move
[confused]

add me on xfire im sasfoamy and i can send you my files so you can look at it
[sad]
Share |
Pedro699
General Member
Since: Jun 19, 2006
Posts: 781
Last: Dec 18, 2010
[view latest posts]
Level 7
Category: CoD4 MP Mapping
Posted: Thursday, Jan. 21, 2010 12:17 pm
Run your map in developer mode:

/developer 1

to see if it picks up any errors.

If there are none, you can ensure the script is being run by creating a syntax error (remove a semi-colon for instance) and it would then error.

If the script is being executed it would imply that the entities in your map have not been set up right.
Share |
{PADZ}grimreaper
General Member
Since: Apr 23, 2005
Posts: 334
Last: Aug 11, 2011
[view latest posts]
Level 5
Category: CoD4 MP Mapping
Posted: Friday, Jan. 22, 2010 11:32 pm
Before trying to make an elevator you should probably want to take a look Here
Then there is an easy elevator tutorial Here
plus This
Share |
*]SAS[*Foamy
General Member
Since: Nov 22, 2009
Posts: 102
Last: Mar 10, 2010
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Friday, Jan. 22, 2010 11:40 pm
i got my Elevator working help to cskiller86
Share |
Larrabee
General Member
Since: Feb 5, 2010
Posts: 113
Last: Aug 23, 2012
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Wednesday, Mar. 10, 2010 01:20 am
so... thats it? you reply back with "I fixed it"?
why don't you let everyone know what you did to get it working.
Share |
cskiller86
General Member
Since: Nov 23, 2009
Posts: 528
Last: Oct 25, 2011
[view latest posts]
Level 6
Category: CoD4 MP Mapping
Posted: Wednesday, Mar. 10, 2010 04:10 pm
Well there isn't much to say about it. If you follow the tutorial to the letter, you shouldn't have any problems.
If you do have problems, create a new topic and we'll try to help you.
Share |
*]SAS[*Foamy
General Member
Since: Nov 22, 2009
Posts: 102
Last: Mar 10, 2010
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Wednesday, Mar. 10, 2010 10:10 pm
@cs how do i make more then one i can get the one working but i can't make 2 [ohwell] i sent you a pm a long time ago but you never sent one back
Share |
Restricted Access Topic is Locked
Page
Previous Page Next Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 MP 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

»