HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Triggerproblem: "Wait" does not work !?

09-25-2002, 03:02 PM#1
Gozai
I created a Difficulty vote system for my map, which works fine when playing alone (>Testmap, CustomGame or LAN), but doesn´t work with 2 players on LAN.
Actually I guess the Trigger still works, but with 2 Players the "You can vote now" Text just flashes for less than a second and than the Difficulty (from DifficultyText(DifficultyReturn)) is shown. The 15 seconds Wait seem not to work with 2 players.
The trigger is...

EVENT: <none, triggered by other trigger)

CONDITION: VoteOver Equal to False (Boolean Variable)

ACTIONS:
Trigger - Turn on Vote Easy <gen> ________ (>Player types exact match...= Integer Variable set)
Trigger - Turn in Vote Medium <gen> ________ (see above)
Trigger - Turn on Vote Hard <gen> ________ (see above)
Cinematic - Clear the screen of text messages for (All players controlled by User player)
Game - Display to (All players controlled by User player) for 10 seconds the text: "TEXT..."
Wait 15.00 seconds
Set VoteOver = True
Cinematic - Clear the screen of text messages for (All players controlled by a User player)
Trigger - Run Vote Count <gen> (checking conditions) ________ (sums up all votes)
Game - Display to (All players controlled by a User player) the text: DifficultyText(DifficultyReturn) _(Text-Array with variable Indexnumber)
Trigger - Turn off (This Trigger)
Trigger - Run Move to start <gen> (checking conditions) ________ (condition is VoteOver Equal to True)

I would really appreciate to get rid off this *!(/&% problem that already cost a lot of time...

Thx
Gozai
09-25-2002, 06:24 PM#2
Guest
It's a known "thing" - you need to run the wait for every human player, so...

Player Group: Select all players in (allies of player 1) and Wait 15.00 seconds

or however you choose to do it, there's several ways ;)
09-25-2002, 08:26 PM#3
Guest
and that isn't one of them.
09-25-2002, 08:57 PM#4
h0pesfall
you need to setan integer variable to the number of players in the game and then do

For each integer A from 2 to <variable> do Wait <time>

you also need checks that set the variable to its value -1 every time a player leaves
09-26-2002, 04:38 AM#5
Guest
Quote:
Originally posted by DrunkOM
and that isn't one of them.


I found that out today the hard way :\
09-26-2002, 09:08 AM#6
Gozai
Can´t try it right now, since my LAN is "out of order", I will answer to this in the evening
09-26-2002, 10:21 PM#7
Unwiseman
i found that when ur testing your map with lan and Test Map on the editor, screws up the triggers.. really badly i would recommend testing on battle net but that would be very annoying to minimized and stuff cus i had a TD map it worked fine on battle net but when i tried it on lan the units didnt move or anything and i never altered the map in any way : \ lol
09-26-2002, 11:07 PM#8
Guest
Quote:
Originally posted by DrunkOM
and that isn't one of them.

This wasn't a very useful comment. Spamming for post count DOM?

Incidentally, I've had problems with the following:

function Wait takes real dur returns nothing
local integer i
set i = 1
loop
exitwhen i > udg_Players
call TriggerSleepAction(dur)
set i = i + 1
endloop

udg_Players is a global updated every second which counts the number of slots which are human and "playing".

Sometimes it works, and pauses for a seemingly appropriate lenght of time. Sometimes it fails and doesn't pause at all. Are timers the only real way to guarantee the proper amount of time has passed in multiplayer?

And again, does anyone know WHY we even have this problem?

EDIT: Would it be more efficient to count the players each time I call the wait function instead of once per second? Hmm....

Care.
09-26-2002, 11:29 PM#9
dataangel
Heaven, chances are you're experiencing a different bug -- if one player presses escape it makes the cinematic transmission disappear for all players. You need to setup triggers to redisplay the text if someone hits escape.
09-27-2002, 12:29 AM#10
Guest
Quote:
This wasn't a very useful comment. Spamming for post count DOM?

Yes, exactly. That number means soooo much to me.

Sorry if I'm not allowed to make 1 post that doesn't explain everything. You'll just have to deal with it this time.

And yes... use a For Loop.
Edit:
Weaaddar is quite fond to remind everyone that post count means absolutely nothing unless you really like having a big number below your name.
Which is why I'm not even making a post
Also THAT Wasn't a pointless coment if you are saying for the solution set of x^2=16 is x={4} is a true statement. He doesn't have to prove why you wrong and show you that the Square root of 16 could be 4 or -4 therefore making the solution set = {-4,4} he can just say that the statement is false.

That said I hate Math. But I love it too...

Edit: DOM hates math period.
09-27-2002, 12:32 AM#11
Guest
I've yet to use cinematics, so ESC is not a problem. It's where I capture a cast spell action and do something like:

if (GetName(GetOrderTargetUnit())=="Villager") then
call ThisTriggerWait(10.0)
call ThisTriggerWrite(GetOwningPlayer(GetOrderedUnit()),"Your victim turns into a zombie!")
call ThisTriggerZombify(GetOrderedTarget())
else
call ThisTriggerWrite(GetOwningPlayer(GetOrderedUnit()),"Your victim doesn't want to be a zombie.")
endif

Sometimes with a decent sized game (4-6 players) it'll wait what seems like about 10 seconds. Other times it's like instant, and instantly turns the villager into a zombie.

I think I'll try and adjust my methods to use timers.

Care.
09-27-2002, 02:33 PM#12
Guest
Let me know what you think:

function Wait takes real duration returns nothing
local timer WaitTimer

set WaitTimer = CreateTimer()
call TimerStart( WaitTimer, duration, false, null) // sic

loop
exitwhen GetTimeLeft( WaitTimer) <= 0.0 // sic
call TriggerSleepAction(0.01)
endloop

call DestroyTimer( WaitTimer)
endfunction

I apologize if I've screwed up the function names (the sic's). I don't have them nearby to check, but the above works great! No hassle of dealing with player counts, etc.

I doubt if you'd ever need a timer with that much resolution (0.01), but I played a couple 10 player games this morning with no noticeable slowdown. I don't even know if you GET that much resolution. Does anybody know the smallest value you can pass to TriggerSleepAction?

Anybody see any problems with this method?

Care.
10-03-2002, 03:46 AM#13
FM_TertiaryEye
Heaven,

Thats a really cool idea actually! Ive lost a lot of time too trying to get cinematics and cameras to work online. Its especially frustrating when peeps try to play it with their screaming p3-700's and 128 megs of ram, and you have lag screens through most of your intro, heh.

Its a shame that nobody has said anything about this yet. How does it work when you have an existing timer already running? It doesnt interfere because its a local variable right?

It seems like the timer would have a lot of overhead as well, but i guess they were smart enough to separate the timer from the timer display in this implementation.

TO be honest, it seems to me that the multiplayer cinematics are just a hack on Blizzard's part. It's like someone said during the testing phase, "hey lets make it so that cinematics work in multiplayer, that would be cool", and the editor team just groaned :P

The trigger - Sleepaction takes a real so its bounded only by positive reals and zeros. But in the world editor, you can't use a real smaller than the hundreths place, even though the reals in the game, when displayed via the RTS() function go to the tens of thousanths place.

It kind of makes you wonder how precice they actually can be, just because the type specifies one thing doesnt mean the editor doesnt cut off the precision somewhere.

(one of my qualms with this editor is its really lousy precision of real numbers. I was trying to use the standard rotation algorithm to make some wisps orbit a point away from the origin and thanks to the real, they just travel in a straight line to the rotation axis, hehe, (because this rotation algorithm depends on the previous point to determine the next location, and that is always headed right for zero when you can only go to the tens of thousandths)

But then again, people have told me that this isnt the maple engine, ive heard, in fact that world editor is actually based upon a game! man....

Anyway, thanks for the cool tip
12-13-2004, 12:13 PM#14
Guest
So when using triggerSleepAction(i) the smallest value for is 0.01?