• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Map Problems :(

Status
Not open for further replies.
Level 3
Joined
Oct 18, 2009
Messages
51
Im making a map and i have a problem:

Firstly, i want it to be that when i enter a maze/dungeon then a trigger will spawn the mosnters... and if i exit it will make all the left over monsters disappear :( i have these trigs so far:
This one works:
  • SpawnWolves
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set CreepNumber2 = (CreepNumber2 + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CreepNumber2 Equal to 1
        • Then - Actions
          • Unit - Create 3 Snow Wolf for Player 11 (Dark Green) at (Random point in Dung2ComOut <gen>) facing Default building facing degrees
          • Unit - Create 1 Boss Wolfe for Player 11 (Dark Green) at (Random point in Dung2Out <gen>) facing Default building facing degrees
          • Unit - Create 4 Snow Wolf for Player 11 (Dark Green) at (Random point in Dung2ComOut <gen>) facing Default building facing degrees
          • Unit - Create 3 Snow Wolf for Player 11 (Dark Green) at (Random point in Dung2ComOut <gen>) facing Default building facing degrees
          • Unit - Create 4 Snow Wolf for Player 11 (Dark Green) at (Random point in Dung2ComOut <gen>) facing Default building facing degrees
        • Else - Actions
          • Do nothing
and
  • Kill Wolves
    • Events
      • Unit - A unit leaves Dung2ComOut <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Dungeoneer
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 1 (Red))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 2 (Blue))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 3 (Teal))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 4 (Purple))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 5 (Yellow))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 6 (Orange))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 7 (Green))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 8 (Pink))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 9 (Gray))) Equal to 0
        • Then - Actions
          • Unit Group - Pick every unit in (Units in Dung2ComOut <gen>) and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
        • Else - Actions
          • Do nothing
And i used one of the triggers that SD_Ryoko suggested (in his/er tuts)
which is:
  • 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)
and

JASS:
function Trig_Revive_Creeps_Actions takes nothing returns nothing
    local integer CUSTOM
    set CUSTOM = GetUnitUserData(GetDyingUnit())
    call TriggerSleepAction( 10.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

:(

And also, is there a way to make the units stay at one spot? because they can see through the trees... (WHY?) without Camping?
Anyone know why they dont work? (if you want map then i will upload it)
 
Level 3
Joined
Oct 18, 2009
Messages
51
I did...
  • Unit Group - Pick every unit in (Units in Dung2ComOut <gen>) and do (Actions)
And -out doesnt work...
  • ComOut
    • Events
      • Player - Player 1 (Red) types a chat message containing -out as An exact match
      • Player - Player 2 (Blue) types a chat message containing -out as An exact match
      • Player - Player 3 (Teal) types a chat message containing -out as An exact match
      • Player - Player 4 (Purple) types a chat message containing -out as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -out as An exact match
      • Player - Player 6 (Orange) types a chat message containing -out as An exact match
      • Player - Player 7 (Green) types a chat message containing -out as An exact match
      • Player - Player 8 (Pink) types a chat message containing -out as An exact match
      • Player - Player 9 (Gray) types a chat message containing -out as An exact match
    • Conditions
    • Actions
      • Unit - Move (Target unit of issued order) instantly to (Center of Town2 <gen>)
and how do i make the Enemies Auto computers?
 
Level 9
Joined
Oct 11, 2009
Messages
477
In the SpawnWolves trigger, change the loop condition to "CreepNumber2 Greater than or Equal to 1" because you add 1 to the variable CreepNumber2, if you use the previous condition, the wolves will only spawn one time. And for the Kill Wolves trigger, create a custom script line before the Unit Group function that reads set bj_wantDestroyGroup = true or store the Unit Group into a Unit Group variable and destroy it manually by creating a custom script line at the end of the loop by that reads "call DestroyGroup(udg_<name of your Unit Group variable>)".Do not add or remove any text in the custom script or it will ruin the whole trigger except for the text <name of your Unit Group variable>, because this corresponds to the Unit Group variable that you have destroyed. You need to destroy the Unit Group to avoid leaks.

And finally in the third trigger, do not use Map Initialization and Timed events because even if you created hundreds of events, it will always respond to the Map Initialization event, better creating another trigger for the Timed event.
 
Level 3
Joined
Oct 18, 2009
Messages
51
For the bj_wantDestroyGroup = true it said "Expected 'then' "
This is the trigger now:
  • Kill Wolves
    • Events
      • Unit - A unit leaves Dung2ComOut <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Dungeoneer
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 1 (Red))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 2 (Blue))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 3 (Teal))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 4 (Purple))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 5 (Yellow))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 6 (Orange))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 7 (Green))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 8 (Pink))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 9 (Gray))) Equal to 0
        • Then - Actions
          • Custom script: bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in Dung2ComOut <gen>) and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
        • Else - Actions
          • Do nothing
it has been disabled due to errors
maybe i should do this?:
  • Kill Wolves
    • Events
      • Unit - A unit leaves Dung2ComOut <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Dungeoneer
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 1 (Red))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 2 (Blue))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 3 (Teal))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 4 (Purple))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 5 (Yellow))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 6 (Orange))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 7 (Green))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 8 (Pink))) Equal to 0
          • (Number of units in (Units in Dung2ComOut <gen> owned by Player 9 (Gray))) Equal to 0
        • Then - Actions
          • Unit Group - Pick every unit in (Units in Dung2ComOut <gen>) and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
          • Custom script: bj_wantDestroyGroup = true
        • Else - Actions
          • Do nothing
if i do that (second trig) then it says "Expected 'set' "
And the Revive Creeps (the jass with the
JASS:
TriggerSleepAction( 10.00 )
doesnt respawn the creep after 10 seconds)

(i really appreciate the help :] )
 
Level 3
Joined
Oct 18, 2009
Messages
51
thank you :) will do later.. when my sis is off the pc -.- lol THANKS!~!!!

Another problem that i have is about quests...
I tried making a Sellable quest with the (deleted) triggers like..

(Events)
A unit acquires an item
(Conditions)
Item type is Item1
(Actions)
Remove item
Add quest
Play effect

Etc... and it didnt work.. :( how can i do quests then? that you can chose which ones
 
Last edited:
Level 3
Joined
Oct 18, 2009
Messages
51
Bump?
The trigger for killing a unit if its in a distanc doesnt work :(
here are the two trigs:
  • UnitDeathLight
    • Events
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units of type DeathLight) and do (Actions)
        • Loop - Actions
          • Trigger - Add to KillLightHero <gen> the event (Unit - A unit comes within 100.00 of (Picked unit))
then
  • KillLightHero
    • Events
    • Conditions
    • Actions
      • Unit - Kill (Triggering unit)
 
Level 3
Joined
Oct 18, 2009
Messages
51
ah.. ok.. will do :)

Is there any way to make quests? that you can "buy" or single user quests?
(i tried quest tuts... didnt find useful ones yet)

@Sephiroth IT WORKS!! thank you :)
 
Status
Not open for further replies.
Top