Hero inventory is full equal to false? Such thing

Im_On_56k

Hm...
Reaction score
116
Hero inventory is full equal to false?

Is there such thing, i looked and i can't find it.

Im trying to make it able to detect for a condition if there is a spot in the hero inventory that is not full, (the hero doesn't have 6 items in its inventory).

Because i am using the

Hero - Create Bomb and give it to (Triggering unit)

Item create action, and if the inventory is full it puts it on the ground next to the triggering unit.

And i don't want to remove the item if the item is on the ground because they may be switching items around or something.
 
Code:
Actions
    Set InventoryIsFull = True
    For each (Integer A) from 1 to 6, do (Actions)
        Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    ((Item carried by (Triggering unit) in slot (Integer A)) is owned) Equal to False
                Then - Actions
                    Set InventoryIsFull = False
                Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If - Conditions
            InventoryIsFull Equal to True
        Then - Actions
            Game - Display to (All players) the text: Inventory is full
        Else - Actions
            Game - Display to (All players) the text: Still some room left
 
Wouldn't that be an unnecessary hassle? As I see no native function that detects inventory being full, and returning a boolean would be a waste when you can use globals. (Though it can screw up if it's executing one after the other)
 
Well, based on my trigger up here, the "function" could be as simple as this:

Code:
function InventoryIsFull takes unit Hero returns boolean
    local integer A = 1
    loop
        if ( IsItemOwned(UnitItemInSlotBJ(Hero, A)) == false ) then
            return false
        endif
        set A = A + 1
        exitwhen A > 6
    endloop
    return true
endfunction


Then you can set some boolean with something like this:
Custom script: set udg_InventoryIsFull = InventoryIsFull( GetTriggerUnit() )


But, what I would really like to see is a GUI trigger that could call
your own functions.
Any way to do that?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Bot readable, not human usable.
  • The Helper The Helper:
    got it
  • The Helper The Helper:
    Happy Thursday!
  • The Helper The Helper:
    Check out the new Featured Content feature we apparently got with the forum software upgrade! https://www.thehelper.net/featured/
  • The Helper The Helper:
    Also on the bottom right side bar we now have a Trending Content Box!
    +1
  • The Helper The Helper:
    Not on the Headline News page just on the Forums page can we get that Featured and Trending on the home page?
  • Ghan Ghan:
    Since the home page is technically a forum, it now shows on all forum views. Still in the sidebar.
    +1
  • The Helper The Helper:
    Happy Friday! Hope everyone has a fantastic day and an even better weekend!
  • The Helper The Helper:
    Happy Sunday!
  • The Helper The Helper:
    I lovc that I can post webp and X links now! :)
  • The Helper The Helper:
    Happy Thursday!
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    we were down for a minute - think a log file or something got too big
    +1
  • Ghan Ghan:
    The alerts say it was down for a while unfortunately.
  • Ghan Ghan:
    Didn't know what was going on while I was at work.
  • Ghan Ghan:
    Disk filled up with logs. Fixed now.
    +1
  • The Helper The Helper:
    not a problem at all thanks for getting us back up
  • The Helper The Helper:
    I think the bots are finding a way to get through the anubis
  • The Helper The Helper:
    Happy Wednesday Everyone! Hope everyone has a Fantastic Day!
    +1
  • The Helper The Helper:
    Yeah, stats are showing big bot influx like 12k page views.
  • Wizard Wizard:
    :wave:
    +1
  • Ghan Ghan:
    TH changed his avatar again. 6 more weeks of summer.
    +3
  • Wizard Wizard:
    lol
    +1
  • The Helper The Helper:
    Guys just a heads up I am going to be shutting the site down soon. I am just waiting on the NUON people to decide whether they want to transfer forum data and keep the discord. My email is [email protected] for anyone that wants to keep in touch and I have a facebook too. I will make an official post later. Love you guys and will miss everyone!
    +1
  • V-SNES V-SNES:
    Sent a pm @The Helper

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top