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

Members Online

»
0 Active | 44 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 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: Elevator issues (sorry, it's another one)
Carrottop
General Member
Since: Feb 10, 2009
Posts: 14
Last: Feb 20, 2009
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Tuesday, Feb. 17, 2009 02:16 am
uh...you guyz seem like you know a lot about this elevator/scripting thing. Me on the other hand, know NOTHING about either. I just made a pretty awesome mp map and i wanted to add an elevator

I don't want to seem demanding, but i am merely wondering if it is possible to make an elevator that goes up a certain distance, after, lets say 5 seconds, comes back down to it's original postion.

What I have already tried: The brush i am trying to move, i made it a script/brushmodel and put in targetname/elevator. Then, i made a damage trigger and put in targetname/trig_elevator. Then i made a script (.gsc) file called mp_elevator.gsc
The code inside follows:

main()
{
thread elevator();
}

elevator()
{
elevator=getent("elevator","targetname");
trig=getent("trig_elevator","targetname");
while(1)
{
trig waittill ("trigger");
elevator movez (-250,7,1.9,1.9);
elevator waittill ("movedone");
wait(1);
elevator movez (250,7,1.9,5);
elevator waittill ("movedone");
}
}

(sorry i didn't put it into the code thingy)
I put this line into my map .gsc file:
maps\mp\mp_elevator::main();

And that's what i've done. The only problem is that the trigger either doesn't work or i did something WRONG!!

I'm not even sure if this code will make the elevator do what i want (and come down after 5 seconds)....

Btw, I have no idea how to make my own scripts, i'm willing to learn but i don't even know what computer language it uses....

So if you have any info that could help me out please don't hesitate to write it down asap! thanks
-Carrottop

edited on Feb. 16, 2009 09:19 pm by Carrottop
Share |
Pedro699
General Member
Since: Jun 19, 2006
Posts: 781
Last: Dec 18, 2010
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Tuesday, Feb. 17, 2009 08:18 am
I can't see anything wrong with that script.

Have you created the trigger and elevator entities in radiant correctly and given them the correct targetnames?
Share |
ChusGMh
General Member
Since: Oct 7, 2008
Posts: 65
Last: Oct 4, 2010
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Tuesday, Feb. 17, 2009 01:44 pm
Hmm first i've gave u that script second u wont create ur own if ur new do what i'm doing im new-med and i know all the scripts but i hardly ever make my own script so you must take/steal/search new scripts like i was doing :P and if u made all the things good on ur map in ur main/maps/mp/mp_Yourmapname.gsc u must add this line
maps\mp\mp_elevator::main();

And now ur gsc will be like this:

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

This little script is in ur mp_yourmapname.gsc and now the elevator script saved as mp_elevator.gsc u just must place it at the main/maps/mp if u need a best tutorial add my xfire

optopus1


and i will explain u better the script is all right but i'm sure u dont load it to ur map so do what i told u [thumbs_up]

edited on Feb. 17, 2009 08:46 am by arthasisgod
Share |
DadofAzz
General Member
Since: May 24, 2005
Posts: 1233
Last: Oct 17, 2009
[view latest posts]
Level 8
MODSCON
Category: CoD2 Scripting
Posted: Tuesday, Feb. 17, 2009 02:17 pm
Why a damage trigger?

Surely it should be a trigger miltiple or trigger use
To make your elevator wait 5 secs change the wait to 5


Study this excellent tutorial on moving brushes made by Stryder for COD but will give you much insight into scripting.

http://www.modsonline.com/Tutorials-read-121.html

Greets doa


edited on Feb. 17, 2009 09:18 am by DadofAzz

edited on Feb. 17, 2009 09:19 am by DadofAzz
Share |
DadofAzz
General Member
Since: May 24, 2005
Posts: 1233
Last: Oct 17, 2009
[view latest posts]
Level 8
MODSCON
Category: CoD2 Scripting
Posted: Tuesday, Feb. 17, 2009 02:22 pm
Also just noticed, having the -250 first the elevator might go down rather than up.
Share |
Carrottop
General Member
Since: Feb 10, 2009
Posts: 14
Last: Feb 20, 2009
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Tuesday, Feb. 17, 2009 11:19 pm
Thanks a ton everyone!
this has been a big help, but i'm not sure if it really helped my elevator situation. It more helped my understanding of scripts and stuff.
About the damage trigger thing, it's kinda hard to explain but in the end it is pretty cool
All the things in radiant are perfect [biggrin]
but i don't know about the script part. I'm about 99% positive that the scripting part is correct; I've checked and double checked, like, everything! so i guess i'll try it again cuz i made a few ajustments to the map. So, wish me luck [thumbs_up]
Share |
Carrottop
General Member
Since: Feb 10, 2009
Posts: 14
Last: Feb 20, 2009
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Wednesday, Feb. 18, 2009 01:18 am
alright, this time i tried it and made the trigger a use_touch and it still didn't work!!! I don't get it!!

I made the brush targetname/elevator
and the trigger targetname/trig_elevator
what more does it want?!?! [banghead]

sorry if i sound annoying, it's just that's it's a little frustrating....

hopefully someone can help (not that you guyz haven't helped)

-Carrottop
Share |
Bloodlust
General Member
Since: Apr 7, 2004
Posts: 101
Last: Jan 14, 2015
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Wednesday, Feb. 18, 2009 03:31 am
look in the Call of Duty: World at War mod tools and find the elevator script I wrote for the game. you can use that script in any version of Call of Duty and it should cover just about anything you could possibly want to do with an elevator.

[smokin]
Share |
tHMatt
General Member
Since: Sep 11, 2007
Posts: 473
Last: Mar 20, 2013
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Wednesday, Feb. 18, 2009 10:23 am
are you sure your actually changing your gsc to a gsc?, because it might still be a txt file, make sure in windows that you have Hide Unkown Extensions off.
Share |
Pedro699
General Member
Since: Jun 19, 2006
Posts: 781
Last: Dec 18, 2010
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Wednesday, Feb. 18, 2009 02:49 pm
At times like these I always get my iprintln out to do some debugging.

I think the issue is either

a) You haven't created the entities in radiant properly

or

b) The script isn't being loaded.

I've modified your code slightly and instead of moving any elevator stuff it just prints a line out every three seconds to show that the code is being run.

It also checks to see if the elevator and trig entities actually exist.

Code:
main()
{
   thread elevator();
}

elevator()
{
   elevator=getent("elevator","targetname");
   trig=getent("trig_elevator","targetname");
   
   while(1) // this is just a test loop
   {
      iprintln("^3Elevator Script Looping");
   
      if(!isdefined(elevator)) iprintln("^1Elevator Not defined - check radiant!");
   
      if(!isdefined(trig)) iprintln("^1trig Not defined - check radiant!");
   
      wait 3;
   }
   
//   while(1) // these forward slashes stop the game reading these lines of code
//   {
//      trig waittill ("trigger");
//      elevator movez (-250,7,1.9,1.9);
//      elevator waittill ("movedone");
//      wait(1);
//      elevator movez (250,7,1.9,5);
//      elevator waittill ("movedone");
//   }

} 


You can also try enabling developer mode (/developer 1) before loading your map as this will often pick up undefined entities.
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 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

»