| 02-23-2007, 10:02 PM | #1 |
I am making a Fullscreen shop for my map, and I've run into some difficulty with hiding doodads for players. The shop has to be MUI for it to work, and it allows the player to cycle through items. The problem is, I need to be able to hide some of the icon doodads for some players, and show them for others. So I used this simple script: JASS:set udg_TempInteger = GetConvertedPlayerId(GetTriggerPlayer()) if GetLocalPlayer() == Player(udg_TempInteger - 1) then call ShowDestructableBJ( false, [Destructable] ) endif This worked great for singleplayer, but upon testing with two players, we had a lot of desyncs. Still hoping for the best, I tried using the death animation (which hides the doodad): JASS:set udg_TempInteger = GetConvertedPlayerId(GetTriggerPlayer()) if GetLocalPlayer() == Player(udg_TempInteger - 1) then call SetDestructableAnimationBJ( [Destructable], "death" ) endif Unfortunately, this did not work either, though fine in singleplayer. How should I go about creating a MUI local doodad 'hide'? All help is appreciated. |
| 02-24-2007, 01:06 AM | #2 |
I know there's a fading tree script/system here somewhere... let me find you a link to that... Here you go. This may or may not help you, since the system uses an altered tree model. |
| 02-24-2007, 01:06 PM | #3 |
What was done in the tree fading system is create a global variable called udg_LocalPlayer which is set as LocalPlayer(). The trigger woulc check if each player's unit was near a tree, and set a boolean with that player's number. JASS:if ( udg_PlayerNearTree[GetConvertedPlayerId(udg_LocalPlayer)] == true ) then set localString = "stand alternate" else set localString = "stand" endif call SetDestructableAnimationBJ( udg_argDestructible1, localString ) I remain confused. There was also something about occlusion height which I don't understand (or know what it even means, for that matter). |
| 02-26-2007, 08:39 PM | #4 |
I am rarely the sort to double-post in a forum, but this is a matter which is severely hindering my playtesting. If someone could give me a straight answer as to what is wrong with this script and why it is causing desyncs (and a replacement script), it will be greatly appreciated. JASS:set udg_TempInteger = GetConvertedPlayerId(GetTriggerPlayer()) if GetLocalPlayer() == Player(udg_TempInteger - 1) then call ShowDestructableBJ( false, [Destructable] ) endif |
| 02-27-2007, 01:41 AM | #5 |
Well, first of all you don't have to use GetConvertedPlayerId() and then subtract 1 from it. You can just use GetPlayerId(). And this causes desyncs because, well, it hides doodads locally. As I said before, the tree fade system is probably your best bet, though it uses a custom model. The effect is achieved by adding a custom "stand alternate" animation to the tree, which causes it to become invisible when played. |
| 02-27-2007, 10:42 AM | #6 |
i think destructable must be with out pathing so it will not cause problemms if hidded ! |
| 02-27-2007, 11:32 AM | #7 |
Use the native because I said so -- native ShowDestructable takes destructable d, boolean flag returns nothing And using things in GetLocalPlayer() blocks require the call doesn't do anything globally that might cause issues. It's sort of trixxy to tell you X desyncs and Y doesn't, but consider experimenting with things like what TC said. It probably has to do with something qualitative about the destructable itself. |
| 02-27-2007, 03:08 PM | #8 |
You will get a desync when you change core infomation for a certain player(s). For example, if you move the doodad for player one, every other players units will get blocked, and if you look at it, it will look like nothing is blocking it, that is not allowed, everything has to be sync'd, things that effect everybody are not changable, visability options are the main things that are changed locally. For example, if you could, you could change the alpha for the destrucable for one player to 100%, as that is just visability, but if you want to hide it for a certain player, so some units can walk through but others cant, it is not possible. |
| 02-27-2007, 09:02 PM | #9 | |
Quote:
This comment helped resolve the problem, I did not filter out the borders from the script, and the border doodads have no death animation. +Rep for that, Dusk. Thanks for the info everyone else, the interest was greatly appreciated. |
