Drop a bomb!

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
kickR
Private
Posts: 3
Joined: Fri Apr 25, 2003 9:59 pm

Drop a bomb!

Post by kickR »

Hello boys and girls!

I am working on my mod (for MoH:aa, not SH) Medal of Honor: Objective Evolution right now and need some help. I am a poor man so i cant pay you but i cant gie you some looove
My problem is that in my mod i have insted of the rocket luncher a hand model that holds in a bomb. When you hold down the fire button the model starts to move, the hands is setting up the bomb. If you drop the fire weapon within 5 seconds the model stops. So you must hold in the fire button in 5 seconds then the bomb will drop. You cant move when you are planting the bomb.
To the big problem now is that on my beta mod map i have choosed 2 bomb areas, where you can plant the bomb. You dont have to plant it in a selected spot, its more like plant it where you want in the room. So now i need a script on the map that are like this:
In this selected area when i am holding down the firebutton of the "rocket luncher" in 5 seconds a bomb will be droped and planted. Then its just like in the objective gametype, the axis can after that defuse.
Someone that knows how this can be done and wants to help me i would be more than greatful.

Please help me make this mod come true, it will be taking Medal of Honor to a more professional game with a lot more tactics.

Cheers
- - - - - - - -
kickR
kickr@hotmail.com
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

when you say u want the bomb 2 b abe 2 b dropped with out actually diesignating a position is impossible, the script only sets and resets bomb threads from where they are placed
hope this helps, prob not cos it's all foreign 2 me :-/
kickR
Private
Posts: 3
Joined: Fri Apr 25, 2003 9:59 pm

Post by kickR »

i have replaced the Allied rocketluncher with a bomb model.. so the script must be that you can only plant the bomb if you have the weaponclass RL...
- - - - - - - -
kickR
kickr@hotmail.com
nihilo
Sergeant Major
Posts: 107
Joined: Thu Mar 13, 2003 6:07 am

Post by nihilo »

a rather brute force solution to this would be to make in your map a really large number of bomb script objects all over the bomb setting area so that wherever the player sets the bomb you could activate the bomb object nearest that, but then you could probably set each one of those bombs in the area (making quite a lot of havoc)... don't think that's what you are really looking for.
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Re: Drop a bomb!

Post by mohaa_rox »

kickR wrote:Hello boys and girls!
Are there girls? :?
Live to map, not map to live.
-mohaa_rox, .map
moderator
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Well it might be possible, although I'm not sure of the use of it and am afraid of bugs to come.

However it's not all that difficult to spawn a bomb model on a wall in front of the player. Let's say you want to allow a player to plant a bomb within 64 units from a wall, then just spawn a temporary script_origin about 96 units in front of the player, about 64 units above the player's origin (~ hands level). Then use the trace command to find if there's a wall in between the player and this origin.

e.g., if self = player:

Code: Select all

local.temp = spawn script_origin
local.temp.origin = self.origin + self.forwardvector * 96 + (0 0 64)
local.collision = trace (self.origin + (0 0 64)) local.temp 0
if(vector_within local.collision self.origin 64)
    // spawn bomb model
    spawn models/mybomb.tik
This is just a small example, the final script would be much more complicated.

Well maybe it's better just to stick to the red pulse model kind of bomb :?
Image
Post Reply