• 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] Creep Respawn Bug

Status
Not open for further replies.
Level 10
Joined
Feb 20, 2008
Messages
448
There a script that my friend made in vjass, this script is incomplete somehow, i cannot save it in JNGP say doesnt have an int o_O wich is weird since its vjass...

My system gotta be able to revive unit added before and after int!!!at least at int -_-, this type of system failed in GUI and suck in jass so its need Vjass

help would be need +rep alway gived :D


JASS:
scope CreepRevival initializer Init
    globals
        private group Revivables = CreateGroup()
    endglobals
    private struct Revive
        real x
        real y
        integer Id
        real f
        player own
    private function Revive takes nothing returns nothing
        local unit u = GetTriggerUnit()
        local unit n
        local Revive dat = GetUnitUserData(u)
        call TriggerSleepAction(5)
        set n = CreateUnit(dat.own, dat.Id, dat.x, dat.y, dat.f)
        call SetUnitUserData(n, dat)
        set u = null
        set n = null
    endfunction
    private function Conditions takes nothing returns boolean
       return true // set your condition here
    private function Set takes nothing returns nothing
        local Revive dat = Revive.allocate()
        local unit u = GetEnumUnit()
        set dat.x = GetUnitX(u)
        set dat.y = GetUnitY(u)
        set dat.f = GetUnitFacing(u)
        set dat.Id = GetUnitTypeId(u)
        set dat.own = GetOwningPlayer(u)
        set u = null
    private function Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        local integer i = 0
        loop
            exitwhen i > 15
            call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_DEATH)
            set i = i + 1
        endloop
        set Revivables = GroupEnumUnitsInRect(Revivables, bj_mapInitialPlayableArea, Condition(function Conditions))
        call ForGroup(Revivables, function Set)
        call TriggerAddAction(t, function Revive)
    endfunction
endscope
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
JASS:
private struct Revive
        real x
        real y
        integer Id
        real f
        player own
wtf where is the endstruct? You are also missing the endfunction is several functions.

dont forget the functions, he also forgot 2 endfunctions.
EDIT: Forgive me, i forgot to read teh whole post, xxdingo93xx already also mentioned the enfunctions
JASS:
scope CreepRevival initializer Init
    globals
        private group Revivables = CreateGroup()
    endglobals
    private struct Revive
        real x
        real y
        integer Id
        real f
        player own
    // endstruct
    private function Revive takes nothing returns nothing
        local unit u = GetTriggerUnit()
        local unit n
        local Revive dat = GetUnitUserData(u)
        call TriggerSleepAction(5)
        set n = CreateUnit(dat.own, dat.Id, dat.x, dat.y, dat.f)
        call SetUnitUserData(n, dat)
        set u = null
        set n = null
    endfunction
    private function Conditions takes nothing returns boolean
       return true // set your condition here
    // endfunction
    private function Set takes nothing returns nothing
        local Revive dat = Revive.allocate()
        local unit u = GetEnumUnit()
        set dat.x = GetUnitX(u)
        set dat.y = GetUnitY(u)
        set dat.f = GetUnitFacing(u)
        set dat.Id = GetUnitTypeId(u)
        set dat.own = GetOwningPlayer(u)
        set u = null
    // endfunction
    private function Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        local integer i = 0
        loop
            exitwhen i > 15
            call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_DEATH)
            set i = i + 1
        endloop
        set Revivables = GroupEnumUnitsInRect(Revivables, bj_mapInitialPlayableArea, Condition(function Conditions))
        call ForGroup(Revivables, function Set)
        call TriggerAddAction(t, function Revive)
    endfunction
endscope
 
Status
Not open for further replies.
Top