Page 1 of 1

How to send a player to observers via triggering?

Posted: Sun Feb 01, 2009 8:36 pm
by Legit
Hey 3ICE do you how to do the trigger that sends a player to observers. Ive seen it in wc3 roc map called "Hero Wars Icelands 1.2aR"... the player has to type like -obs and his send to observers.. if you know how to.. can you show me how to make it?

Re: Trigger help

Posted: Mon Feb 02, 2009 4:25 am
by 3ICE
He is not sent to observers, he just loses his hero and gets to see the map.
Please stop using stupid topic titles. I changed it to "How to send a player to observers via triggering?".

Re: How to send a player to observers via triggering?

Posted: Mon Feb 02, 2009 7:01 pm
by Legit
Sorry about the topic tittles. Anyways if his not sent to observers then how is the player only able to talk in observers... i want to know how to do that trigger...

Re: How to send a player to observers via triggering?

Posted: Mon Feb 02, 2009 7:22 pm
by 3ICE
The function for assigning players to obs is: call SetPlayerState(Player(p),PLAYER_STATE_OBSERVER,1)
There is no GUI equivalent for this. (p is a number between 0 and 11, where 0=red, 1=blue, ..., and 11=brown.)

But link to the map on epicwar and I will deprotect it. We shall see, what we shall see. :)
EDIT: I found it: http://www.epicwar.com/maps/25217/
Here is the extracted function:

Code: Select all

function Qv takes nothing returns nothing
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(q[(1+GetPlayerId(GetTriggerPlayer()))]+" has become a referee to the game. He/she has vision of the whole map."))
call ForceRemovePlayer(O,GetTriggerPlayer())
call ForForce(O,function QL)
call ForForce(P,function Qm)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_GAME_RESULT,0)
call CreateFogModifierRectBJ(true,GetTriggerPlayer(),FOG_OF_WAR_VISIBLE,bj_mapInitialPlayableArea)
call GroupRemoveUnit(aP,R[(1+GetPlayerId(GetTriggerPlayer()))])
call ForForce(O,function QM)
call ForForce(O,function Qn)
call ForGroupBJ(fD(GetTriggerPlayer(),Condition(function QN)),function Qo)
call ForGroupBJ(fE(GetTriggerPlayer(),'n008'),function QO)
call RemoveUnit(aw[(1+GetPlayerId(GetTriggerPlayer()))])
set E=CountPlayersInForceBJ(O)
if(Qq())then
call ConditionalTriggerExecute(Dd)
endif
set F=(F+1)
if(QR())then
set F=(F+1)
endif
if(Qt())then
set F=(F+1)
endif
if(QU())then
set F=(F+3)
endif
endfunction
As you can see from line 6, they used t_pla Player - Set (Triggering player) Game result to 0, which is kinda weird. I can't believe it worked.

Re: How to send a player to observers via triggering?

Posted: Mon May 10, 2010 3:39 pm
by OrcSlayer101
Wow 3ice! Was it unprotected or did you de-protect it?


Note to asker...


An easier way to make the person observer would be destroy all their units and then give them visibility over the whole map
and also make them allies with all the players...

Its pretty simple but works! (i think :p)

Re: How to send a player to observers via triggering?

Posted: Wed May 12, 2010 4:52 pm
by 3ICE
OrcSlayer101 wrote:Wow 3ice! Was it unprotected or did you de-protect it?
Deprotected.
By the way unprotected and deprotected have the same meaning. (Strange, huh?) And unprotected makes no sense so most people use deprotected.
The proper way to ask your question is "Was it not protected".
Every sign of protection is on that piece of code. Mainly: Very short function and variable names with no meaning. Example:

Code: Select all

if(QR())then
set F=(F+1)
endif
QR() means nothing. F means nothing. (To a human anyway.)
OrcSlayer101 wrote:...destroy all their units and then give them visibility over the whole map...
That is exactly what I posted almost a whole year ago... Why would you steal my answer and make it look like yours?
3ICE wrote:...loses his hero and gets to see the map...

Re: How to send a player to observers via triggering?

Posted: Sat May 22, 2010 6:39 pm
by Thurst4blood
Why don't you make this trigger

if player types "-obs" or "-Observe".

Then make these actions:

Unit Group - Pick all units (Owned By (triggering player) and remove Picked Unit)
Visibility - Make the map visible to the triggering player
player - Set gold and lumber and food to 0
Game - Text Message for # of seconds "Name of Triggering Player has decided to be an Observer" he has full view.

Re: How to send a player to observers via triggering?

Posted: Sat May 22, 2010 6:54 pm
by 3ICE
Because that's not what he wanted.
Please don't post wrong solutions into a thread that has the correct solution already.

Re: How to send a player to observers via triggering?

Posted: Sat May 22, 2010 7:53 pm
by Thurst4blood
... 3ICE I simply just might, possibly, maybe, could of helped him!

Re: How to send a player to observers via triggering?

Posted: Sat May 22, 2010 8:00 pm
by 3ICE
Thurst213 wrote:... 3ICE I simply just might, possibly, maybe, could of helped him!
Nope. You repeated what two people already said above, and it isn't even the right answer.

This was the question:
Legit wrote:the player only able to talk in observers... i want to know how to do that trigger...
This is the solution:
3ICE wrote:As you can see from line 6, they used t_pla Player - Set (Triggering player) Game result to 0
By the way it happened on 2009/02/03 and today is 2010/05/23 so I guess you are also a bit too late. Over a year late...