• 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.

[JASS] Simple Jass Question

Status
Not open for further replies.
Level 2
Joined
Jun 4, 2007
Messages
22
In my map, im using offset points in a region to create a whole room filled with objects/trees and such.

its come to my attention i might need to learn a little jass.

JASS:
function Trig_Setting_Varibles_Copy_Actions takes nothing returns nothing
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), 448.00, -480.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), 416.00, -480.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), 352.00, -480.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), 288.00, -480.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), 224.00, -480.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), 160.00, -480.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), 96.00, -480.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), 32.00, -480.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -32.00, -480.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -96.00, -480.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -160.00, -480.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -224.00, -480.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -288.00, -480.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -352.00, -480.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -384.00, -480.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -416.00, -480.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -480.00, -480.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -480.00, -416.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -480.00, -352.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -480.00, -288.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -480.00, -224.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -480.00, -160.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -480.00, -96.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -480.00, -32.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -480.00, 32.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -480.00, 96.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -480.00, 160.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -480.00, 224.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -480.00, 288.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -480.00, 352.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -480.00, 416.00), GetRandomDirectionDeg(), 1.00, 0 )
    call CreateDestructableLoc( 'B000', OffsetLocation(GetRectCenter(gg_rct_Blues_Left_Square), -480.00, 480.00), GetRandomDirectionDeg(), 1.00, 0 )
endfunction

//===========================================================================
function InitTrig_Setting_Varibles_Copy takes nothing returns nothing
    set gg_trg_Setting_Varibles_Copy = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Setting_Varibles_Copy, function Trig_Setting_Varibles_Copy_Actions )
endfunction



this was taken from my starting room and is created on start of map.

i was woundering in jass, can u have a varible equal a region? like

''Current Region=gg_rct_Red_Left_Square''

this could save alot of time, but i was seeing if its possible.
 
Level 2
Joined
Jun 4, 2007
Messages
22
I don't understand them!

=[


Teach me Purple!=P

yeah i think im gonna learn jass, it doesn't seem that hard. and it comes with alot more freedoms
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Well, basically, a loop would look something like this;

[jass=This goes in a function, local must be defined at the start]local integer i = 0
loop
exitwhen i > (some number)
//do something
set i = i + 1
endloop[/code]

So for example, say you wanted to create 20 destructables at their own locs of (32,100) then (64,100) and so on, you would create a destructable in the //do something part with position (32*i,100)

Does that make any sense?
 
Status
Not open for further replies.
Top