Home   Help Search Login Register  

Author Topic: Oil pumps  (Read 4025 times)

0 Members and 1 Guest are viewing this topic.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Oil pumps
« on: 20 Mar 2007, 09:12:10 »
In Sahrani there are nice oil pumps near Cayo. I have a few question to the community about this cuties:

1., How can I animate it?
Now, if you watch the oil pump at the begining of mission, it start pumping but in the next second it stop. How can I made a WORKING oil field?

2., How can I burn it?
How can I - the mission editor - burn this oil pump and show to the player a destroyed, apocalyptic oil filed (like in movie: Jarheads).

3., How can the player destory it?
I want make a mission: the player is a saboteur and he has to destroy/burn the oil pump...
Fix bayonet!

Offline Cheetah

  • Former Staff
  • ****
Re: Oil pumps
« Reply #1 on: 20 Mar 2007, 18:49:45 »
I'm still working on trying to get the animation. But as far as the destruction of it, well I can say that so far it's indestructable.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Oil pumps
« Reply #2 on: 21 Mar 2007, 08:22:22 »
I read somewhere, we can insert a bus(!!!) under the oil pump and destroy the bus... It seems like the pump burned. But is't a hack and not the solution. There was a BIS movie (before ArmA released) oil pumps flamed...

In my mission the player is a civilian saboteur (or terrorist if you think) and has to burn oil pumps...
Maybe we can use an eventHandler[hit] to the oilpump and the player must detonate a satchel and the a script burn the bus under the pump...?
Fix bayonet!

Offline Cheetah

  • Former Staff
  • ****
Re: Oil pumps
« Reply #3 on: 21 Mar 2007, 08:36:24 »
Well, setDammage 10000 on the oil derrick doesn't work so the effect has to be a fake one, or BIS knows the only way to do it. Tricking the effect should be possible, just create a loud big explosion and create the fire particles yourself or put a bus under the oil derrick. I'd opt for the 1st choice, you can create a very loud and large explosion as well as a big inferno.

EDIT: I saw a particle dialog on arma.info or somewhere. With it you can use the dialog to create any particle you want. Might be useful to create the inferno. Mandoble seems to be good with the particles, so if it doesn't work I'm sure that he can help you.

As for the derrick taking damage, it doesn't as far as I know (tested with numerous satchels, Vulcan, GBU etc..) so you'd have to put a barrel or something next to it and check if that has been blown to pieces. If so, activate the special effects. Make sure that the player has to use satchels and can't just shoot at the barrel. Or position it so that the barrel doesn't catch any attention (you might want to use another object).
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline sharkattack

  • Former Staff
  • ****
Re: Oil pumps
« Reply #4 on: 21 Mar 2007, 13:50:09 »
im sure i read that oil pumps can not be damaged at all ..
and im also sure that the animation cycle open happens once
derrik will turn but only one time before stopping
"HOLY SARDINE" - see Shark-Attack meet his match

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Oil pumps
« Reply #5 on: 26 Mar 2007, 10:14:38 »
I tried something at the weekend. I apply a burning building script to the oil pumps and it was nice. I will rewrite this script for more flame and more smoke, but it will be OK.

But I tried to aplly an eventHandler "hit" and "dammage" for the oil pumps and nothing... :( These handlers never triggered.
So I feel I must add a nem action ("place IED") to the action menu if the player are close to the oil pump. And it will triggered the flame script. Satcher are useless here... :((
Fix bayonet!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Oil pumps
« Reply #6 on: 26 Mar 2007, 11:27:01 »
May be you dont need any player action.

You may try:
Code: [Select]
_numbombs = 0;
_bombs = [];
while {count _bombs == 0} do
{
   Sleep(2);
   _bombs = nearestObjects [getMarkerPos "mk_oilfield", ["PipeBomb","TimeBomb"], 100];
   _numbombs = count _bombs;
};
// At least a bomb has been detected closer than 100m from marker

// Now we check for number of detected bombs decreasing (suposedly due detonation)
while {count _bombs => _numbombs} do
{
   Sleep(0.5);
   _bombs = nearestObjects [getMarkerPos "mk_oilfield", ["PipeBomb","TimeBomb"], 100];
};

// Add your fire/smoke script here


Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Oil pumps
« Reply #7 on: 27 Mar 2007, 18:17:31 »
If you are willing to use an addon, then an Invisible Target from Mapfact's Map_Misc addon should work.  They can only be destroyed by nearby explosions.   There is much great stuff in this addon pack (lights that can be shot out, smoke grenades that block ai view, working radio that goes in unit's inventory, burning vehicles will burn units if they get too close, etc).  Check it out, if you haven't already.

http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?s=84a1bb50b4f0abda33a1b1e6e9d5668a;act=ST;f=70;t=58052;hl=map_misc

The invisible targets would work great for your Target Range intro mission in Perpetua by the way...
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Oil pumps
« Reply #8 on: 29 Mar 2007, 23:07:37 »
With the following simple script, you can simulate a damaged oil pump, by lowering its elevation and tilting it to one side.

I believe you can only do this with oil pumps you place via the editor.  The static pumps built into the map show no object IDs when you turn on Object IDs in editor, so I don't know how to get at them.

Code: [Select]
; *****************************************************
; ** ARMA script to damage and burn an editor placed oil pump.
; ** by Johnnyboy
; *****************************************************
; [pump] exec "burn_oil_pump.sqs"
;
; Simple script to simulate destruction of oil pump.  It places a burning
; fuel truck under the pump, and sinks the pump in the ground, and leans it
; over at an angle.
;
_pump = _this select 0;

; Create a fuel truck, place it under oil pump, and burn it.  You can replace this with
; whatever your favorite fire/smoke script may be.
_fuel = "Truck5tRefuel" createVehicle [0,0,0];
~.2
_fuel setpos (_pump modelToWorld [0,-2,-6]);
_fuel setdammage 1;
~1.4

; *****************************************************
; Sink the pump 5 meters down, and tilt it an angle
_pump setpos (_pump modelToWorld [0,0,-5]);
_pump setVectorUp [.7, .5, .8];
exit;

One weakness of this script is that the tilting of the pump is immediate.  It would be better animated with a loop to increment the tilt angle slowly, so player could watch it fall over.  I attempted that by starting with a vector value of [0,0,0] and incrementing 20 times using an increment value of 1/20th of my desired end values [.7,.5,.8].  But this did not work.  The first increment tipped the pump all the way to end angle.  I don't completely understand the math behind the setVectorUp command.  I now think it is a ratio of values, so that [.7/20, .5/20, .8/20] gives the equivalent result of [.7, .5, .8].

I'm giving up on that for now...other projects to pursue.


El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline Cheetah

  • Former Staff
  • ****
Re: Oil pumps
« Reply #9 on: 29 Mar 2007, 23:25:21 »
Looks good johnnyboy, the vector stuff isn't working because the direction of your vector is changed in the wrong way. There is a thread about the command by Mandoble and the vector commands still need some research. Anyway, you can get the object ID of the ones default on Sahrani, the problem is that they are indestructable and probably not movable. An option is to place an editor oil derrick and let the player destroy that one bardosy?

Or maybe you got your own script to work, I suggest uploading these scripts to the forum so that they can be added to the scripts section of the editors depot in the (near) future when the depots are ready (both scripts, so bardosy and johnny's).
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Oil pumps
« Reply #10 on: 30 Mar 2007, 07:38:47 »
@Mandoble:

I tried your sqf to detect the satcher detonation, but it doesn't work...
(there was some syntax error, but it's OK, I could fix it) But the script run into the first loop and never leave it.

Code: [Select]
while {count _bombs == 0} do
{
   Sleep(2);
   _bombs = nearestObjects [getMarkerPos "mk_oilfield", ["PipeBomb","TimeBomb"], 100];
   _numbombs = count _bombs;
   Hint "loop";
};

I tried rewrite the getMarkerPos "mk_oilfield" to the object _oil1, because BIKI write about nearestObjects it could parameter with position OR object... But nothing.
I read in the BIKI, the second parameter is a CLASS, like "car" or "tank". Are you sure "PipeBomb" is a class???

In the mission I put a satchel very close (1m) from the oilpump, but always hinted as "loop" and never left it... :(

Any idea?
Fix bayonet!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Oil pumps
« Reply #11 on: 30 Mar 2007, 11:45:41 »
I read in the BIKI, the second parameter is a CLASS, like "car" or "tank". Are you sure "PipeBomb" is a class???

In fact I have no idea at all about which is the real class of an active Pipebomb, you may look for it.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Oil pumps
« Reply #12 on: 30 Mar 2007, 12:32:08 »
The ClassName is the PipeBomb.

But there is no such ClassName: car or tank.... this is a general name, a collection of lots of ClassName, like "M1A1", "T72".... etc.
I think there is a higher structure/level for M1A1, T-72 and this is the "tank". And there is a higher level for helicopters and planes and this is the "air"...
I'm not sure, but maybe there is a higher level for PipeBomb... ???

But nothing fit to this nearestObjects.... :(
Fix bayonet!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Oil pumps
« Reply #13 on: 30 Mar 2007, 13:57:42 »
For nearestObjects you dont need any higher class name. You should be able to use individual class names, but, probably, when the pipebomb is left on the ground, the class name of the object (the real 3D object) changes.

You may use nearObjects also to find out the class name:


Create a radio trigger for radio Alpha and put the following line into its activation field.

Code: [Select]
text1="";{text1 = text1 + format["TYPE:%1 ", typeOf _x]} forEach (getPos player nearObjects 2);hint text1
Then just start your mission and plant a bomb in a clear area. Keep (the player) within 2m from the bomb and activate your radio trigger. The classname of the bomb and your unit class will be shown by the hint.

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Oil pumps
« Reply #14 on: 01 Apr 2007, 01:00:21 »
@Cheetah:  I took your advice and added my Destroy Oil Pump script to the Editing/Scripting Resources Beta Testing thread.

http://www.ofpec.com/forum/index.php?topic=29071.msg197973#msg197973

It's working pretty clean now, and will leave oil pumps looking destroyed (sunk in the ground, leaning over at different angles, with fire burnig).  It requires one addon (EditorUpdate_v102), which is where the editor placed Oil Pumps are found.
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Oil pumps
« Reply #15 on: 01 Apr 2007, 06:55:51 »
@Mandoble && bardosy
Guys, you are going way too complicated routes here  :no:

Use the fired eventHandler:
Code: [Select]
this addEventHandler ["fired",{(nearestObject [_this select 0,_this select 4]) execVM "detonated.sqf"}]
detonated.sqf
Code: [Select]
waitUntil {isNull _this};
sleep 1;
hint "bob's yer unca, insert code here";
The hint is there so that you can test this..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Oil pumps
« Reply #16 on: 03 Apr 2007, 07:59:00 »
@-h

I don't understand this code, but I want.
1. Who needs this eventHandler? I guess to the player, aren't he?
2. How do you know, the player fired by a satchel? What will happen, if he fired with a pistol?
3. You gave 2 parametersd to detonated.sqf, but check only one or both in waitUntil {isNull _this};
4. This waitUntil check the detonation?
Fix bayonet!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Oil pumps
« Reply #17 on: 03 Apr 2007, 08:57:27 »
Urp, I'm quite bad at explaining things, but I'll try..

1.
Yes, the player.

2.
Of course the code was just an example, indeed you need a check to see whether it was satchel that was 'fired'..
If you did not have such an check you could have awful lot of detonate.sqf scripts running after a firefight..

There's two ways to do that.
First, just to remind that the fired eventHandler 'releases' an array of variables into it's scope which can then be used either 'within' the eventHandler or in the script it executes.
The variables are: [unit, weapon, muzzle, firing mode, ammo]

Letting the eventHandler execute the script only when a certain weapon is used. In this case the weapon is Put
Code: [Select]
this addEventHandler ["fired",{if (_this select 1 == "Put") then {(nearestObject [_this select 0,_this select 4]) execVM "detonated.sqf"}}]
But if the player has access to mines, putting a mine would also execute the script as it is 'fired' by the Put weapon.
Letting the EventHandler execute the script only when a certain ammo is used, in this case the ammo is PipeBomb
Code: [Select]
this addEventHandler ["fired",{if (_this select 4 == "PipeBomb") then {(nearestObject [_this select 0,_this select 4]) execVM "detonated.sqf"}}]
3.
Look at the code more carefully.

In this particular case the usage of the command nearestObject returns the nearest object to the player, of PipeBomb type.
The two parameters there are from the array the eventHandler creates, _this select 0 is the unit and _this select 4 is the ammo used. The ammo used is named the same as the object class so it can be used to detect the satchel.

When I use (nearestObject [_this select 0,_this select 4]) what is passed to the script is pipebomb object which is then referred to in the script with _this.
So, actually when the nearestObject search has returned the object, the script is executed and basicly would look something like this if done 'manually'
Code: [Select]
pipebombobject execVM "detonated.sqf"
4.
Yes.
waitUntil is a boolean check, it's basicly the same as @ in sqs but it allows much more complex checks, you can have like pages of code in it.. And afaik it doesn't loop as fast as the @ check..
What it does it waits until a condition becomes true before it let's the script go any further.

So in this case the waitUntil waits until the pipebomb object becomes null before letting the script run any further.
And of course the object becomes null when it disappears, which happens when the satchel is detonated.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Oil pumps
« Reply #18 on: 03 Apr 2007, 09:26:48 »
Thanks h-, it was a nice and clear explain!
Fix bayonet!