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

Members Online

»
0 Active | 101 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
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 subscribe
Author Topic: Elevator bad syntax
_SpuD_
General Member
Since: Jan 30, 2007
Posts: 190
Last: Jun 22, 2008
[view latest posts]
Level 4
Category: CoD Mapping
Posted: Saturday, Dec. 15, 2007 11:47 am
Well im trying to make an elevator that moves up to the 648 units automatically when someone steps in it

To do this i have made the elevator out of brushes, then on the elevator floor put a trigger/multiple

Then i have used (and slightly modified) the script off the eleavator tutorail.

Code:
main() 
{ 
level.elevatorDown = true; // elevator starts at bottom: true/false 
level.elevatorMoving = true; // elevator is not currently moving 
thread elevator_start(); 
} 

elevator_start() { 
elevator = getentarray ("elevator_trigger","targetname"); 
if ( isdefined(elevator) ) 
for (i = 0; i < elevator.size; i++) 
elevator[i] thread elevator_think(); 
} 

elevator_think() { 
while (1) { 
self waittill ("trigger"); 
if (!level.elevatorMoving) 
thread elevator_move(); 
} 
} 

elevator_move() { 
elevatormodel = getent ("elevator", "targetname"); 
level.elevatorMoving = true; 
speed = 2; 
height = 648; 
wait (1); 
if (level.elevatorDown) { // moves to top 
elevatormodel playsound (""); // sound definition for soundaliases.csv
wait (1); // wait a second to hear the motor start and then start the movement of the lift - feels more realistic
elevatormodel moveZ (height, speed); 
elevatormodel waittill ("movedone"); 
level.elevatorDown = false; 
} 
else { // moves to bottom 
elevatormodel playsound (""); // sound definition for soundaliases.csv
wait (1);  // wait a second to hear the motor start and then start the movement of the lift - feels more realistic
elevatormodel moveZ (height - (height * 2), speed); 
elevatormodel waittill ("movedone"); 
level.elevatorDown = true; 
} 
level.elevatorMoving = false; 
} 


Please can some tell me whats wrong with this?? as i always get a bad syntax eror, but i remove this script it works fine

Please help

Thanks

SpuD
Share |
novemberdobby
General Member
Since: Sep 17, 2006
Posts: 1965
Last: Oct 13, 2013
[view latest posts]
Level 8
Category: CoD Mapping
Posted: Saturday, Dec. 15, 2007 12:10 pm
Code:

main() 
{ 
level.elevatorDown = true;
level.elevatorMoving = true;
thread elevator_start(); 
} 

elevator_start() 
{ 
elevators = getentarray ("elevator_trigger","targetname"); 
if(isdefined(elevators)) 
for (i = 0; i < elevators.size; i++) elevators[i] thread elevator_think(); 
} 

elevator_think() 
{ 
while (1) 
{ 
self waittill ("trigger");
if (!level.elevatorMoving) thread elevator_move(); 
} 
} 

elevator_move() 
{ 
elevatormodel = getent ("elevator", "targetname"); 
level.elevatorMoving = true; 
speed = 2; 
height = 648; 
wait 1; 

if (level.elevatorDown)
{
//elevatormodel playsound ("");
wait 1;
elevatormodel moveZ (height, speed); 
elevatormodel waittill ("movedone"); 
level.elevatorDown = false; 
} 
else 
{ 
//elevatormodel playsound (""); 
wait 1;
elevatormodel moveZ (height - (height * 2), speed); 
elevatormodel waittill ("movedone"); 
level.elevatorDown = true; 
}
level.elevatorMoving = false; 
}


try

edited on Dec. 15, 2007 07:11 am by NovemberDobby
Share |
_SpuD_
General Member
Since: Jan 30, 2007
Posts: 190
Last: Jun 22, 2008
[view latest posts]
Level 4
Category: CoD Mapping
Posted: Saturday, Dec. 15, 2007 12:19 pm
Well its fixed the bad syntax!

But now in the map if i stand on the elevtor nothing happens??

why is this??
is it somethig to do with the trigget??

i set mine to mulitple is tht correct??

SpuD

Edit: i think i might know what the problem what the problem is,
i have set the elevator as a script brush model and reading the Getting Started in Scripting (Moving Things) tutorial it says

Quote:
) If you want to make something move in the game, you need both mapping and scripting .

2) Anything that moves is a script_whatever (script_model for a model, script_brushmodel for a brush)

3) Anything that moves must have an origin (a script_model inevitably has one of them, a script_brushmodel does not have any by itself).


so if i set it to script model would it work or do i need to draw it an orgin with the orgin texture??

if i have to draw it an origin , where would i draw it??
would it be where it starts on the ground floor??

thanks

SpuD

edited on Dec. 15, 2007 07:27 am by _SpuD_
Share |
novemberdobby
General Member
Since: Sep 17, 2006
Posts: 1965
Last: Oct 13, 2013
[view latest posts]
Level 8
Category: CoD Mapping
Posted: Saturday, Dec. 15, 2007 12:35 pm
a script_brushmodel doesn't need an origin for just movex/z/y, it does for rotation and stuff.

has the trigger got the right targetname? re-make it
Share |
Restricted Access Topic is Locked 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

»