wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 10-26-2009, 01:03 PM   #61
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

Did you manage to test this yet Dusk?
grim001 is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 10-26-2009, 03:02 PM   #62
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

I have to make a testmap for this, because the actual map of mine I test it in doesn't actually use looping sounds and stuff. Because of that (and that I've been working on my maps instead of scripts right now), I haven't finished it yet.

I could always post the script if someone else wants to do a testmap for it. (That would be really awesome)
__________________
Rising_Dusk is offline   Reply With Quote
Old 10-28-2009, 11:51 AM   #63
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

I guess I can do a testmap if you post the updated script.
grim001 is offline   Reply With Quote
Old 10-28-2009, 03:31 PM   #64
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Expand JASS:
If you can't do it, I will be able to do it this weekend when I've got the free time to work on it at my home computer. The documentation isn't updated yet, because I do that after I've verified all of my new syntax works. It should do everything you asked for it to do.
__________________

Last edited by Rising_Dusk : 10-28-2009 at 03:32 PM.
Rising_Dusk is offline   Reply With Quote
Old 10-29-2009, 08:07 PM   #65
zwiebelchen
User
 
Join Date: Nov 2004
Posts: 108

zwiebelchen is on a distinguished road (16)

Default

How can I stop a sound that is played? The Sound variable is not a sound anymore, so I can not use StopSound(whichsound).

RunSound seems to return a sound that I could store in order to do that (and then use StopSound); however, you can't do this for sounds that should be played locally, since it requires to somehow store the returning sound to a variable, but inside the GetLocalPlayer(), you can not do that properly.

Last edited by zwiebelchen : 10-29-2009 at 08:14 PM.
zwiebelchen is offline   Reply With Quote
Old 10-29-2009, 09:52 PM   #66
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Quote:
Originally Posted by zwiebelchen
The Sound variable is not a sound anymore, so I can not use StopSound(whichsound).
Of course you can use StopSound(). The RunSound function returns a sound that you can handle as a normal sound with normal natives.
Quote:
Originally Posted by zwiebelchen
RunSound seems to return a sound that I could store in order to do that (and then use StopSound); however, you can't do this for sounds that should be played locally, since it requires to somehow store the returning sound to a variable, but inside the GetLocalPlayer(), you can not do that properly.
Look at the code in the post above yours:
Collapse JASS:
function RunSoundForPlayer takes integer soundRef, player p returns sound
In retrospect, I should probably make the system always default the volume to 127 when a sound is allocated. That way the user doesn't have to remember to do that himself if at one point the sound were used locally.
__________________

Last edited by Rising_Dusk : 10-29-2009 at 09:54 PM.
Rising_Dusk is offline   Reply With Quote
Old 10-29-2009, 10:26 PM   #67
zwiebelchen
User
 
Join Date: Nov 2004
Posts: 108

zwiebelchen is on a distinguished road (16)

Default

Ah, my bad, didn't notive you posted an updated version here. You should really also update your first post!

Last edited by zwiebelchen : 10-29-2009 at 10:32 PM.
zwiebelchen is offline   Reply With Quote
Old 10-29-2009, 10:43 PM   #68
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

I haven't had the opportunity to test the code in a testmap yet, but I will update the first post when I have.
__________________
Rising_Dusk is offline   Reply With Quote
Old 11-09-2009, 12:50 AM   #69
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Updated.
  • Created and added to the first post a testmap displaying that this library actually does what it is supposed to do. It is compiled in debug mode so that you can test and verify that nothing breaks.
  • Added functionality for many new functions that really help speed the development process up.
  • Fixed countless doublefree bugs and null-struct-destruction bugs that I had previously let sneak into the code.
__________________
Rising_Dusk is offline   Reply With Quote
Old 11-12-2009, 08:31 AM   #70
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Updated.
  • Added some more debug messages for natives that kill sounds and will cause this library to be very unhappy.
  • Removed unnecessary function calls for RunSoundAtPoint, RunSoundOnUnit, and RunSoundForPlayer.
  • Improved the documentation.
  • Added support for people doing stupid things like StopSound(RunSound(SOUND_TYPE), false, true) because grim told me to. (Even though it makes no sense)
__________________
Rising_Dusk is offline   Reply With Quote
Old 11-12-2009, 09:58 AM   #71
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

OK, this library is perfect now, I wanted it to be that way since this thing should become a new standard for dealing with sounds. Approved.
grim001 is offline   Reply With Quote
Old 11-12-2009, 03:56 PM   #72
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Yay, thanks.
__________________
Rising_Dusk is offline   Reply With Quote
Old 12-28-2009, 01:41 PM   #73
Sinnergy
User
 
Sinnergy's Avatar
 
Join Date: Apr 2009
Posts: 173

Sinnergy has little to show at this moment (8)

Default

Code:
//! zinc
library fartman requires xecast,xepreload,SpellEvent,SoundUtils,TimerUtils{
    constant integer spell = 'A00G';
    constant integer dspell = 'A00I';
    constant string sfx = "Abilities\\Spells\\Undead\\PlagueCloud\\PlagueCloudCaster.mdl";
    integer SOUND_FART = 0;
    
    struct data{
        unit c;
        integer f;
        effect gfx;
    }
    
    function act(){
        unit c = SpellEvent.CastingUnit;
        timer t = NewTimer();
        data d = data.create();
        d.c = c;
        d.f = 0;
        d.gfx = AddSpecialEffectTarget(sfx,c,"origin");
        SetTimerData(t,d);
        TimerStart(t,1.0,true,function(){
            timer t = GetExpiredTimer();
            sound frt;
            data d = GetTimerData(t);
            xecast xe = xecast.createA();
            xe.abilityid = dspell;
            xe.owningplayer = GetOwningPlayer(d.c);
            xe.recycledelay = 4.0;
            xe.orderstring = "acidbomb";
            xe.level = GetUnitAbilityLevel(d.c,spell);
            xe.castOnTarget(d.c);
            frt = RunSoundOnUnit(SOUND_FART,d.c);
            d.f += 1;
            if(d.f >= 6 || GetWidgetLife(d.c) <= 0.405){
                d.f = 0;
                DestroyEffect(d.gfx);
                ReleaseTimer(t);
                d.destroy();
            }
            t = null;
            frt = null;
        });
        c = null;
        t = null;
    }
    
    function onInit(){
        RegisterSpellEffectResponse(spell,act);
        SOUND_FART = DefineSound("snd\\fart_3f.wav",418,false,true);
        XE_PreloadAbility(dspell);
    }
}
//! endzinc
not playing the sound.
The sound I used is a wav file, I tested playing it in sound editor and it works well, but doesn't play when triggered.
__________________
Current Project:
Rise of Sinnergy v1.00

Last edited by Sinnergy : 12-28-2009 at 01:48 PM.
Sinnergy is offline   Reply With Quote
Old 01-21-2010, 03:02 PM   #74
TotallyAwesome
User
 
TotallyAwesome's Avatar


Project Member: TBR
 
Join Date: Apr 2008
Posts: 582

Submissions (7)

TotallyAwesome is a jewel in the rough (164)TotallyAwesome is a jewel in the rough (164)

Send a message via ICQ to TotallyAwesome Send a message via AIM to TotallyAwesome Send a message via MSN to TotallyAwesome Send a message via Yahoo to TotallyAwesome
Default

My lifesaver.
__________________
Quote:
[23-56-42] Captain Griffen orders Hakeem to say: /me is going to bed now, with Wulfy, and he hopes that he will come out again with his manhood still attached...
TotallyAwesome is offline   Reply With Quote
Old 01-21-2010, 04:06 PM   #75
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Quote:
Originally Posted by Sinnergy
The sound I used is a wav file, I tested playing it in sound editor and it works well, but doesn't play when triggered.
Looks like you're doing everything right, despite you using code tags and not zinc tags. Does everything else in the spell happen properly? Maybe a thread crash? Do you have WC3 sounds turned on in-game?
__________________

Last edited by Rising_Dusk : 01-21-2010 at 04:06 PM.
Rising_Dusk is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 07:00 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2020, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services