• 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.

I need help with this map

Status
Not open for further replies.
Level 1
Joined
Jul 23, 2010
Messages
5
I am trying to make some sort of an orc RPG (or whatever it's called) The problem is the new jass I added. It is from another toturial map called Ryoko's Heroes creeps and items 2. But when I imported the creep revival system it doesn't work. It just chrashes the map. The map works when I disable that jass but not while active. I figuered that I had done something wrong and therefore posted here. Can somebody with jass knowledge make the orcs respawn after X time with same unit on the same location? also credits to creatores of UTM and the_witcher for the cam system
 

Attachments

  • orc RPG F.w3x
    4.3 MB · Views: 64
Level 1
Joined
Jul 23, 2010
Messages
5
Sorry, here's the triggers. The first one is GUI and the second is jass
=================================================
INIT Store Creeps
Events
Map initialization
Time - Elapsed game time is 2.00 seconds
Conditions
Actions
Set Loop = 0
Unit Group - Pick every unit in (Units owned by Neutral Hostile) and do (Actions)
Loop - Actions
Set Creep_Type[Loop] = (Unit-type of (Picked unit))
Set Creep_Position[Loop] = (Position of (Picked unit))
Unit - Set the custom value of (Picked unit) to Loop
Set Loop = (Loop + 1)
Destructible - Pick every destructible in (Playable map area) and do (Actions)
Loop - Actions
Destructible - Open All walls of (Picked destructible)
=====================================================
function Trig_Revive_Creeps_Actions takes nothing returns nothing
local integer CUSTOM
set CUSTOM = GetUnitUserData(GetDyingUnit())
call TriggerSleepAction( 60.00 )
call CreateNUnitsAtLoc( 1, udg_Creep_Type[CUSTOM], Player(PLAYER_NEUTRAL_AGGRESSIVE), udg_Creep_Position[CUSTOM], bj_UNIT_FACING )
call SetUnitUserData( GetLastCreatedUnit(), CUSTOM )
endfunction

//===========================================================================
function InitTrig_Revive_Creeps takes nothing returns nothing
set gg_trg_Revive_Creeps = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Revive_Creeps, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Revive_Creeps, function Trig_Revive_Creeps_Actions )
endfunction
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Next time, use "[trigger] [/trigger]" and "[code=jass] [/code]", please.
The first one is for GUI triggers, the second for JASS.


  • INIT Store Creeps
    • Events
      • Map initialization
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • Set Loop = 0
      • Unit Group - Pick every unit in (Units owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
          • Set Creep_Type[Loop] = (Unit-type of (Picked unit))
          • Set Creep_Position[Loop] = (Position of (Picked unit))
          • Unit - Set the custom value of (Picked unit) to Loop
          • Set Loop = (Loop + 1)
      • Destructible - Pick every destructible in (Playable map area) and do (Actions)
        • Loop - Actions
          • Destructible - Open All walls of (Picked destructible)
JASS:
function Trig_Revive_Creeps_Actions takes nothing returns nothing
    local integer CUSTOM
    set CUSTOM = GetUnitUserData(GetDyingUnit())
    call TriggerSleepAction( 60.00 )
    call CreateNUnitsAtLoc( 1, udg_Creep_Type[CUSTOM], Player(PLAYER_NEUTRAL_AGGRESSIVE), udg_Creep_Position[CUSTOM], bj_UNIT_FACING )
    call SetUnitUserData( GetLastCreatedUnit(), CUSTOM )
endfunction

//===========================================================================
function InitTrig_Revive_Creeps takes nothing returns nothing
    set gg_trg_Revive_Creeps = CreateTrigger(  )
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_Revive_Creeps, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddAction( gg_trg_Revive_Creeps, function Trig_Revive_Creeps_Actions )
endfunction

I can tell you that it is very badly coded (leaks a unit group, uses BJ's where it isn't necessary), but I won't bore you with that.
The JASS itself is 'correct' (although not optimal).


Okay, the crash was different than expected (I expected it to crash happened when you saved the map).

Okay, the cause is the loop at the end.
You loop through all doodads (about 1300 of them) and release a massive function on them for no apparant reason.
This last function creates the lag (calling over 1300 functions without any time in between generates a lot of lag, resulting in a crash).

Since you only have one wall (as far as I could see), the simple solution is this:

  • INIT Store Creeps
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • Set Loop = 0
      • Set TempGroup = (Units owned by Neutral Hostile)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set Creep_Type[Loop] = (Unit-type of (Picked unit))
          • Set Creep_Position[Loop] = (Position of (Picked unit))
          • Unit - Set the custom value of (Picked unit) to Loop
          • Set Loop = (Loop + 1)
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Destructible - Open All walls of |cffff0000Fortress gate|r 0000 <gen>
1) I Removed the init event (useless).
2) I Fixed the memory leak.
3) I removed the last loop and replaced it with the single function.
 
Last edited:
Level 3
Joined
Jul 13, 2010
Messages
46
when you use advanced jass the map might need a newer patch to play.this may happen even with some actions that can be done with GUI.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
when you use advanced jass the map might need a newer patch to play.this may happen even with some actions that can be done with GUI.
Uhh? I don't think there were any JASS additions (apart from GetSpellTargetX/Y), there were some GUI additions though (hashtables).

But well: if you don't have the newest patch, then you shouldn't download spells, if a spell doesn't work because you don't have the latest patch: that's your own problem.
I really don't think this is the problem though.
 
Level 3
Joined
Jul 13, 2010
Messages
46
Uhh? I don't think there were any JASS additions (apart from GetSpellTargetX/Y), there were some GUI additions though (hashtables).

But well: if you don't have the newest patch, then you shouldn't download spells, if a spell doesn't work because you don't have the latest patch: that's your own problem.
I really don't think this is the problem though.

no it's not only for the spells which use some advenced commands.i have th patch 1.21b and a simple "call createNUnitsAtLoc" command would make the present map unavailable to play.btw what patch do you got?
 
Status
Not open for further replies.
Top