• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Is this too much processing?

Status
Not open for further replies.
Level 4
Joined
Aug 12, 2004
Messages
76
The problem here is that whenever a certain trigger is activated, all the players drop.

So I was wondering, is this too much processing?

This all begins once units begin to spawn.
Wave 1 in my trigger


Can anyone tell me if this is the case or something else is going on?

This starts with
Gate Destroy
Which then triggers Wave 1

That is when the players drop.

Is there something wrong with my map?
Thanks!
 

Attachments

  • Crusade 0.0.1.w3x
    279.6 KB · Views: 51
JASS:
// 1 Greater Voidwalker
// 4 Voidwalker
// 9 Lesser Voidwalker
 
// Undead Summons
 
// 1 Fel Ravager
// 7 Fel Stalker
// 9 Fel Beast
//===========================================================================
 
function Trig_Wave_1_Actions takes nothing returns nothing
    local integer i = 0
    local rect r = udg_Spawn_Undead_Weak[GetRandomInt(0,2)]
    local real x = GetRectCenterX(r)
    local real y = GetRectCenterY(r)
    local player p = Player(9)
//*
//* Void Walkers
//*
    call TriggerSleepAction(2.)
    call CreateUnit(p,'nvdg',x,y,270.)
    loop
        call CreateUnit(p,'nvdw',x,y,270.)
        call TriggerSleepAction(0.75)
        exitwhen i == 3
        set i = i + 1
    endloop
 
    set i = 0
    loop
        call CreateUnit(p,'nvdl',x,y,270.)
        call TriggerSleepAction(0.75)
        exitwhen i == 8
        set i = i + 1
    endloop
    call TriggerSleepAction(GetRandomReal(15.,28.))
//*
//* Fel Stalker
//*
    set r = udg_Spawn_Undead_Weak[GetRandomInt(0,2)]
    set x = GetRectCenterX(r)
    set y = GetRectCenterY(r)
    call CreateUnit(p,'npfm',x,y,270.)
 
    set i = 0
    loop
        call CreateUnit(p,'nfel',x,y,270.)
        call TriggerSleepAction( 0.75 )
        exitwhen i == 6
        set i = i + 1
    endloop
 
    set i = 0
    loop
        call CreateUnit(p,'npfl',x,y,270.)
        call TriggerSleepAction(0.75)
        exitwhen i == 8
        set i = i + 1
    endloop
    call TriggerSleepAction(GetRandomReal(40.,60.))
    call ConditionalTriggerExecute( gg_trg_Wave_2 )
endfunction
 
//===========================================================================
function InitTrig_Wave_1 takes nothing returns nothing
    set gg_trg_Wave_1 = CreateTrigger()
    call DisableTrigger(gg_trg_Wave_1)
    call TriggerAddAction(gg_trg_Wave_1,function Trig_Wave_1_Actions)
endfunction
 
Level 4
Joined
Aug 12, 2004
Messages
76
Does this mean that it works as long as I don't use integer loop A or integer loop B?

So it will be okay if I use some other global variable like Temp_Spawn_Int? So, something specifically allocated to spawning these units?
 
Here, I'll make it easier for you.

At the top of your map (Where it says Crusade.w3x), click that. There is a place to enter custom script. Insert this custom script there:

JASS:
function CreateUnitsTimed takes location loc,integer count,integer rawcode returns nothing
    local real x = GetLocationX(loc)
    local real y = GetLocationY(loc)
    local integer i = 0
    local player p = Player(9)
    call RemoveLocation(loc)
 
    loop
        call CreateUnit(p,rawcode,x,y,270.)
        set i = i + 1
        exitwhen i == count
        call TriggerSleepAction(0.75)
    endloop
endfunction

Whenever you want a group of units, type this in a custom script box:

  • Custom script: call CreateUnitsTimed(udg_location,#OfUnits,UnitRawcode)
Whereas udg_location is the point you spawn at, #OfUnits replace that with the number you want to make, and then view the Object Editor rawcode of the unit you want to replace "UnitRawCode" with it.

It will create one new unit every 0.75 seconds for Player 10, just like yours, but this time you won't have glitches. Here is an example that creates 10 footmen:

  • Set tempSpawn = Center of Region < gen >
  • Custom script: call CreateUnitsTimed(udg_tempSpawn,10,'hfoo')
Note: because you're using wait commands, I have to remove "tempSpawn" in my function in case you set it to something else during that time (like if another trigger needs it). So, before you call each of these custom scripts, just remember to re-set "tempSpawn". Delete your "custom script: call RemoveLocation(udg_tempSpawn)" commands, of course.
 
Level 4
Joined
Aug 12, 2004
Messages
76
Thanks for the script!

However, I still want to know if this will work.

The thing is, I have tempSpawn location as only spawn specific. Also, if I set an integer solely designated for the loop say Spawn_integer, will it work?

I was wondering because since the trigger is read top down, the wait function will continuously work and since no other trigger uses tempSpawn except for that trigger where it is read top down, there will be no time when the triggers are interfering with each other. Also, similarly, the Spawn_integer will solely used for this loop and therefore will not be interfered.

So, will this work? Or will it still drop everyone?
 
Status
Not open for further replies.
Top