HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Disable Neutral Creeps Guard Behavior

03-22-2007, 09:35 AM#1
Bsycho
i have some issues giving orders to neutral units as they return to their creep camp after a certain distance/time.

im still using creep camps on other spots, so i cant simply change the gameplay constants.

i already tried
ui trigger: AI - Ignore (unit)'s guard position
jass: Custom script: call SetUnitCreepGuard(GetLastCreatedUnit(),false)

neither one worked for me. i dont use jass usually, so i might have done some mistake there. already searched forums and trying to fix this problem for a couple of days but no progress at all.

some1 plz help me =)
03-22-2007, 10:19 AM#2
StockBreak
When I have to deal with giving orders to creeps I normally use an additional player (for example player brown) as creeps owner.
03-22-2007, 05:03 PM#3
Bsycho
i would do that, but im already using all 12 slots for human players :\
03-22-2007, 05:20 PM#4
Skater
Look: Advanced-->
Guard Distance
Guard Return Distance
Guard Return Time (sec)
Radius to Notice Building Construction
Radius to Notice Neutral Building Use

If you set this to highest, it should work.
03-22-2007, 06:38 PM#5
Bsycho
Quote:
Originally Posted by Bsycho
im still using creep camps on other spots, so i cant simply change the gameplay constants.
03-22-2007, 07:40 PM#6
Earth-Fury
Ok... Im gonna try to code a system for using 12 players slots, and havign 2 additional players AND creeps... This question is starting to get on my nerves.

Edit: Attatched what i've got so far. Needs VJass. Check the map header for the code.
Attached Files
File type: w3xCREEPSYSTEM.w3x (15.3 KB)
03-25-2007, 10:17 AM#7
Bsycho
it works! i really appreciate ur help, maybe i can get one jasser to implement it into my map .

although im not good in jass at all, i unterstand most of the codes and will try to rebuild in jass to fit my map.
so you helped me either way, thx a lot

edit:
maybe u want to look at my triggers. they are probably not very smooth but gui (something i can handle ) and do work so far.

Code:
init
    Events
        Map initialization
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
            Loop - Actions
                Set creepguardloc[creepcounter] = (Position of (Picked unit))
                -------- location will be removed if unit dies --------
                Set creepguarddistance[creepcounter] = 600.00
                Set creepreturntime[creepcounter] = 5
                Unit - Set the custom value of (Picked unit) to creepcounter
                Set creepcounter = (creepcounter + 1)

Code:
return
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Set neutralcreeps = (Units in (Playable map area) owned by Neutral Hostile)
        Unit Group - Pick every unit in neutralcreeps and do (Actions)
            Loop - Actions
                Set creeptemploc = (Position of (Picked unit))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Distance between creepguardloc[(Custom value of (Picked unit))] and creeptemploc) Greater than 600.00
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                creepreturntimer[(Custom value of (Picked unit))] Greater than creepreturntime[(Custom value of (Picked unit))]
                            Then - Actions
                                Set creepreturntimer[(Custom value of (Picked unit))] = 0
                                Unit - Order (Picked unit) to Move To creepguardloc[(Custom value of (Picked unit))]
                            Else - Actions
                                Set creepreturntimer[(Custom value of (Picked unit))] = (creepreturntimer[(Custom value of (Picked unit))] + 1)
                    Else - Actions
                Custom script: call RemoveLocation(udg_creeptemploc)
        Custom script: call DestroyGroup(udg_neutralcreeps)

last thing to do is to care about respawned neutrals but will be accomplishable.
tell me if you see something to improve