System Lag-free line-spawning system

LightChaosma

New Member
Reaction score
60
when did you learn to speak chinese?:p (sarcasm)

P.S.
since i know nothing about jass, i have 1 question, these vars you set in JASS, mainly playeractive, are still useable for other GUI triggers right?

cause i use that one quite often...
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Alright, and make sure you use NewGen. I'm using vJass, for the locals.

Player Active only.

JASS:
function Trig_Func_03 takes nothing returns boolean
    if ( not ( GetPlayerSlotState(ConvertedPlayer(GetForLoopIndexA())) == PLAYER_SLOT_STATE_PLAYING ) ) then
        return false
    endif
    return true
endfunction

function Trig_Actions_04 takes nothing returns nothing
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 8
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        if ( Trig_Func_03() ) then
            set udg_ActivePlayer[GetForLoopIndexA()] = true
        else
            set udg_ActivePlayer[GetForLoopIndexA()] = false
        endif
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    call DisableTrigger( GetTriggeringTrigger() )
endfunction

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


Wave Initialization and Player Active.

JASS:
//This is the Map Initialization Trigger, I combined both the initializing Waves, and
//finding active players.


function Trig_Actions_05 takes nothing returns nothing
    set udg_Wave[1] = 'hpea'
    set udg_Wave[2] = 'hfoo'
    set udg_Wave[3] = 'hkni'
    set udg_Wave[4] = 'hrif'
    set udg_Wave[5] = 'hmtm'
endfunction

function Trig_Func_03 takes nothing returns boolean
    if ( not ( GetPlayerSlotState(ConvertedPlayer(GetForLoopIndexA())) == PLAYER_SLOT_STATE_PLAYING ) ) then
        return false
    endif
    return true
endfunction

function Trig_Actions_04 takes nothing returns nothing
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 8
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        if ( Trig_Func_03() ) then
            set udg_ActivePlayer[GetForLoopIndexA()] = true
        else
            set udg_ActivePlayer[GetForLoopIndexA()] = false
        endif
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    call DisableTrigger( GetTriggeringTrigger() )
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_004 takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerAddAction( t, function Trig_Actions_04 )
    call TriggerAddAction( t, function Trig_Actions_05 )
endfunction
 

LightChaosma

New Member
Reaction score
60
i cant get newgen to work... i even tried using it directlly from my wc3 folder... all you have to is unzip they say, or am i wrong?
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
You have to have a v1.21 World Editor, tell me if you need one. If not, try re-dling it.
 

LightChaosma

New Member
Reaction score
60
i think i have 1.22, or the latest one anyway, just updated throug logging into Bnet. ill look around a min, if i cant find anything, ill tell.

P.S. coul dyou answer the question i made a few posts above? about reusiing vars in GUI
 

LightChaosma

New Member
Reaction score
60
i'd prefer not boleans... that would kinda mean reworking my entire map... there are trigger where i chek if playerachtive 1+ playeractive 2 = 2... cant do that with like that... and there is a bunch of other math stuff where i use these...

i found it on one of your other pots ;)
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
I was using it to improve your spawn trigger, I'm putting in a way for someone to disable the extra features using a boolean too.
 

LightChaosma

New Member
Reaction score
60

dannyboydude

Ultra Cool Member
Reaction score
33
Ren im not a proper jasser but

Wouldnt using custom loops
Be much easier than bj_forloop Sh1t?

JASS:
local integer i = 1
loop
   exitwhen i = 8
   set udg_PlayerPlaying<i> = true 
   set i = i + i</i>
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
@Chaosma: If it says undeclared variable, ignore it. It's just the vJass syntax.


@Danny: But you can't really carry a local across, unless you use structs. I think at least.
 

dannyboydude

Ultra Cool Member
Reaction score
33
Well why would you want to carry across a local ?

Just create a new i and use it for the loops ?

Simple enough right ?
 

LightChaosma

New Member
Reaction score
60
ignoring that errow will be hard since W3 wont even display it my map list anymore...

if you need more info ill post a screen, cus this is chinese to me as you prolly know

P.S. this is only the first one you post, so only the player detection
 

dannyboydude

Ultra Cool Member
Reaction score
33
Lol it was chinease to me and a bit of french

Im like getting the hang of what stuff does but its stil lconfusing enough
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
You can't really across a local, and set it to i at the same time, otherwise i is overwritten and the syntax doesn't like that.
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
I'm going to put in globals at the top, so configuration is much easier.

Update: I'm working on the spawn trigger right now but I don't quit get what's going on near the bottom of the trigger.
 

LightChaosma

New Member
Reaction score
60
just stop right there, i just thought of something, the wave trigger is incomplete

this is the one i use:
Code:
wave
    Events
        Time - Next_wave expires
    Conditions
    Actions
        Set wave = (wave + 1)
        Game - Display to (All players) the text: (Wave  + (String(wave)))
        Set costum[1] = 1
        Set costum[2] = 1
        Set costum[3] = 2
        Set costum[4] = 2
        Set costum[5] = 3
        Set costum[6] = 3
        Set costum[7] = 4
        Set costum[8] = 4
        Set angle[1] = 0.00
        Set angle[2] = 180.00
        Set angle[3] = 270.00
        Set angle[4] = 90.00
        Set angle[5] = 180.00
        Set angle[6] = 0.00
        Set angle[7] = 90.00
        Set angle[8] = 270.00
        For each (Integer spawn_int[1]) from 1 to 25, do (Actions)
            Loop - Actions
                Wait 0.20 game-time seconds
                For each (Integer spawn_int[2]) from 1 to 8, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                player_active[spawn_int[2]] Equal to 1
                            Then - Actions
                                Set temp_point[1] = (Center of spawn_region[spawn_int[2]])
                                Unit - Create 1 Wave_type[wave] for Player 9 (Gray) at temp_point[1] facing angle[spawn_int[2]] degrees
                                Custom script:   call RemoveLocation(udg_temp_point[1])
                                Set temp_unitG[1] = (Units in spawn_region[spawn_int[2]] owned by Player 9 (Gray))
                                Unit Group - Pick every unit in temp_unitG[1] and do (Actions)
                                    Loop - Actions
                                        Unit - Set the custom value of (Picked unit) to costum[spawn_int[2]]
                                        Unit - Turn collision for (Picked unit) Off
                                        Unit - Change color of (Picked unit) to (Color of (Player(spawn_int[2])))
                                        Unit - Make (Picked unit) Explode on death
                                        Trigger - Add to ice ability <gen> the event (Unit - (Last created unit) Takes damage)
                                        Trigger - Add to lightning ability <gen> the event (Unit - (Last created unit) Takes damage)
                                        Trigger - Add to fire ability <gen> the event (Unit - (Last created unit) Takes damage)
                                Custom script:   call DestroyGroup (udg_temp_unitG[1])
                            Else - Actions

what part do you mean, the things in the unitgroup?
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
I'm talking about the part where it spawns, what's supposed to be happening? You have alot of Forloop's.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top