• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

few ideas

Status
Not open for further replies.
Level 21
Joined
Jan 5, 2005
Messages
3,515
i heard that triggers are actually jass encoded, but because they are read in a different way they are more laggy and take longer to read. is there a tool to convert triggers directly to jass?

also how is map size dictated, ignoring imports/ ie what make a map large in size?

i had the idea that instead of having pre-placed units and buildings i could spawn them in loads of regions meaning they wouldnt take up the size of the map. also im guessing you could do similar things with terrain and doo-dads. that way you could have acompletely empty map of small size which spawns everything in the first few seconds. i bet a cool cenimatic could be made from it too.
 
Level 5
Joined
Nov 17, 2005
Messages
165
1: Just click Edit --> Convert to Custom Text, then OK in the dialog, within the trigger editor and there you have it! :)

2: You refer to the "size tag" displayed when you look at the map in WC3, right? After that, I'm not sure what you mean. Do you think it's the file size or the map size (area) it displays? Anyway, it's the area, and you know how to measure that :wink:

3: While speaking about JASS, did you know that units placed in the WE are actually created with JASS anyway? Just extract the file war3map.j from any map and you'll see. But, if you have a choice, I would go with at least having a few units on the map at the beginning, since they are pre-loaded and don't cause any lagg as spawning units in-game may do.
 
Level 18
Joined
Jan 24, 2006
Messages
1,938
Yes, you can convert GUI triggers to JASS but it won't make any difference because when they say JASS triggers are less laggy they mean triggers writtenfrom the start in JASS, so most likely the person doing that won't have included any of the GUI's lag-inducing mistakes and can also remove any memory leaks found. Using convert to JASS shouldn't do a thing.
 
Level 21
Joined
Jan 5, 2005
Messages
3,515
VictorOfSweden said:
2: You refer to the "size tag" displayed when you look at the map in WC3, right? After that, I'm not sure what you mean. Do you think it's the file size or the map size (area) it displays? Anyway, it's the area, and you know how to measure that :wink:

i meant size as in Kb/Mb ect... i want to know what makes a map large in size when talking about size on disk.
 

Ralle

Owner
Level 79
Joined
Oct 6, 2004
Messages
10,183
well converting GUI triggers to jass is pointless.. When saving your map, ALL triggers are saved as jass in the war3map.j. If you should make your triggers better, you should learn jassing ;)
placing units and placing them with triggers is the same..
stuff as models, skins, sounds, custom units, triggers all takes up space ;)
 
Level 5
Joined
Nov 17, 2005
Messages
165
Ralle said:
well converting GUI triggers to jass is pointless.. /--/
stuff as models, skins, sounds, custom units, triggers all takes up space ;)

Converting GUI triggers to JASS is not pointless! As you say yourself, triggers take up space in your map (more or less). And you can shorten the loading time and increasing the efficiency of your map by converting and rewrite GUI triggers in an easy way. One thing I've done recently is that I rewrote some of my triggers' conditions, which were pretty dumbly written after I looked at them in JASS. Here's an example with the original trigger first:

[trigger:1:fd8aac0c2b]Untitled Trigger 001
Events
Conditions
(Unit-type of (Dying unit)) Not equal to Footman
(Unit-type of (Dying unit)) Not equal to Knight
Actions
[/trigger:1:fd8aac0c2b]
[jass:1:fd8aac0c2b]function Trig_Untitled_Trigger_001_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) != 'hfoo' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetDyingUnit()) != 'hkni' ) ) then
return false
endif
return true
endfunction
[/jass:1:fd8aac0c2b]
... and then my modified one:
[jass:1:fd8aac0c2b]function Trig_Untitled_Trigger_001_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetDyingUnit()) != 'hfoo' and GetUnitTypeId(GetDyingUnit()) != 'hkni' ) then
return true
endif
return false
endfunction[/jass:1:fd8aac0c2b]
As you see, the last one is shorter that the first one, saving a few bytes :)
 
Level 5
Joined
Nov 17, 2005
Messages
165
Well, optimizing conditions was just an example. Here is another thing I've done; I've been working on a custom version of the map Evolves (based on this). The basic idea is that you kill and evolve, which, of course, has to be triggered. But the present GUI script was just really messy. As a part of the new script, I wrote this:
JASS:
function Trig_Evolution_JASS_PlayerLoop takes nothing returns nothing
    if ( GetPlayerSlotState(GetEnumPlayer()) != PLAYER_SLOT_STATE_PLAYING ) then
        return false
    endif

    if ( udg_Levels[GetConvertedPlayerId(GetEnumPlayer())] == 1 ) then
        if ( udg_Kills[GetConvertedPlayerId(GetEnumPlayer())] >= 30 ) then
            call Trig_Evolution_JASS_LevelUp()
        endif
    elseif ( udg_Levels[GetConvertedPlayerId(GetEnumPlayer())] == 2 ) then
        if ( udg_Kills[GetConvertedPlayerId(GetEnumPlayer())] >= 60 ) then
            call Trig_Evolution_JASS_LevelUp()
        endif
    elseif ( udg_Levels[GetConvertedPlayerId(GetEnumPlayer())] == 3 ) then
        if ( udg_Kills[GetConvertedPlayerId(GetEnumPlayer())] >= 90 ) then
            call Trig_Evolution_JASS_LevelUp()
        endif
    endif
    /--/
endfunction
I certainly prefer this one over that old and messy GUI script, but do feel free to compare the two, the map's not protected.

@ralle: Yeah! You're right. I misunderstood your previous post, sorry :wink:

EDIT: Sadly, this script is a little aged too, since I haven't worked on it much lately. Meanwhile, my knowledge grew bigger, so, while writing this, I just realised that you can use the "and" statement instead of the two ifs :)
 
Last edited:
Level 1
Joined
Jun 16, 2006
Messages
6
VictorOfSweden said:
[trigger:1:fd8aac0c2b]Untitled Trigger 001
Events
Conditions
(Unit-type of (Dying unit)) Not equal to Footman
(Unit-type of (Dying unit)) Not equal to Knight
Actions
[/trigger:1:fd8aac0c2b]
[jass:1:fd8aac0c2b]function Trig_Untitled_Trigger_001_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) != 'hfoo' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetDyingUnit()) != 'hkni' ) ) then
return false
endif
return true
endfunction
[/jass:1:fd8aac0c2b]
... and then my modified one:
[jass:1:fd8aac0c2b]function Trig_Untitled_Trigger_001_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetDyingUnit()) != 'hfoo' and GetUnitTypeId(GetDyingUnit()) != 'hkni' ) then
return true
endif
return false
endfunction[/jass:1:fd8aac0c2b]
:)

Wow, the GUI converter is pretty retarded from the looks of this...I've never worked with JASS but i know Java and PHP and i can kinda tell what's going on. One question...Why's in the hell is the GUI using double negatives and crap. Is it always that inefficient? I think i'm just gonna bite the bullet, read through the JASS docs, and do the triggers for my first map in JASS.
 
Status
Not open for further replies.
Top