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

Members Online

»
0 Active | 76 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

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 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: cod4 elevator
iCoDMapping360
General Member
Since: Feb 22, 2011
Posts: 87
Last: May 19, 2011
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Thursday, Feb. 24, 2011 10:24 pm
im trying to make an elevator that has a keypad that selects the floor it goes and moves diagonally because my elevator goes up a diagonal building [drink] i think this is very advanced [confused] could i use trigger damages on the keypad that when shot move the lift to a level or could i have a trigger use or trigger use touch to open a menu???
anybody help?

edited on Feb. 24, 2011 05:34 pm by iCoDMapping360
Share |
tschiggen
General Member
Since: Oct 19, 2010
Posts: 122
Last: Feb 16, 2012
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Friday, Feb. 25, 2011 05:38 am
i saw a video where they used this B-menue. but i dont know how they made the elevator moving.

Share |
iCoDMapping360
General Member
Since: Feb 22, 2011
Posts: 87
Last: May 19, 2011
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Friday, Feb. 25, 2011 05:41 am
thanks i have it working but the triggers dont move with the lift and i get getent used with more than one entity error???[cry]
Share |
irishstorm
General Member
Since: Jan 19, 2009
Posts: 128
Last: Feb 25, 2011
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Friday, Feb. 25, 2011 06:05 am
try
Code:
getentarray
Share |
cskiller86
General Member
Since: Nov 23, 2009
Posts: 528
Last: Oct 25, 2011
[view latest posts]
Level 6
Category: CoD4 Scripting
Posted: Friday, Feb. 25, 2011 08:56 am
If you want to move the triggers, you will have to change their origins.
Code:
trigger1.origin += (0,0,1000); //this will move the trigger 1000 units on the Z axis (up); however, because the elevator moves diagonally, you would also have to move it on the X or Y axis (depending on rotation)
You would have to find the right values for each floor and move all of the triggers.

Another easier way to move an object based on another object is the linkTo() function. However, I can't remember if a trigger can be linked.
If it can, then use this
Code:
trigger1 enableLinkTo();
trigger1 LinkTo(elevator_name);
Do that for all of the button triggers.
Share |
iCoDMapping360
General Member
Since: Feb 22, 2011
Posts: 87
Last: May 19, 2011
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Friday, Feb. 25, 2011 01:50 pm
this is my multiple level lift that takes you to the basement
Code:
main() { thread elev_button1 (); thread elevator_button2 (); } elev_button1() { elev = getent( "liftpad", "targetname" ); trig = getent( "lift_trigger", "targetname" ); while(true) { trig waittill ("trigger"); //wait 4; elev movez (275,5,0,0.6); elev waittill ("movedone"); } } elevator_button2() { elev = getent( "liftpad", "targetname" ); trig = getent( "lift_trigger1", "targetname" ); while(true) { trig waittill ("trigger"); //wait 4; elev movez (-275,5,0,0.6); elev waittill ("movedone"); } }
however it never got the getent error only now[crazy] and getEntArray says my elevator isnt an array
Share |
iCoDMapping360
General Member
Since: Feb 22, 2011
Posts: 87
Last: May 19, 2011
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Friday, Feb. 25, 2011 01:56 pm
ill try this
Code:
main() { level.elevDown=true; level.elevMove=false; switchTOP=getentarray("ups","targetname"); for(i=0; i<switchTOP.size; i++) switchTOP[i] thread elev_think(); } elev_think() { IdoorLEFT=getent("leftindoor", "targetname"); IdoorRIGHT=getent("rightindoor", "targetname"); OdoorTL=getent("topleftdoor", "targetname"); OdoorTR=getent("toprightdoor", "targetname"); OdoorBL=getent("bottomleftdoor", "targetname"); OdoorBR=getent("bottomrightdoor", "targetname"); thread door_open(IdoorLEFT, IdoorRIGHT, OdoorBL, OdoorBR); while(1) { self waittill ("trigger"); if(level.elevMove==false) { level.elevMove=true; thread elev_move(); } } } elev_move() { etime=5; zdirec="z"; zdist1=440; zdist2=-440; IdoorLEFT=getent("leftindoor", "targetname"); IdoorRIGHT=getent("rightindoor", "targetname"); OdoorTL=getent("topleftdoor", "targetname"); OdoorTR=getent("toprightdoor", "targetname"); OdoorBL=getent("bottomleftdoor", "targetname"); OdoorBR=getent("bottomrightdoor", "targetname"); Elevator=getent("elevator", "targetname"); if(level.elevDown==true) { door_close(IdoorLEFT, IdoorRIGHT, OdoorBL, OdoorBR); wait(.1); Elevator thread move_func(zdist1, etime, zdirec); IdoorLEFT thread move_func(zdist1, etime, zdirec); IdoorRIGHT thread move_func(zdist1, etime, zdirec); Elevator waittill ("movedone"); door_open(IdoorLEFT, IdoorRIGHT, OdoorTL, OdoorTR); level.elevDown=false; level.elevMove=false; } else { door_close(IdoorLEFT, IdoorRIGHT, OdoorTL, OdoorTR); wait(.1); Elevator thread move_func(zdist2, etime, zdirec); IdoorLEFT thread move_func(zdist2, etime, zdirec); IdoorRIGHT thread move_func(zdist2, etime, zdirec); Elevator waittill ("movedone"); door_open(IdoorLEFT, IdoorRIGHT, OdoorBL, OdoorBR); level.elevDown=true; level.elevMove=false; } wait(.1); } door_close(leftIN, rightIN, leftOUT, rightOUT) { LDclose=41; RDclose=-41; ydirec="x"; dtime=1.1; leftIN thread move_func(LDclose,dtime, ydirec); rightIN thread move_func(RDclose,dtime, ydirec); wait(1); leftOUT thread move_func(LDclose,dtime, ydirec); rightOUT thread move_func(RDclose,dtime, ydirec); wait(1); } door_open(leftyIN, rightyIN, leftyOUT, rightyOUT) { LDopen=-41; RDopen=41; ydirec="x"; dtime=1.1; leftyOUT thread move_func(LDopen,dtime, ydirec); rightyOUT thread move_func(RDopen,dtime, ydirec); wait(1); leftyIN thread move_func(LDopen,dtime, ydirec); rightyIN thread move_func(RDopen,dtime, ydirec); } move_func(dist,time,direc) { if(direc=="z") self movez (dist, time, (time/2), (time/2)); if(direc=="x") self movex (dist, time, (time/2), (time/2)); self waittill ("movedone"); }
Share |
kusi581
General Member
Since: Mar 8, 2011
Posts: 2
Last: Mar 8, 2011
[view latest posts]
Level 0
Category: CoD4 Scripting
Posted: Tuesday, Mar. 8, 2011 09:43 am
do you think of something like this???

http://www.youtube.com/watch?v=MDEqHsvggkw

i coded this elevator, i can send you the code if you want

Share |
willeponken
General Member
Since: Nov 6, 2010
Posts: 5
Last: Mar 18, 2012
[view latest posts]
Level 0
Category: CoD4 Scripting
Posted: Friday, Apr. 8, 2011 02:35 pm
I would love to have it [rolleyes]
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Friday, Apr. 8, 2011 02:51 pm
@ kusi:
i guess u linked your elev doors to your elevator, right?
this causes this jiggle of your doors
instead of linkto() you should try tomove the doors in the same way and same time like your elevator, maybe looks cleaner

and how did you do this with the menu?
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting

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

»