HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

switch command

08-05-2009, 07:10 PM#1
Tot
i'd like to have a switch command like in dota and i got everything (vote, etc.) exept its core, cause i don not know how to switch the players
08-05-2009, 07:15 PM#2
Opossum
Could you explain "switch command" to those who never actually played DotA? :\
08-05-2009, 07:23 PM#3
chobibo
switch player a with player b, giving a b's units and giving b a's units.
08-05-2009, 07:26 PM#4
Tot
completely change players
give all units, etc and the playerposition of player a to player b and vice versa
--> only controller and name stay the same for the both players, everything else is changed


@chobibo:
today you're something between a nemesis and a guardian angel

cause evertime I start a reply to a thread your posting before me
08-05-2009, 07:33 PM#5
chobibo
Shouldn't this be on triggers and scripts?

Maybe because my post count - 2 is 666? LoL just kidding.
08-05-2009, 07:36 PM#6
Opossum
Uh well I guess you'll have to change every aspect manually as I doubt there's such thing as "switch players".
Change unit ownership, color, team, alliances and all variables that are associated with players. I don't see another way for this.
08-05-2009, 07:38 PM#7
Tot
yep, problem is how to change it manually via triggers

@chobibo: maybe, dunno
its a general question how to make it, not a specific question to the triggers
as i said i dont know, i'm not a moderator
08-05-2009, 07:45 PM#8
Opossum
Collapse JASS:
native SetUnitOwner takes unit whichUnit, player whichPlayer, boolean changeColor returns nothing
native SetPlayerColor takes player whichPlayer, playercolor color returns nothing
native SetPlayerAlliance takes player sourcePlayer, player otherPlayer, alliancetype whichAllianceSetting, boolean value returns nothing
native SetPlayerTeam takes player whichPlayer, integer whichTeam returns nothing
That should be enough. Just do some testing and see if something's missing for a complete switch.
08-05-2009, 07:53 PM#9
Tot
and how to switch players player id
eg.
before switch
player a is player nr2
player b is player nr8

after switch
player b is player nr2
player a is player nr8
08-05-2009, 07:57 PM#10
Opossum
You can't change those. You'd have to use custom player ids for that and use those instead of GetPlayerId.
08-05-2009, 08:02 PM#11
Tot
ok, i grant you that i wanna make something nearly impossible (for someone without a good knowlege of JASS/vJASS)

!!what's possible in dota must be possible in every other map!!


will continue tomorrow to get this working, bye
08-06-2009, 04:26 AM#12
Sophismata
For all we know, blizzard added a secret custom DotA-only playerswitch native...

(Yes, I know that this isn't actually the case. The stuff with 1.24 and DotA shits me, though.)
08-06-2009, 08:28 AM#13
Tot
Quote:
Originally Posted by Sophismata
For all we know, blizzard added a secret custom DotA-only playerswitch native...

(Yes, I know that this isn't actually the case. The stuff with 1.24 and DotA shits me, though.)

ok, but how to use it (hack dota?)

what if i fake the player position of the switching players with a integer array containing the "player number" and use this number instead of normal player number. would this affect the statistics?
08-06-2009, 09:53 AM#14
Sophismata
Huh? I was joking about the switching thing.

All you need to do is think of everything that defines a player in your map - in DotA's case, it is the hero, player, items, gold, circle of power and the team. So, those are swapped over, cosmetic changes are made and everything is fine.
08-06-2009, 10:37 AM#15
Tot
Quote:
Originally Posted by Sophismata
Huh? I was joking about the switching thing.

All you need to do is think of everything that defines a player in your map - in DotA's case, it is the hero, player, items, gold, circle of power and the team. So, those are swapped over, cosmetic changes are made and everything is fine.

ok, hack dota (is easier)

which version is the last with -switch working?