Jump to content
Sign in to follow this  
xg0ffx

How to make a bridge invincible

Recommended Posts

Hello, ive been working on a multiplayer ctf map for some friends. The map envloves an area with bridges but i want the bridges to be indestructable so that the route to the flag wont be too large. Ive been making a game logic and using the following in the init:

(position Bridge1_1 nearestObject 161744) setDammage 0

Im just sort of getting started in making missions but from what i have read this should either put the bridge at full health or repair but for some reason the bridge can still be destroyed and never returns.

thanks in advance

Share this post


Link to post
Share on other sites

Hmm,

well i'm not sure if you have thought about this, but putting that in the init line will only "repair" your bridge at the beginning of your mission. What you want is to have a loop running that sets the dammage of the bridge to zero constantly.

The issue with this is though, that if the bridge gets "1-Hit-Destroyed" by a strong bomb or multiple charges then the loop might not prevent the bridge from actually being destroyed. That you need to test for yourself.

In case you don't know how to loop that:

SQS:

#loop

(position Bridge1_1 nearestObject 161744) setDammage 0

~0.001

goto "loop"

SQF:

for [{_loop=0}, {_loop<1}, {_loop=_loop}] do

{

(position Bridge1_1 nearestObject 161744) setDammage 0;

sleep 0.001;

};

Share this post


Link to post
Share on other sites

Thanks for the responses but im still a little confused, could you please explain a little bit more on how i use the getdammage with the trigger? banghead.gif thanks again ^^

Share this post


Link to post
Share on other sites

I still haven't tested this but try

in the condintion:

Quote[/b] ](nearestObject 161744 damage) > 0

in the activation: your code

Quote[/b] ](position Bridge1_1 nearestObject 161744) setDammage 0

I'm sure you can GROUP(F2) triggers to map objects so you could

drag a line from the trigger to the bridge ID and use THIS instead of nearestObject 161744.....might make it quicker if you need to do several bridges.

Share this post


Link to post
Share on other sites

well i put

Quote[/b] ](nearestObject 161744 damage) > 0
in the condition line and it came up giving me the error "missing )" im sure its somthing simple i should know how to do but i cant figure it out. I also tried linking the trigger with the bridge id's and although it does work for houses and buildings it wouldnt let me link them with the bridge id's. Thanks again for taking the time to answer my questions i really appreaciate it!

Share this post


Link to post
Share on other sites

You need to look up the usage of the commands in the wiki. The examples are just a guide.

As far as syntax goes, it's something like:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(damage (position ManuallyPlacedNearbyObjectX nearestObject 161744)) > 0

but nearestObject id has a 50m radius restriction.

Side Note: I absolutely cannot understand why the radius restriction exists nor why you need a position, when you know the exact Visitor ID.

(The restriction is fine for the other nearestObject command though).

Share this post


Link to post
Share on other sites

Finally got home to my PC....

I made a trigger: size 100 x100 , set to repeat, Anybody

and put this line in the activation:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(position trig1 nearestObject 441616) setDammage 0

so you can blow it up but if anybody gets within 100 meters than it will self repair.

I tested this on the large bridge at Pesadas (map ref:Fi 25) and the furthest part to the east (part#441602) can not be repaired for some reason....had me stuffed for age's until I tested the west side.....must be a map bug banghead.gif

Share this post


Link to post
Share on other sites

why dont you run this over the object id?...

you can querry it

i cant remeber the exact strings for it but it was something like

(objectID 4728283) exec "bla.sqs"

cant remember really but ive seen it somewhere on the forums quite a while ago.

definatelly easier than to use nearest object :S

Share this post


Link to post
Share on other sites

It can be a lot safer to not assume that an objectID will stay the same over time. Your missions which use objectID's will break if there comes a new version of the island and objectID's have changed.

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  

×