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

Question: Stars

Status
Not open for further replies.
You can also code it! ;)
Go to the Destructibles tab, find your destructible and go to View -> Display Values as Raw Data. Now, memorize the id you see for your destructible. If it's a custom destructible, it will be something like D000; in my case, it was the Egg Sack destructible, so its raw ID was 'DTes'.
Import this code into your map (go to Trigger Editor, create a New Trigger, go to Edit -> Convert to Custom Text, and delete everything from the converted trigger. Get back here, select my code and right click - Copy; go back to the blank code and right click - Paste):
JASS:
function Trig_Melee_Initialization_Actions takes nothing returns nothing
    local integer i1 = 100
    local integer i2 = 1
    local real x
    local real y
    local real z
    loop
        exitwhen i2 > i1
        set x = GetRandomReal(GetRectMinX(bj_mapInitialPlayableArea), GetRectMaxX(bj_mapInitialPlayableArea))
        set y = GetRandomReal (GetRectMinY(bj_mapInitialPlayableArea),GetRectMaxY(bj_mapInitialPlayableArea))
        set z = GetRandomReal (500, 2000)
        call CreateDestructableZ ('DTes', x, y, z, 0, 1, 1) //'DTes': remember to replace that with the rawcode I told you about!
        set i2 = i2 + 1
    endloop
endfunction

//===========================================================================
function InitTrig_Melee_Initialization takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerAddAction( t, function Trig_Melee_Initialization_Actions )
endfunction

It will create stars at random points with random height.
Here is the result:
Example[Stars].jpg
Editor View:
EditorView.jpg

As you can see, you don't have to place anything at all.
 

fladdermasken

Off-Topic Moderator
Level 39
Joined
Dec 27, 2006
Messages
3,688
Shoot, that impressed the hell out of me. Thanks a bunch for your help, I'll try it later on :smile:
Might just ask another question while I'm at it; what model should I use if I want to create like water-reflections from moonlight? 2-p used a flat version of the holy rain model and I want something like that, however I want it to be white. Tried the monsoon model and it was perfect, except for the big messy clouds it created.
 
Last edited:
Your destructible must be based off "Egg Shack" to work. If you have a custom destructible (via copy paste), then press Ctrl + D in your editor to display values as raw data. Check what rawcode your destructible has (it will be something like B000); go back to the code and replace 'DTes' with the rawcode of your destructible. Make sure you place the rawcode (e.g. B000) within '': 'B000'.
 
Level 8
Joined
May 11, 2009
Messages
85
ok..
i fixed.. my model is based now on Egg Sack.
But .... still bad..
JASS:
function Trig_Melee_Initialization_Actions takes nothing returns nothing
    local integer i1 = 50000
    local integer i2 = 1
    local real x
    local real y
    local real z
    loop
        exitwhen i2 > i1
        set x = GetRandomReal(GetRectMinX(bj_mapInitialPlayableArea), GetRectMaxX(bj_mapInitialPlayableArea))
        set y = GetRandomReal (GetRectMinY(bj_mapInitialPlayableArea),GetRectMaxY(bj_mapInitialPlayableArea))
        set z = GetRandomReal (500, 2000)
        call CreateDestructableZ ('B001', x, y, z, 0, 1, 1) //'DTes': remember to replace that with the rawcode I told you about!
        set i2 = i2 + 1
    endloop
endfunction

//===========================================================================
function InitTrig_Melee_Initialization takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerAddAction( t, function Trig_Melee_Initialization_Actions )
endfunction

this is it... B001 ia based on Egg Sack 100%
I just changed the model....
Please PM me with your Msn. to help me via TeamViewer or something like this...
Thanks:)
Or maybe you can post here
 
Status
Not open for further replies.
Top