System Lag-free line-spawning system

LightChaosma

New Member
Reaction score
60
in the first loop, the one of 25, this is the one where is specified how many creeps each pleyer gets. in there is a loop of 8, 1 for each player, that checks if playeractive = 1 (true) and then spawns a creep at the designated place. in that loop is a unitgroup loop, for special attributs for the last spawned creep, to make it walk the right path, and for sme towers to trigger dummtskills

@dannyboydude
getting experience, well in very minor things, you try reading, yes im referring to chinese agian, chinese, and learn from it without a base knowledge. luckyly im pretty quikck understanding with codes, so i get what it sais, but i'm far from edeting it.
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Ok, updated initialization trigger.

JASS:
//*************************************************************************
//This sets all active players, and decides which waves spawn which units.*
//*************************************************************************

//**************************************************
//*This is where you can set the number of players.*
//**************************************************
globals                                          //*
constant integer Players = 8                     //*
endglobals                                       //*
// *************************************************                 


function Trig_Actions_05 takes nothing returns nothing
    set udg_Wave[1] = 'hpea'  //Peasant
    set udg_Wave[2] = 'hfoo'  //Footman
    set udg_Wave[3] = 'hkni'  //Knight
    set udg_Wave[4] = 'hrif'  //Rifleman
    set udg_Wave[5] = 'hmtm'  //Mortar Team
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 = Players 
    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


Added in a global for number of players, and said which Raw Codes are which units.
 

LightChaosma

New Member
Reaction score
60
using this i get 2 errors:
errorsxp1.jpg

didnt diable the wave setter trigger though, does that matter?

disabled them now. Wc3 refuses to open this map... i see it in the list, but it doesnt even show the player slots, it reqognizes 8 players, but thats about it
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
I said this earlier,

If it says undeclared variable, ignore it. It's just the vJass syntax.

It will still work, I just tested it.

And can I just use IntegerA and IntegerB instead of Spawn_int?
 

LightChaosma

New Member
Reaction score
60
no, there are other things using these, i made those vars becuz when these other triggers were fired during the spawning, the spawning ended. due to the wait...

EDIT:

read post above: i edited it, i'll send a screen
errors2xj3.jpg
the 2 players that you see are from a 2-player melle map i clicked earlier, if i click a 12 player map before this one, i get 12 players, and when i press start games, it does nothing
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
If you're using the 'Test Map' feature on NewGen, make sure the option 'Start War3 with Grimoire' option under Grimoire is disabled. This will mess you up if you use 'Test Map'.
 

LightChaosma

New Member
Reaction score
60
i know, i have that, i use test map, and then it just opens Wc3, not the map, WC3... wich is stragne on its own....
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Try opening Wc3 on your own, instead of 'Test Map', then try to make it. I've had this problem in NewGen b4.
 

dannyboydude

Ultra Cool Member
Reaction score
33
Ok if it shows you the main screen it means your trigger is bugged and not funtioning properly

Ren check the trigger for typo's or something
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
I just tested this on my own. It's all working fine. I had no errors.
 

LightChaosma

New Member
Reaction score
60
ok, i tried:
- start via wc3 - fail
- start via wc witch WE closed - fail
- disable the JASS you wrote - works > test map bit solved, it goes to the WC3 start screen because it cant start the map...

if thats true, my guess is that the bloean integer thing is bugging, lemme diable all my other triggers... will be a pain reworking those though...

EDIT!!!
NOTE>>> when i try to reenable your JASS it sais the following:

"the trigger player activeJASS must have an initialisation function called: InitTrig_active_playerJASS" (i neamed the trigger active playerJASS
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
It's working on mine, I don't know where this is going wrong.

It might me your map that's crashing, can you send me a link to your map? I'll see what's going wrong.
 

LightChaosma

New Member
Reaction score
60
i just edited my above post, maybe thats something?
will send map in a bit, hold on

EDIT: the name means: copy of ...
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Here, you forgot to change the InitTrig to the name of your trigger, and you didn't add in new variables.
 

LightChaosma

New Member
Reaction score
60
add in new variables? where did i need to, it was already correct, 8 players..

ima leave the unit types like this till i'm sure itll work..

but, i must say aftyer looking at it for like 2 hours, made me understand JASS, thx for that in advance:D
 

Flare

Stops copies me!
Reaction score
662
Wee bit of optimization on Renendaru's trigger :p
JASS:
//*************************************************************************
//This sets all active players, and decides which waves spawn which units.*
//*************************************************************************

//**************************************************
//*This is where you can set the number of players.*
//**************************************************
scope GiveItAName initializer InitFunc
globals                                          //*
constant integer Players = 8                     //*
//Gonna swap udg_ globals for vJASS globals, much easier for importing and much nicer looking =D
integer array UnitId
boolean array Active
endglobals                                       //*
// *************************************************                 


function ArraySetup takes nothing returns nothing
    set UnitId[1] = 'hpea'  //Peasant
    set UnitId[2] = 'hfoo'  //Footman
    set UnitId[3] = 'hkni'  //Knight
    set UnitId[4] = 'hrif'  //Rifleman
    set UnitId[5] = 'hmtm'  //Mortar Team
endfunction

//No more lame GUI If condition func <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick Out Tongue    :p" loading="lazy" data-shortname=":p" />

function Trig_Actions_04 takes nothing returns nothing
local integer i = 0
    loop
        exitwhen i == Players
        if GetPlayerSlotState(Player (i)) == PLAYER_SLOT_STATE_PLAYING then //And instead of lame GUI If condition, we&#039;ll just put it here and use a local
            set Active<i> = true
        else
            set Active<i> = false
        endif
        set i = i + 1
    endloop
    call DisableTrigger( GetTriggeringTrigger() )
endfunction

//===========================================================================
private function InitFunc takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerAddAction( t, function Trig_Actions_04 )
//And array setup (no point defining the array values everytime the trigger fires)
    call ArraySetup ()
endfunction</i></i>


"the trigger player activeJASS must have an initialisation function called: InitTrig_active_playerJASS"
Just ignore that :p Grimoire (I think) is supposed to take care of those errors being displayed, but it doesn't actually have any effect, assuming you're using NewGen
 

LightChaosma

New Member
Reaction score
60
im getting told to ignore a bunch of errors here.... well ok, thx for the update flare.

FLARE, a question, in my wave trigger do i have to make a ne variable called unitID to make it work?
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Well Flare can clean this next one too I guess. I use the GUI stuff cause it really works all the same. There's a tiny bit of speed difference, but I"m not into advanced stuff yet.
 

LightChaosma

New Member
Reaction score
60
trigger not working (rend's version)

i already made it bloean, but it destroys all units, even the onces from active players...

Code:
remove player buildings
    Events
        Map initialization
    Conditions
    Actions
        For each (Integer A) from 1 to 8, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ActivePlayer[(Integer A)] Equal to False
                    Then - Actions
                        Set temp_unitG[1] = (Units owned by (Player((Integer A))))
                        Unit Group - Pick every unit in temp_unitG[1] and do (Actions)
                            Loop - Actions
                                Unit - Kill (Picked unit)
                        Custom script:   call DestroyGroup (udg_temp_unitG[1])
                    Else - Actions
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Make the event, 'Elasped time is 0.00 seconds'.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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