How to send a player to observers via triggering?

Do you need World Editor help? Ask here!
Before making a new topic:
First, check if your question has already been answered in the Tutorials section.
If you didn't find a solution, use the search function.
If searching didn't help either, you can make a new topic.

Topic title & content:
You must use a descriptive title. (Help plz is not good) (Need help with Dialog buttons is good)
Go into much detail when posting. You should post attachments. Like screenshots of the problem, the map you are making, replays of the error. Or you could even make a screencast (video) of your problem and upload it here.

Spelling:
Grammar seems to be a serious problem amongst teenagers, so use a spell checker or you will get no love.
Read your posts twice, before pressing the reply button.
And do not use profanity. Chatspeak (y r u nub) and Leetspeak (1 C4N S33 H4X) are not welcome here either.

Only World Editor related questions are allowed here!
(Click for Battle.net help) (Click for World Editor help)

How to send a player to observers via triggering?

New postby Legit on Sun Feb 01, 2009 8:36 pm

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?
Last edited by 3ICE on Sat May 22, 2010 6:55 pm, edited 4 times in total.
Reason: fixed topic title, 4 times :)
Legit
 
Posts: 22
Joined: Wed Dec 31, 2008 3:38 pm

Re: Trigger help

New postby 3ICE on Mon Feb 02, 2009 4:25 am

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?".
ImageImageImageImageImage
Image
ImageImage
User avatar
3ICE
Admin
 
Posts: 2326
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE

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

New postby Legit on Mon Feb 02, 2009 7:01 pm

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...
Legit
 
Posts: 22
Joined: Wed Dec 31, 2008 3:38 pm

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

New postby 3ICE on Mon Feb 02, 2009 7:22 pm

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.
ImageImageImageImageImage
Image
ImageImage
User avatar
3ICE
Admin
 
Posts: 2326
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE

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

New postby OrcSlayer101 on Mon May 10, 2010 3:39 pm

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)
Last edited by 3ICE on Sat May 22, 2010 6:56 pm, edited 1 time in total.
Reason: merged doublepost
The Slayer Of Orcs...
User avatar
OrcSlayer101
 
Posts: 82
Joined: Thu Mar 25, 2010 6:09 pm
Realm: US East
Account: ShadowBlades
Clan: TvN

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

New postby 3ICE on Wed May 12, 2010 4:52 pm

OrcSlayer101Wow 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...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...loses his hero and gets to see the map...
ImageImageImageImageImage
Image
ImageImage
User avatar
3ICE
Admin
 
Posts: 2326
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE

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

New postby Thurst4blood on Sat May 22, 2010 6:39 pm

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.
Thurst4blood
 
Posts: 39
Joined: Fri May 21, 2010 6:50 pm
Account: Thurst4blood

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

New postby 3ICE on Sat May 22, 2010 6:54 pm

Because that's not what he wanted.
Please don't post wrong solutions into a thread that has the correct solution already.
ImageImageImageImageImage
Image
ImageImage
User avatar
3ICE
Admin
 
Posts: 2326
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE

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

New postby Thurst4blood on Sat May 22, 2010 7:53 pm

... 3ICE I simply just might, possibly, maybe, could of helped him!
Thurst4blood
 
Posts: 39
Joined: Fri May 21, 2010 6:50 pm
Account: Thurst4blood

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

New postby 3ICE on Sat May 22, 2010 8:00 pm

Thurst213... 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:
Legitthe player only able to talk in observers... i want to know how to do that trigger...
This is the solution:
3ICEAs 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...
ImageImageImageImageImage
Image
ImageImage
User avatar
3ICE
Admin
 
Posts: 2326
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE


Return to HELP



Who is online

Users browsing this forum: No registered users and 17 guests

cron