Jump to content

Welcome to Gaming On Steroids Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account
Photo

Error when trying to seperate minion objects by name

minion object getobjectname getobjectbasename

  • Please log in to reply
1 reply to this topic

#1
zachphantom

zachphantom

    Newbie

  • Members
  • 6 posts

so I am having an issue when trying to sort objects of type Obj_AI_Minion into jungle minions and lane minions.  essentially what happens is some jungle minions will be treated as lane minions, these jungle camps seem to be random, but applies only the the smaller creeps at camps and gromp, but not to baron, skuttle, or dragon.  (hapens to SRU_MurkwolfMini, SRU_RazorbeakMini, SRU_KrugMini, SRU_RedMini, SRU_BlueMini) below is my code for sorting each object: ListJungle appends the object to an array named jungle, ListMinion appends the object to an array named minion

OnObjectLoad(function(o) ListObj(o) end)
OnCreateObj(function(o) ListObj(o) end)

function ListObj(o)
    if(o) then
        if (GetObjectType(o) == Obj_AI_Hero) then ListChamp(o)
        elseif (GetObjectType(o) == Obj_AI_Minion) then
            if(GetObjectName(o):find("Krug") or GetObjectBaseName(o):find("Krug")) or
                (GetObjectName(o):find("Razorbeak") or GetObjectBaseName(o):find("Razorbeak")) or
                (GetObjectName(o):find("Murkwolf") or GetObjectBaseName(o):find("Murkwolf")) or
                (GetObjectName(o):find("Gromp") or GetObjectBaseName(o):find("Gromp")) or
                (GetObjectName(o):find("Red") or GetObjectBaseName(o):find("Red")) or
                (GetObjectName(o):find("Blue") or GetObjectBaseName(o):find("Blue")) or
                (GetObjectName(o):find("Crab") or GetObjectBaseName(o):find("Crab")) or
                (GetObjectName(o):find("Baron") or GetObjectBaseName(o):find("Baron")) or
                (GetObjectName(o):find("Dragon") or GetObjectBaseName(o):find("Dragon")) then
                ListJungle(o)
            else
                ListMinion(o)
            end
        end
    end
end

full source can be found here: http://pastebin.com/EgRz6c9c


  • 0

#2
Inspired

Inspired

    Took the red pill.

  • Ex-Core Dev
  • PipPipPip
  • 723 posts
  • LocationWonderland
try GetTeam(o) == 300
  • 0





Also tagged with one or more of these keywords: minion, object, getobjectname, getobjectbasename

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users