Need help here. control problem

SaMmM

Member
Reaction score
4
In my map, sometimes a player loses his control over the unit that he is currently controlling and selected.

The player will need to deselect the unit and then select it again to regain control.

May i hear from you all what is the possibilities that are causing this issue for me.

Thank you very much in advance.
 

ZiggyMcjoney

Data editor?! AAAHHHHH!
Reaction score
95
When exactly does this problem occur? After the use of an ability or something, or is it literally just completely random?

If its the second option it may be a periodic trigger that does something, if its the first look at the ability or trigger that cause sit to happen.
 

SaMmM

Member
Reaction score
4
I think its this trigger that causes it, because it happens after someone types -hp.

count hp
Events
Player - Player 1 (Red) types a chat message containing -hp as An exact match
Player - Player 2 (Blue) types a chat message containing -hp as An exact match
Player - Player 3 (Teal) types a chat message containing -hp as An exact match
Player - Player 4 (Purple) types a chat message containing -hp as An exact match
Player - Player 5 (Yellow) types a chat message containing -hp as An exact match
Player - Player 6 (Orange) types a chat message containing -hp as An exact match
Player - Player 7 (Green) types a chat message containing -hp as An exact match
Player - Player 8 (Pink) types a chat message containing -hp as An exact match
Player - Player 9 (Gray) types a chat message containing -hp as An exact match
Player - Player 10 (Light Blue) types a chat message containing -hp as An exact match
Player - Player 11 (Dark Green) types a chat message containing -hp as An exact match
Player - Player 12 (Brown) types a chat message containing -hp as An exact match
Conditions
Actions
Set Group_StatsCounter = (Units currently selected by (Triggering player))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in Group_StatsCounter) Greater than or equal to 2
Then - Actions
Game - Display to (Player group((Triggering player))) for 4.00 seconds the text: --Please Select only one unit
Custom script: call DestroyGroup (udg_Group_StatsCounter)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in Group_StatsCounter) Equal to 0
Then - Actions
Game - Display to (Player group((Triggering player))) for 4.00 seconds the text: --Please Select a unit and try again
Custom script: call DestroyGroup (udg_Group_StatsCounter)
Else - Actions
Unit Group - Pick every unit in Group_StatsCounter and do (Actions)
Loop - Actions
Set REAL_STATS = (Life of (Picked unit))
Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: (The selected unit current hitpoints is + (String(REAL_STATS)))
Set REAL_STATS = 0.00
Custom script: call DestroyGroup (udg_Group_StatsCounter)
 

Nerfpl

New Member
Reaction score
53
you could really use WC3 tags. as for the trigger i dont see anything wrong. what you mean exactly by "lose control" describe behavior
 

SaMmM

Member
Reaction score
4
Below is an example of one of the cases that happens.
It happens every game whenever the stats checking commands are used.

For example:

Player Brown is a enemy of player Red. \\(I am not sure if it needs to be a enemy to happen)

Player Red is currently selecting Unit A, and Unit A belongs to Player Red.

Player Brown then selects Unit A and then types -hp.

Then sometimes, Player Red may lose control over Unit A.
Unit A still remains selected by Player Red.
However, Player Red cannot issue any movement or spells command to it.
Player Red has to UNCLICK and then RECLICK unit A to be able to control it again.

By the way, how do i use wc3 tags?
 

Nerfpl

New Member
Reaction score
53
for start try
Trigger:
  • Set Group_StatsCounter = (Units currently selected by (Triggering player))
    • Unit Group - Pick every unit in Group_StatsCounter and do (Actions)
      • Loop - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Owner of (Picked unit)) Not equal to (!=) (Triggering player)
          • Then - Actions
            • Unit Group - Remove (Picked unit) from TempGroup
            • Selection - Remove (Picked unit) from selection for (Triggering player)
          • Else - Actions

then rest of actions
 

SaMmM

Member
Reaction score
4
Thanks, i think it worked.

Will test a few more times and see if its really solved.
 

danpe

New Member
Reaction score
5
try to delete those from the script:

Code:
Custom script: call DestroyGroup (udg_Group_StatsCounter)

i really thinks it will solve the problam... even if it will be a little leak...
 

HydraRancher

Truth begins in lies
Reaction score
197
btw your custom script would fail, the function (destroy_group) is not next to the udg_Group_StatsCounter

>how do you use wc3 tags?
Trigger:
  • [/wc3 ](dont put any spaces)
 

HydraRancher

Truth begins in lies
Reaction score
197
>
Are you sure it will fail? emjlr3 teaches the same thing in this tutorial. http://www.thehelper.net/forums/show...highlight=leak
Any other ways to solve it? I dont wanna let it leak.

I'm not sure if I am correct but I think theres no space
anyway I am not sure whats causing your error, theres no change owner action in there. Are you sure theres no change owner action in any other trigger?
 

danpe

New Member
Reaction score
5
This small little tiny leak wont mind the game you know...
only if you type -hp 1000 times in a min...
 

HydraRancher

Truth begins in lies
Reaction score
197
This small little tiny leak wont mind the game you know...
only if you type -hp 1000 times in a min...

What do you mean? if you keep that attitude he/she wont be bothered EVER to remove leaks and he/she will have a laggy game. Its good to remove even the tiniest leaks to get in the habbit.
 

SaMmM

Member
Reaction score
4
danpe can you please explain to me why you think that it will solve the problem.

I want my map to be as leakless as possible. Because it sometimes plays up to 2 hours and the towers and other units make it quite laggy already.

Btw theres no change owner action in any other trigger.
 

danpe

New Member
Reaction score
5
it heppend to me too...

when i tried to play with selection kinde of what you did in that trigger and i removed my leaks it cused alot of selection bugs...
so i deleted the leaks removers and it worked well... try it out too..
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top