Home   Help Search Login Register  

Author Topic: Obj Complete when bridge destroyed  (Read 5166 times)

0 Members and 1 Guest are viewing this topic.

Offline Graywolf

  • Members
  • *
  • I'm a luni
Obj Complete when bridge destroyed
« on: 04 May 2007, 02:56:26 »
Hello

How can I link a trigger to a bridge
and have it activate objective complete once the bridge is destroyed

I searched the forum and found a couple simular questions
but
I'm still lost ... I have done it in ofp but I do not understand how to make it work in ArmA

Thank you in advance for your help

 ;)

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Obj Complete when bridge destroyed
« Reply #1 on: 04 May 2007, 13:44:26 »
1., Put a trigger and a GameLogic (named "bridgeGL") very near to the bridge.
2., Turn ON the Show ID button at right side of the editor.
3., Zoom in the map when you see the numbers on the bridge (about 2-3 numbers)
4., Write into the trigger's condition field:
Code: [Select]
(getDammage (bridgeGL nearestObject 123456) > 0.8) OR (getDammage (bridgeGL nearestObject 654321) > 0.8)

The numbers are the IDs of bridges. If your bridge are 3 ID number use an other 'OR'...

...and voila!

Insert anything into the on activation field (eg. "2" objStatus "DONE"), it will be triggered when bridge destroyed
Fix bayonet!

Offline LeeHunt

  • Former Staff
  • ****
  • John 21:25
Re: Obj Complete when bridge destroyed
« Reply #2 on: 04 May 2007, 20:19:58 »
Bardosy you bring up an interesting question about Object ID's-- is it possible to select the object ID itself or only to put a gamelogic near one and then use "nearestobject"?  I know in Operation Flashpoint you could move triggers or other things to an object ID, but i'm having trouble doing that in AA. Is that the best way?  Gracias


Offline Cheetah

  • Former Staff
  • ****
Re: Obj Complete when bridge destroyed
« Reply #3 on: 04 May 2007, 21:07:51 »
object ID can't be used in ArmA. As far as I known, bardosy's way is the way to go.

EDIT: whoops, copy/pasted too much of bardosy's text :). Should've added that 'object' is the command.
« Last Edit: 05 May 2007, 01:56:09 by Cheetah »
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Obj Complete when bridge destroyed
« Reply #4 on: 04 May 2007, 22:26:14 »
Cheetah, you're making no sense  :D

Bardosys's example uses the object ID (the number), it is the command 'object' that doesn't exist in ArmA..


Quote
is it possible to select the object ID itself or only to put a gamelogic near one and then use "nearestobject"?
You don't necessarily need gamelogics, you can use something like
Code: [Select]
damage ((position player) nearestObject 123456) > 0.8 || damage ((position player) nearestObject 654321) > 0.8
But as the command object is no more there is no other way to refer to a object ID than using nearestObject.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Graywolf

  • Members
  • *
  • I'm a luni
Re: Obj Complete when bridge destroyed
« Reply #5 on: 05 May 2007, 01:38:00 »
bardosy

Thank you very much
for the comprehensive explanation

 :good:

~S~




Offline Graywolf

  • Members
  • *
  • I'm a luni
Re: Obj Complete when bridge destroyed
« Reply #6 on: 05 May 2007, 17:33:40 »
When I tried bardosy's code

Quote
getDammage (bridgeGL nearestObject 123456) > 0.8) OR (getDammage (bridgeGL nearestObject 654321) > 0.8)

I get an Error   it does not work  :o

When I try " h's " code it worked  ;)

But the game seems to lag out real bad  :confused:

from what Ive read so far
I guess this does not work well in AA or is their a way around it
without causing a stutter fest

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Obj Complete when bridge destroyed
« Reply #7 on: 05 May 2007, 20:39:45 »
Please, do not double post.
If your post is last in a thread and you have something to add edit your post instead of replying to yourself.
Only after about 3 days has passed you can reply instead of editing..

Quote
But the game seems to lag out real bad
You mean during the execution of the code?

Were you so close to the bridge that you could see it?
In ArmA objects (among other things) do not exist until they are 'streamed up', this probably happens when the object reaches the viewdistance radius (but don't quote me on that  ::) ).
If the bridge was not visible ArmA streams up the object before it can be and that may cause FPS drop..

Can't test this myself because I'm in process of re-installing everything on my PC..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Carroll

  • Members
  • *
  • Mission Designer (MP-"well tryin to capiche"
Re: Obj Complete when bridge destroyed
« Reply #8 on: 16 May 2007, 11:14:05 »
Hi bardosy, i am hoping you can clarify some points for me about your trigger suggestions for this topic. I am new to ArmA & have not played OFP. However i have been creating my own ArmA missions & would like to use the Objective Complete trigger when destroying a bridge.
    Thing is i can't seem to get your suggested Trigger to work for me & have a couple of questions

~ Do i need to add anything to the start of the condition ?(getDammage etc.
~ I have tried using the trigger OnAct.   hint "Bridge Destroyed"   but it ain't showing up when i destroy ANY section of the bridge
~ In between each section of the condition line do i type OR or ||
~ I have placed the Game Logic Object as close to the bridge section ID as possible and set the Trigger to activate on Game Logic?

I'm not sure if i am looking in the right direction to rectify my problems, but if this makes any sense to you any help would be appreciated. The steps you provided in your first reply may seem easy for some to follow, but i guess would need a more detailed instruction to get this to work for me.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Obj Complete when bridge destroyed
« Reply #9 on: 16 May 2007, 11:33:18 »
@Caroll: In my first post of this topic there was a mistake. The correct line is this:

Code: [Select]
(getDammage (position bridgeGL nearestObject 123456) > 0.8) OR (getDammage (position bridgeGL nearestObject 654321) > 0.8)
The 'position' was forgetted in the first time... >:(

Quote
Do i need to add anything to the start of the condition ?(getDammage etc.
Nope! Forgot the question mark! It's need if you write a script, but in a trigger's condition field it casue an error message.
Quote
I have tried using the trigger OnAct.   hint "Bridge Destroyed"   but it ain't showing up when i destroy ANY section of the bridge
I hope, with this new code line, it will be working.
Quote
In between each section of the condition line do i type OR or ||
Maybe both, but I always use 'OR'... (it's working)
Quote
I have placed the Game Logic Object as close to the bridge section ID as possible and set the Trigger to activate on Game Logic?
Don't set the trigger activated by Game Logic! GL is need only for his position.
Are you named the Game Logic?
« Last Edit: 31 May 2007, 17:29:33 by Mr.Peanut »
Fix bayonet!

Offline Carroll

  • Members
  • *
  • Mission Designer (MP-"well tryin to capiche"
Re: Obj Complete when bridge destroyed
« Reply #10 on: 16 May 2007, 11:58:29 »
Thanks for replying so promtly bardosy. I've named the Game Logic Object as -   bridgeGL

& ive set the trigger activation to -   none

I've put this in the condition line -  (getDammage(positionbridgeGLnearestObject161790) > 0.8))

i tested it & still no trigger is being activated. OnAct. is  -  hint "Bridge Destroyed!!!".
 The trigger is set at 50 meters x 50 meters and encompasses the entire bridge, the Game Logic unit is right over the bridge section ID #, still no go?
« Last Edit: 16 May 2007, 12:10:50 by Carroll »

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Obj Complete when bridge destroyed
« Reply #11 on: 16 May 2007, 12:13:22 »
The dimension (50x50m) of the trigger is doesn't metter (I usually set it 0x0m) because the Condition filed is the IMPOTRANT.

I hope you used SPACE in the condition filed, because in your post there was no space. ;)

OK. I have no idea. Could you post two screenshot?
One of the map, the bridge (show the IDs), and the gameLogic and trigger position.
One other screen from the trigger form.
Could you?
Fix bayonet!

Offline Carroll

  • Members
  • *
  • Mission Designer (MP-"well tryin to capiche"
Re: Obj Complete when bridge destroyed
« Reply #12 on: 16 May 2007, 12:24:53 »
No need!! you got it with the SPACE, i put the spaces in & it worked fine Thankyou for your help hope i can repay the favour one day bardosy TY
« Last Edit: 16 May 2007, 12:26:34 by Carroll »

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Obj Complete when bridge destroyed
« Reply #13 on: 16 May 2007, 12:26:20 »
 :D
That's great!
It was a pleasure...  :cool2:
Fix bayonet!

Offline Carroll

  • Members
  • *
  • Mission Designer (MP-"well tryin to capiche"
Re: Obj Complete when bridge destroyed
« Reply #14 on: 31 May 2007, 17:23:47 »
One question for after the bridge is destroyed; how can i have the bridge destroyed at start of mission, so that when i start a mission the bridge is already destroyed. If i use a trigger activated by Blufor when the unit nears the bridge, he finds it destroyed?

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Obj Complete when bridge destroyed
« Reply #15 on: 31 May 2007, 17:27:47 »
setDamage 1 the bridge objects:
Code: [Select]
(position bridgeGL nearestObject 123456) setDamage 1
« Last Edit: 31 May 2007, 17:31:33 by Mr.Peanut »
urp!

Offline Carroll

  • Members
  • *
  • Mission Designer (MP-"well tryin to capiche"
Re: Obj Complete when bridge destroyed
« Reply #16 on: 31 May 2007, 17:54:00 »
Works great, thanks Mr.Peanut

Offline Jackal

  • Honoured Contributor
  • ***
  • Pinpoint Precision
    • TEAM ELITE FORCES
Re: Obj Complete when bridge destroyed
« Reply #17 on: 28 Nov 2008, 10:09:49 »
I'd like to say thanks as well. works great. thx to the efforts of all involved with this bit of scripting.
Prior Planning Prevents Piss Poor Performance