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.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top