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] |
|
|
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 |
|
|
|
Pedro699 |
General Member Since: Jun 19, 2006 Posts: 781 Last: Dec 18, 2010 [view latest posts] |
|
|
|
ChusGMh |
General Member Since: Oct 7, 2008 Posts: 65 Last: Oct 4, 2010 [view latest posts] |
|
|
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
edited on Feb. 17, 2009 08:46 am by arthasisgod |
|
|
|
DadofAzz |
General Member Since: May 24, 2005 Posts: 1233 Last: Oct 17, 2009 [view latest posts] |
|
|
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 |
|
|
|
DadofAzz |
General Member Since: May 24, 2005 Posts: 1233 Last: Oct 17, 2009 [view latest posts] |
|
|
|
Carrottop |
General Member Since: Feb 10, 2009 Posts: 14 Last: Feb 20, 2009 [view latest posts] |
|
|
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
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 |
|
|
|
Carrottop |
General Member Since: Feb 10, 2009 Posts: 14 Last: Feb 20, 2009 [view latest posts] |
|
|
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?!?!
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 |
|
|
|
Bloodlust |
General Member Since: Apr 7, 2004 Posts: 101 Last: Jan 14, 2015 [view latest posts] |
|
|
|
tHMatt |
|
General Member Since: Sep 11, 2007 Posts: 473 Last: Mar 20, 2013 [view latest posts] |
|
|
|
Pedro699 |
General Member Since: Jun 19, 2006 Posts: 781 Last: Dec 18, 2010 [view latest posts] |
|
|
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. |
|
|
|