Jump to content
Sign in to follow this  
sputnik monroe

Destroying the bridges on FDF east border

Recommended Posts

I'm making a FDF mission where you have to destroy two bridges. However I can't seem to get them to blow up. I've tried (object 1) setdamage 1 to try and destroy the bridge span farthest to the east on the bridge at grid Ea37 but nothing happens.

 Any advice?

*Edit* to clarify this is on east border winter

Share this post


Link to post
Share on other sites

Hmm... never tried destroying those bridges. But. Maybe they can't be destroyed? Did you try to read the damage value of the bridge after the destruction attempt?

Edit: It seems if you put the satchel charges on top of the bridge, they won't do anything to the bridge. But if you put the satchel charges to the support column under the bridge then the bridge section collapses. But still the damage value seems to stay at 0. It seems to require 3 satchel charges placed near the column to make the bridge section collapse.

When using (object 1) setdamage 1 the damage goes up to 1 but the bridge shows no sign of damages.

So the solution for your problem is to instruct players in the briefing to place 3 satchel charges under the bridge close to the support column... or let them figure it out by themselfs (and get frustrated in the process).

Share this post


Link to post
Share on other sites

Maybe it's the same problem as with summer East Border, the ID numbers are displayed incorrectly in the editor so you have to use nearestObject or nearestBuilding.

Share this post


Link to post
Share on other sites

*Making a mental note*- In sputnik's next mission place 3 satchels under the bridge's column wink_o.gif

Share this post


Link to post
Share on other sites
Maybe it's the same problem as with summer East Border, the ID numbers are displayed incorrectly in the editor so you have to use nearestObject or nearestBuilding.

I don't think that's the case...

I think you are talking about the problem that occurred when the East Border island was updated and all existing missions that relied on object ID's thus became broken. When the island was saved in a wpr editor program, the program saved the object ID's in a different order than in the previous time. Maybe the FDF Mod crew even deleted/added some objects which further ensures the object ID's won't stay the same. That is why the FDF Mod crew then instructed us to use other methods than using the object ID directly, to ensure the missions do not break if the island is updated.

I had a test session on the subject of this thread and at least the buildings I used to confirm that my script worked, did match the object ID number that was visible in the editor (I used object ID directly in a script to monitor the damage value).

And as I said, when using setDamage 1 on the specific bridge section and then using damage to check the damage value in the specific bridge section using the object ID directly, resulted in a value of 1 being returned from damage, when it in the start was 0 of course. <s>So that confirms that the object ID visible in the mission editor pointed to the correct object.</s>

Share this post


Link to post
Share on other sites

The problem is that there are so many objects in the islands that the object ID counter (apparently) rolls around and you have multiple objects with the same ID. So when you try to setdammage the bridge you're propably actually destroying a tree or something somewhere far away (You can confirm this by setpos'ing yourself next to the object and you'll see where the object id actually points to). Only way to counter it is, as metal heart said, to use the nearestobject command.

Share this post


Link to post
Share on other sites

Aha!

Thanks for the info Kegetys.

In this case the players are ordered to destroy the bridge. For marking the objective done when the bridge is destroyed the workaround is needed.

By the way I tried to blow the bridge section by placing the 3 satchel charges on a same spot on top of the bridge and that did nothing to the bridge. Maybe it could be destroyed from the top also by using even more satchel charges, but that is not feasible in a mission anymore.

And I think the object ID's will change if the island is updated, so that is a problem too (which has the same solution). In some wrp editor program this happens even if island is not modified, I don't remember which one it was.

Share this post


Link to post
Share on other sites
Quote[/b] ]Maybe it's the same problem as with summer East Border, the ID numbers are displayed incorrectly in the editor so you have to use nearestObject or nearestBuilding.

Could you give me an example?

Share this post


Link to post
Share on other sites

Sure. First you go hunting for the correct position with something like this:

onMapSingleClick{hint format["%1\n\n%2",nearestObject _pos,_pos]}

(note that you must use onMapSingleClick _after_ the mission has started or the fdfmod's mapclick handler will overwrite it)

When you find a pos that returns something such as:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">153513: most_stred30

[1234.56, 7890.12, -0.987653]

That's a bridge part, write down the position. Then, in the actual mission's init.sqs you store the bridge objects like this:

bridge1part1 = nearestObject [1234.56, 7890.12, -0.987653]

Then, to destroy them:

bridge1part1 setDammage 1.0

Share this post


Link to post
Share on other sites

Metal Heart, you seem to be a scripting guru, I bet you'll know the most sensible way for me to do this.

 Basically what I would like to do is make it where if any of the three sectiosn of the west bridge are destroyed it'll tick an objective off and if any section of the east bridge is destroyed it'll tick objective two off. How would you go about that?

 I was messing around with it for a while and got to thinking there has got to be a easier way than how I'm trying. Long of the short I keep trying to get the object id with the on map single click and hint example you gave. After that though the triggers and scripts I keep trying out usually result in error message. I'm betting I'm likely making things way more complicated than they should be as well.

 Do you think you could maybe give an example of how you would set that up?

Share this post


Link to post
Share on other sites

Did you get references for the objects? (variables pointing to the bridge parts) If not, set them with the method described earlier.

With them you can make a couple of triggers:

condition: {getDammage _x >= 1.0}count[wb1,wb2,wb3]>0

onAct: "1" objStatus "Done"

condition: {getDammage _x >= 1.0}count[eb1,eb2,eb3]>0

onAct: "2" objStatus "Done"

wb1 means west bridge part 1.

Share this post


Link to post
Share on other sites

Thanks Iron Heart that does the trick.

 One question though, how in the world did you figure out this mad gibberish code and what it would do?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">onMapSingleClick{hint format["%1\n\n%2",nearestObject _pos,_pos]}

"%1\n\n%2"  that especially is just non sensical to me and beyond deciphering.

Share this post


Link to post
Share on other sites

Format is a command that is used to format some data into strings, such as the variable _pos "inside" onMapSingleClick. The syntax for format is like this:

format ["Your name: %1\n\nPos: %2\n\nTime: %3", name player, getpos player, time]

or:

format ["text goes here. variable in place of this %1", variable]

The variables that follow the first array element (the string) will be placed in the place of %n codes in the string (%1 refers to the first var and so on), then this new string is returned. \n is a code for line change since you can't just press enter there smile_o.gif

It's all in the command reference but it can be quite confusing if you have no former programming or scripting experience because it's just a list of commands instead of a complete scripting manual.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×