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 04-03-2009, 06:40 PM   #31
Toadcop
BuranX
 
Toadcop's Avatar
 
Join Date: Jul 2006
Posts: 1,886

Submissions (4)

Toadcop is just really nice (299)Toadcop is just really nice (299)

Approved Map: TcXSpell Making Session 10 Winner

Send a message via ICQ to Toadcop
Default

zomg... SLK > all the only thing what needed to be preloaded are some fx. BUT your trick will not preload them also (for example on cast effect etc.)

well 95% of "lags/preloads" solves the SLK optimization. so i personaly don't see the sense for this.
__________________
Toadcop is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 04-03-2009, 07:20 PM   #32
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

There is also the Preload native if you want to preload models and spell effects.
grim001 is offline   Reply With Quote
Old 04-03-2009, 08:36 PM   #33
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

AFAIK slk only solves loading time and not that short freeze after adding an ability...
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 04-03-2009, 11:06 PM   #34
Toadcop
BuranX
 
Toadcop's Avatar
 
Join Date: Jul 2006
Posts: 1,886

Submissions (4)

Toadcop is just really nice (299)Toadcop is just really nice (299)

Approved Map: TcXSpell Making Session 10 Winner

Send a message via ICQ to Toadcop
Default

Quote:
AFAIK slk only solves loading time and not that short freeze after adding an ability...
hmmm imo it's art what frezzes and not the abilitys self. cause i have bonus mod in slk and it's not mentionable than adding abilitys etc. maybe i don't mention this cause i don't use hero spells =\

and about only loading time is 100% incorrect. well i am not interested in this all stuff etc. but someone could make a comparision...
__________________
Toadcop is offline   Reply With Quote
Old 04-03-2009, 11:12 PM   #35
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

The lag is usually about 1 frame when a new ability enters the game without preloading. It doesn't get in the way of gameplay, but it is a noticeable aesthetic problem.
grim001 is offline   Reply With Quote
Old 04-04-2009, 02:24 PM   #36
Karawasa
Element Tower Defense
 
Karawasa's Avatar
 
Join Date: Feb 2006
Posts: 1,094

Submissions (2)

Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)

Approved Map: Tropical TagApproved Map: Element TD

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

Not sure I see the point in this system. What is wrong with loading up a pre-placed dummy unit with all the guilty (guilty of causing entering lag) abilities and then removing that dummy at the start of the game? If nothing, then...
__________________

Element Tower Defense - Premier WC3 Custom Game
Karawasa is offline   Reply With Quote
Old 04-04-2009, 03:24 PM   #37
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

Quote:
Originally Posted by Karawasa
Not sure I see the point in this system. What is wrong with loading up a pre-placed dummy unit with all the guilty (guilty of causing entering lag) abilities and then removing that dummy at the start of the game? If nothing, then...
i dont think anything is wrong with that ..
typing a line of code is usually faster than:
opening object editor ..searching ur dummy unit ....search the ability ...
__________________
akolyt0r is offline   Reply With Quote
Old 04-05-2009, 09:38 AM   #38
Karawasa
Element Tower Defense
 
Karawasa's Avatar
 
Join Date: Feb 2006
Posts: 1,094

Submissions (2)

Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)

Approved Map: Tropical TagApproved Map: Element TD

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

Don't see how using this thing would be any faster for the map maker. I can easily add the custom ability to the dummy unit in the time it takes to look up the ability id and add the line of code. Also, I fail to see how calling a bunch of code is better than simply annihilating the dummy unit in-game.

@Litany: I really fail to see where you are coming from. How is it any less modular than this system? In practice, both end up giving you a list (either a wall of code, or an object editor list of abilities) of abilities to be preloaded.
__________________

Element Tower Defense - Premier WC3 Custom Game
Karawasa is offline   Reply With Quote
Old 04-05-2009, 04:48 PM   #39
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

Litany is right...
when you want to add your custom ablity to another map, with your method you have setup that dummy unit once again... +add those abilities...(can be quite many..)
When using this, you just have to add this script.
__________________
akolyt0r is offline   Reply With Quote
Old 04-05-2009, 06:17 PM   #40
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

An important use is that systems which require this script can preload their own abilities, especially stuff generated by the Object Merger.
grim001 is offline   Reply With Quote
Old 04-05-2009, 08:40 PM   #41
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 grim001
An important use is that systems which require this script can preload their own abilities, especially stuff generated by the Object Merger.
Bingo.

You misspelled initialized and initialization in your debug messages. Whatever, though, I'll just go ahead and fix the typos myself and approve this.
__________________
Rising_Dusk is offline   Reply With Quote
Old 04-06-2009, 12:40 AM   #42
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

What happens if I want to preload an engineering upgrade based ability?
__________________
Anitarf is offline   Reply With Quote
Old 10-17-2009, 02:48 AM   #43
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

Raising this thread from the dead, I have decided to do some maintenance on my old submissions.
  • Improved documentation.
  • It is no longer possible to attempt to preload an ability when the PreloadUnit doesn't exist yet. If you can call the function, it exists.
  • AbilityPreload now inlines if debug mode is off, and displays error messages if debug mode is on.
  • The preload unit rawcode is now configurable, although it should probably be left alone. Sammy! makes a good preloading unit.
  • Added AbilityRangePreload, which lets you preload an entire range of abilities in one function call.

Also, this script is way more useful now with optional requirements. You can preload stuff if it's in the map, and skip it if it's not in the map.

Last edited by grim001 : 10-17-2009 at 02:49 AM.
grim001 is offline   Reply With Quote
Old 02-25-2010, 06:56 AM   #44
Archmage Owenalacaster
Laughs Derisively
 
Archmage Owenalacaster's Avatar


Project Member: PoC
 
Join Date: Jun 2006
Posts: 649

Submissions (1)

Archmage Owenalacaster is a jewel in the rough (180)Archmage Owenalacaster is a jewel in the rough (180)Archmage Owenalacaster is a jewel in the rough (180)

Race-Building Contest #1 Winner

Default

I think the error messages ought to display the rawcode of the offending value, as it is more helpful for tracking down the problem. I do it with this minor modification to your code.
Collapse JASS:
    private function Id2Char takes integer i returns string
        local string abc = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"

        if i >= 97 then
            return SubString(abc,i - 97 + 36,i - 96 + 36)
        elseif i >= 65 then
            return SubString(abc,i - 65 + 10,i - 64 + 10)
        endif
        return SubString(abc,i - 48,i - 47)
    endfunction

    private function Id2String takes integer id returns string
        local integer t = id / 256
        local string r = Id2Char(id - 256 * t)
        set id = t / 256
        set r = Id2Char(t - 256 * id) + r
        set t = id / 256
        return Id2Char(t) + Id2Char(id - 256 * t) + r
    endfunction
    
function AbilityPreload takes integer abilityid returns nothing
    static if DEBUG_MODE then
        if GetUnitTypeId(PreloadUnit) == 0 then
            call BJDebugMsg("AbilityPreload error: Can't preload an ability ("+Id2String(abilityid)+") after initialization")
            return
        endif
    endif
    call UnitAddAbility(PreloadUnit, abilityid)
    static if DEBUG_MODE then
        if GetUnitAbilityLevel(PreloadUnit, abilityid) == 0 then
            call BJDebugMsg("AbilityPreload error: Attempted to preload a non-existent ability ("+Id2String(abilityid)+")")
        endif
    endif
endfunction
__________________
I enjoy small text.
Resources: Custom Race System
JademusSreg.950, North American region on StarCraft 2
Archmage Owenalacaster is offline   Reply With Quote
Old 08-21-2010, 09:31 PM   #45
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Module onInit methods were recently added to vJass and they get executed before struct onInits, so preloading stuff from module onInit methods currently doesn't work.
__________________
Anitarf 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 12:30 PM.


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

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