Forum Jump :

Author Message


Posts: 24
Rank:


Level: Member

Country: se
Location:
Occupation: Soldier
Age: 26
In-game name: Bauerhousebourne

 
#1 Posted at 2016-07-04 21:20        
     
Hi!

I'm in the making of a multiplayer mission where four players are survivors and one player a "monster".
The "monster", named The Lurker, has a few abilities that I've made with scripts and they are executed by addAction.

These scripts works perfectly when I host a game and play as The Lurker. But when one of my fellow mates are playing, the script only runs once and doesnt repeat itself.

Example of a script:

trigman2 setPos (getPos tp2_1);
lurker switchMove "AwopPercMstpSgthWnonDnon_end";
lurker say "attack";
if (lurker distance man1 < 3) then { man1 SetDamage (damage man1 + 0.5);
 };
if (lurker distance man2 < 3) then { man2 SetDamage (damage man2 + 0.5);
 };
if (lurker distance man3 < 3) then { man3 SetDamage (damage man3 + 0.5);
 };
if (lurker distance man4 < 3) then { man4 SetDamage (damage man4 + 0.5);
 };
(lurker) removeAction attack;
sleep 1;
trigman2 setPos (getPos tp2_2);

In order to add some balance. I had to make sure the addaction couldn't be executed all the time so I (because I'm not good at scripting, this was my only solution.) created a unit (trigman2) who's teleporting in and out of a trigger area. When trigman2 is teleporting back, the addaction is once more available for The Lurker, making it possible to use "attack!" again.

As I said. Whenever I play, it works flawless. But not when someone else is playing. Same goes for hideObjectGlobal. It works for me but not for the other players.

Any help is much appreciated! :)

It's only funny until someone gets hurt, then it's hilarious!

Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 57
In-game name: Kobayashi Maru

 
#2 Posted at 2016-07-05 08:47        
     
You should try to attach a trigger to your "monster", repeatable, instead of checking distance.
See this command.
And you can "rearm it" (repeatable). Your if then condition can work once (when the script is read). It's not a loop.

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Advertisement


Author Message


Posts: 24
Rank:


Level: Member

Country: se
Location:
Occupation: Soldier
Age: 26
In-game name: Bauerhousebourne

 
#3 Posted at 2016-07-05 17:55        
     
I'll try that, thank you! :)

It's only funny until someone gets hurt, then it's hilarious!