Jump to content
Sign in to follow this  
GiLaN

Freezing Server with an objective

Recommended Posts

Hello everybody.

I'm posting here because I got a problem on my first mission. Let's explain this: My mission is based on the destruction of two objectives : two lighthouses.

The second lighthouse must be destroyed in 15 seconds maximum after the destruction of the first lighthouse.

Thus, I've written a little script, which after 15 seconds, triggers ennemy's reinforcements.

The trouble is that when the first lighthouse is blown up, the server freezes for 10 seconds, and when we're back in the game, the reinforcements wave has started, and AI remains statics for about 25 seconds and then, the lag effect disappears and IA we had shot become dead in 1 second.

Here is the way I placed the triggers.

I got two game logic near each lighthouse, named des1 and des2

Then, I placed two triggers on every lighthouse with :

Trigger 1 => Lighthouse 1

Axis a : 50 , Axis b : 50

Activation : None

Type : None

Name : destruction1

Condition : not alive (position des1 nearestobject 53)

On act. : "1" objstatus "done"; Commandement Sidechat "blablabla"; this exec "Decompte.sqs"; obj1=true

and in effects:

getdammage ([50, 50, 50] nearestObject 53)=1

And for the second trigger :

Trigger 2 => Lighthouse 2

Axis a : 50 , Axis b : 50

Activation : None

Type : None

Name : destruction2

Condition : not alive (position des2 nearestobject 54)

On act. : "2 objstatus "done"; Commandement Sidechat "blablabla2"; obj2=true

and in effects:

getdammage ([50, 50, 50] nearestObject 54)=1

Then I got in my decompte.sqs :

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

?(getdammage (position des2 nearestobject 54) < 1):Goto "Renforts"

#Renforts

Commandement Sidechat "blablabla"

[renf1,renf_pos1] exec "Patrouille.sqs"

[renf2,renf_pos2] exec "Patrouille.sqs"

[renf3,renf_pos3] exec "Patrouille.sqs"

exit

and then in my "Patrouille.sqs":

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Groupe = _this select 0;

_Position = _this select 1

_Chef = Leader _Groupe

_Groupe setBehaviour "combat";_Groupe setCombatMode "red";_Groupe setspeedMode "full"

#Passage1

_Groupe move position _Position

~0.5

?!(unitReady _Chef): Goto "Passage1"

_AxeX = 500

_AxeY = 500

_Temps = 5

_Secu = ((_AxeX + _AxeY)*1.5)

_Xreal = getpos _Chef select 0

_Yreal = getpos _Chef select 1

#Scanage

~0.5

_Groupe set speedmode "normal"

_Chef = leader _Groupe

_time = 0

_X1 = random _AxeX

_X = _X1 - _AxeX/2 + _Xreal

_Y1 = random _AxeY

_Y = _Y1 - _AxeY/2 + _Yreal

?((_X == _Xverif) and (_Y == _Yverif)) :goto "Scanage"

_Groupe Move [_X, _Y]

_X = _Xverif

_Y = _Yverif

?((count units _Groupe) == 0):goto "Exit"

#Verification

~0.5

?(_time >= _Secu):goto "Scanage"

?!(unitReady _Chef): Goto "Verification"

~_Temps

Goto "Scanage"

#Exit

exit

Here is everything you should need to help me huh.gif

I don't think the problem comes from the scripts, because they're not so heavy for a server, but I think the problem comes from my triggers.

Thank you for helping me and sorry for my bad english wink_o.gif

Share this post


Link to post
Share on other sites

Okay, I solved the problem crazy_o.gif

Replaced the effects by true, and worked :/ confused_o.gif

Share this post


Link to post
Share on other sites

I don't quite understand why you have the getDammage test in the Effects window.

You already know that the object is dead, so why another test for damage level? You probably only need the command "true" in there.

And even if you actually wanted to do another test there, the syntax would be "...nearestObject 53)<span style='color:red'>==</span>1", but not "=1". The current syntax doesn't make any sense (as it's an assignment to a test), and might be what's confusing/slowing down ArmA.

Edit: Guess I was a bit too late with my answer... wink_o.gif

Share this post


Link to post
Share on other sites

Thank you KronzKy For your answer.

In fact, the value I had in the entry effects was for tests and didn't work well, but I had forgotten to delete it :/

Problem is solved, that works great now wink_o.gif

Thank you again ! rofl.gif

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  

×