• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

What a waste! Need serious help ~

Status
Not open for further replies.
Guys, this is a big! huge! serious! enormous! problem T_T

I have this map, Ragnarok PvP Izlude{Look at Signature} in progress. In fact, I've already finished the map. Now it's BETA version, I've tested the map with my friend and I found bugs. I tried to fix all the bug but there's one major problem.

1st Problem
The "TriggerSleepAction()" function is not accurate in multiplayer!
And because of that, almost all of my skill has been screwed out. So I want a solution that is there any other way to make the wait function? I know I can do it with timers but that would take some time because I have lots of wait functions. Anyone could help me?

2nd Problem
Can I know how to make sound that cannot being heard by players that are not near the sound source? In short, 3D sound. Please show me the exact trigger for a sound playing with removed leaks
 
Level 11
Joined
Oct 20, 2007
Messages
342
1st proble.:
i think if u replace wait with this
JASS:
call PolledWait( 2 )
will solve the problem...
this is wait for game-time, i dunno what problem u facing in multiplayer, so far i use the normal wait but i din't see any problem...

for playing a sound by trigger (is that by trigger you mean?)
you have to go sound editor, choose the sound that u want, and "use it as a sound" or Crtl+U,
configure into a 3D sound, and put in the range that u want.
and this some trigger that can use
  • Sound - Attach RatDeath1 <gen> to (Triggering unit)
  • Sound - Set position of RatDeath1 <gen> to (Center of (Playable map area)) with Z offset 0.00
  • Sound - Add RatDeath1 <gen> across (Playable map area)
  • Sound - Set RatDeath1 <gen> distances to 0.00 minimum and 1000.00 maximum
or jass is
JASS:
    call AttachSoundToUnitBJ( gg_snd_RatDeath1, GetTriggerUnit() )
    call SetSoundPositionLocBJ( gg_snd_RatDeath1, GetRectCenter(GetPlayableMapRect()), 0 )
    call SetStackedSoundBJ( true, gg_snd_RatDeath1, GetPlayableMapRect() )
    call SetSoundDistances( gg_snd_RatDeath1, 0.00, 1000.00 )

and i had making RO pvp also xD
but stopped last few month
coz too busy :xxd:
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,192
Polled Wait works perfectly for long delays of over a second as then any inaccuracy becomes minimal, as no one notices if it is 0-0.5 seconds longer than it should be.

However for accurate delays, you have no option but to use timers. Timers run at the same rate SP and MP, thus why almost every JASS spell uses them for delays.
 
Will this work perfectly?
JASS:
function Wait takes real duration returns nothing
    local timer t
    local real  timeRemaining

    if (duration > 0) then
        set t = CreateTimer()
        call TimerStart(t, duration, false, null)
        loop
            set timeRemaining = TimerGetRemaining(t)
            exitwhen timeRemaining <= 0

            // If we have a bit of time left, skip past 10% of the remaining
            // duration instead of checking every interval, to minimize the
            // polling on long waits.
            if (timeRemaining > bj_POLLED_WAIT_SKIP_THRESHOLD) then
                call TriggerSleepAction(0.1 * timeRemaining)
            else
                call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
            endif
        endloop
        call DestroyTimer(t)
    endif
endfunction

I use this function as a custom wait, does it work?
 
Level 12
Joined
Mar 23, 2008
Messages
942
Create a trigger, convert it to custom text and place it as your first trigger.

copy that:

JASS:
library PolledWaitNew

function PolledWait2 takes real duration returns nothing
 local timer t = CreateTimer()
 local real remaining

 call TimerStart(t, duration, false, null)
 loop
  set remaining = TimerGetRemaining(t)
  exitwhen(remaining <= 0)
  if(remaining > .35)then
   call TriggerSleepAction(.1 * remaining)
  else
   call TriggerSleepAction(-1)
  endif
 endloop

 call PauseTimer(t)
 call DestroyTimer(t)
 set t = null
endfunction

endlibrary

Now replace all TriggerSleepAction(X) with "Custom Script: call PolledWait2(X)"
 
Then can I edit the sound and make them to "3D enable"?
If you do it correctly, it should work then. All i know is the gui way, and this is how it works:

Actions:
Sound - set position of (3d sound) to (region) with an offset of (x),(y).
Sound - Play (3d sound)


If that doesn't work, then you are doing it wrong.
 
Status
Not open for further replies.
Top