• 🏆 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!

[Trigger] Getting rid of if/then/elses

Status
Not open for further replies.
From a part of your trigger, you can do something like this.

  • Set Sky[1] = Environment\\Sky\\BlizzardSky\\BlizzardSky.mdl
  • Set Sky[2] = Environment\\Sky\\DalaranSky\\DalaranSky.mdl
  • Set Sky[3] = Environment\\Sky\\FelwoodSky\\FelwoodSky.mdl
  • Set Sky[4] = Environment\\Sky\\FoggedSky\\FoggedSky.mdl
  • Set Sky[5] = Environment\\Sky\\Sky\\SkyLight.mdl
  • For each (Integer SkyVar) from 1 to MaxSkyNumber, do (Actions)
    • Bucle: Acciones
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SkyIndex Igual a SkyVar
        • Then - Actions
          • Custom script: call SetSkyModel( udg_Sky[udg_SkyVar] )
        • Else - Actions
You can do the same for the filters and weather effects.
 
Yeah you're right, I was tired in the night. :/ You don't need the loop or the if/then/else.

  • -
    • // Set your variables in start.
    • Set Sky[1] = Environment\\Sky\\BlizzardSky\\BlizzardSky.mdl
    • Set Sky[2] = Environment\\Sky\\DalaranSky\\DalaranSky.mdl
    • Set Sky[3] = Environment\\Sky\\FelwoodSky\\FelwoodSky.mdl
    • Set Sky[4] = Environment\\Sky\\FoggedSky\\FoggedSky.mdl
    • Set Sky[5] = Environment\\Sky\\Sky\\SkyLight.mdl
    • -
    • // When you need to change the sky do this:
    • Custom script: call SetSkyModel( udg_Sky[udg_SkyIndex] )
Thanks WaterKnight.-
 
Level 12
Joined
Feb 11, 2008
Messages
809
Yeah you're right, I was tired in the night. :/ You don't need the loop or the if/then/else.

  • -
    • // Set your variables in start.
    • Set Sky[1] = Environment\\Sky\\BlizzardSky\\BlizzardSky.mdl
    • Set Sky[2] = Environment\\Sky\\DalaranSky\\DalaranSky.mdl
    • Set Sky[3] = Environment\\Sky\\FelwoodSky\\FelwoodSky.mdl
    • Set Sky[4] = Environment\\Sky\\FoggedSky\\FoggedSky.mdl
    • Set Sky[5] = Environment\\Sky\\Sky\\SkyLight.mdl
    • -
    • // When you need to change the sky do this:
    • Custom script: call SetSkyModel( udg_Sky[udg_SkyIndex] )
Thanks WaterKnight.-

okay and with creating the variables to do that would they all be the same type for fade filters/skys/and weather and what type of variable would you create to enter a custom path? thanks guys
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
GUI abstracts variable types in silly ways. For some objects you might need to use JASS/vJASS to create proper generic variables or to reference a generic GUI variable in a generic way (as some types such as "unit type" are actually more simple integers).

A custom path, such as for models, would be a string.
 
Level 12
Joined
Feb 11, 2008
Messages
809
GUI abstracts variable types in silly ways. For some objects you might need to use JASS/vJASS to create proper generic variables or to reference a generic GUI variable in a generic way (as some types such as "unit type" are actually more simple integers).

A custom path, such as for models, would be a string.

Thanks i got it now but the only one im still having problems with is the weathers so far i get a fatal error everytime when making a string for the weathers to refer to in the string would you have to place it like "RAhr" or 'RAhr' or even just RAhr? no matter which way i try it doesnt work.....
 
Status
Not open for further replies.
Top