Page 1 of 2

help with my complex objective

Posted: Fri Mar 21, 2003 5:09 pm
by solar
Hello, this is my first post in this forum and most assuredly not the last. I've been building an obj map for the past couple months and I'm to the point where I'm trying to finish the complicated stuff. This is my first attempt at mapping so I'm quite the novice when it comes to complex functions and scripting. Below is a couple pics that will give you a better idea of what I would like to accomplish:

Image

This is a pic of the test cell control room. Through the window you can see the test stand with the engine on it. Here's a better look:

Image

Here's what I would like to accomplish with this:

1. The control lever I've marked will activate the prop on the test stand. Now I've read the tut on a scripted ceiling fan and can apply that to the prop, but I need more. I would like the prop to progressively rotate faster and I would like the lever to animate forward and backward. I also need a sound to accompany the engine when activated.

2. If the test stand is activated, anyone entering the test cell itself will take fatal damage.

3. The objective I hope to set up will be to set an explosive on the test stand. But that can only be done when it is not running. The lever needs to both activate and deactivate the engine.

4. If the explosive is set and someone activates the test stand while the clock is ticking, I need it to stop once the explosive goes off. Please let me know if there are any other problems that may oocur when I set up the scripted exploder.

That's all I can think of now but if you need anymore information, please let me know. Thx

Posted: Fri Mar 21, 2003 5:24 pm
by Yarik
Well I can help you with a few things First off to make it spin faster here
where is says this in the scrip

Code: Select all

   $fan1 rotatey 325 
make the 325 (or try to make it a higher nuber) like 600.
To make it have a sound you have to add this

Code: Select all

playsound "sound/whatever/whatever.wav" 
BUT YOU NEED TO READ JV_MAPS TUTORIAL on this.
ubersound work-around or edit the ubersound itself
Get that at the tutorial page its pretty complex.
For the switch there are multiple switches like
check this site out
http://www.modtheater.com/view.php?page=44
But that tells you about a light switch. You can use the switch there to make your engine work.

AND read this
/forum/viewtopic.php?t=2155&highlight=switch

To set something up to blow it up check this TUT out
http://members.chello.se/bjarne.gronnev ... orial.html

That should help. :roll:

Posted: Fri Mar 21, 2003 5:25 pm
by jv_map
  1. Could you post that rotation code? Then I / we could show you where to make modifications so that it accellerates. Sounds are very tricky / buggy on multiplayer servers :cry:, unless the sound you're planning use has an alias already 8).
  2. You could use a volumedamage trigger for this. Make sure to read Pantera's tutorial on this subject.
  3. Probably you can achieve this by either enabling or disabling the bomb plant trigger. However, when a player has started attaching a bomb he will be able to finish planting it. Is this a problem?
  4. You can easily trap the explosion event and set a variable that stops your engine from spinning 8).

Posted: Fri Mar 21, 2003 5:27 pm
by Yarik
One more thing. PLease use the search at the top of the page to look for intresting things before you post. This will cut back many of your questions. we answerd a lot of them so just use the search. :wink:

Posted: Fri Mar 21, 2003 5:27 pm
by jv_map
Note that any playsound commands should always refer to a sound alias instead of an actual file. My work-around tut works perfectly for adding custom aliases for single player and multiplayer non-dedicated servers, but just doesn't want to work for a dedicated. :(

Posted: Fri Mar 21, 2003 5:28 pm
by jv_map
And an official word of welcome to .map :idea: :D

Posted: Fri Mar 21, 2003 9:24 pm
by solar
Thx for the replies. I've scoured the posts on this site and others believe me, and they've helped me immensely. I will post the script code on the fan a bit later- I'm not able to do so right at this moment.

Concerning the lever switch, sure I could use one of the local animations, and I will if I have to, but is there a way to make a brush animate in the way I want it to? I've played a map, desert final I think, and there is a door trigger in there that looks like a square black button. It depresses when activated. Can I apply that principle to my lever?

What's a sound alias? Is that a local file?

jv_map, I'm not sure I understand you on point 3. If a player begins setting the bomb and someone goes into the control room and activates the test stand, it will kill him. The reason I say it can only be done while the stand is not running is because if it's running and he's in there, he'll be killed. It assumes that someone has started the test stand and in order to set the explosive, it has to first be turned off. Let me know if you need more clarification on this.

Posted: Sat Mar 22, 2003 6:51 am
by jv_map
solar wrote:What's a sound alias? Is that a local file?
Na it's a name for the sound. Maybe read my ubersound work-around tut.
solar wrote: jv_map, I'm not sure I understand you on point 3. If a player begins setting the bomb and someone goes into the control room and activates the test stand, it will kill him. The reason I say it can only be done while the stand is not running is because if it's running and he's in there, he'll be killed. It assumes that someone has started the test stand and in order to set the explosive, it has to first be turned off. Let me know if you need more clarification on this.
Forgot something :oops:

Posted: Sat Mar 22, 2003 11:13 am
by Shifty
Theres Some Nice Ideas there but I will say 1 thing the textures on the wall and floors look a bit funky so I would scale them down by about .5 maybe

Posted: Sat Mar 22, 2003 8:18 pm
by solar
ok jv_map, here's my propellor script:

level waittill spawn
//------------------------
//test stand prop rotation
//------------------------

thread propshaft
end

propshaft:
$blade1 bind $propshaft
$blade2 bind $propshaft
$blade3 bind $propshaft
$blade4 bind $propshaft
$propshaft rotatez 325
end
As it stands, the prop doesn't rotate at all and I can't figure out why. I've doublechecked all my spellings and everything seems in order. What do you think?

Posted: Sun Mar 23, 2003 3:09 am
by nuggets
level waittill spawn
//------------------------
//test stand prop rotation
//------------------------

thread propshaft
end

propshaft:
$blade1 bind $propshaft
$blade2 bind $propshaft
$blade3 bind $propshaft
$blade4 bind $propshaft
//$propshaft rotatez 325 //you will need to change this to rotateZup or rotateZdown
$propshaft rotateZup 325
$propshaft speed ** // change the ** for a number you want the propshaft to rotate at
$propshaft move //always needed after setting parameters to tell the object to perform its duty
end

:D bob's your uncle

but... why bind the seperate $blade1 ...etc... you can just select it all and make it just 1 whole script object without using bind unless they have another job for them to perform elsewhere,

if so, then call them all the same targetname "$blade" and then you will only need to use the bind script once rather than for each blade :D

Posted: Mon Mar 24, 2003 12:42 pm
by bdbodger
another thing you might do is make an origin brush to rotate around . that is just a brush with the origin texture on it . I made a crane and of course I wanted to rotate at the bottom of the boom not in the middle . I did this for a ceiling fan too . I made all parts one script object and when it rotates it rotates around the origin like a rotateing door does .

Posted: Mon Mar 24, 2003 1:30 pm
by bdbodger
I should clarify the boom is one script object the cab another the wire and the load another I rotate the boom up at the same time I rotate the wire and load down the same amount keeping the load level I rotate at the origin brush . I bind the load to the boom , the boom to the crane so when I rotate the crane the other parts move with it . You can use this for the lever too . Make a leaver with a small origin brush at the base . Make the brushes a script object . then it depends on what way you want to rotate the lever . make a trigger_use around the lever and use something like this

main:
level.mylever =0 // start off
thread example
end
example:
my_trigger waittill trigger
if (level.mylever ==0) // off
{
level.mylever =1 // lever is moveing
$lever rotatexupto 35 // angle
$lever move
//////////// start your engine here //////////
$propshaft rotatez 325 // you can use this 325 being the speed
level.myleaver = 2
}
else
{
if (level.mylever ==2) // on
level.mylever =1 // lever is moveing
$lever rotatexdownto 0 // back to start
$lever move
///////////// stop your enginge here //////////
$propshaft rotatez 0
level.mylever = 0
}
goto example
end
depends on what way you want to rotate too you may need to rotatezupto or rotatexupto etc or downto what ever the case may be .

Posted: Tue Mar 25, 2003 1:39 am
by solar
let me get this straight bdbodger:
$lever rotatexupto 35
Will this, along with the origin brush at the base rotate the lever as a fulcrum? I want it to move, in essence, like an on the floor automatic in a car.

Posted: Tue Mar 25, 2003 1:41 am
by solar
nuggets wrote:
$propshaft rotateZup 325
$propshaft speed **
isn't the 325 the speed? Why do I need the second line?