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

Bigger Inventory Breakthrough!!

Status
Not open for further replies.
Level 3
Joined
Nov 3, 2004
Messages
43
:D just had a great idea on how to make on extended inventory (more than 6 slots)
I know that alot of you have been asking this and here is a solution

Variables: ItemPage_1 (array 6) Type: Item type

Custom Items: a dummy item called "next Page" or "Page 2" that can be used just by left clicking but does not do anything (lets just say that the item can cast "roar") and cannot be dropped.

Triggers: (here is where it gets brilliant :p)

Trigger 1: "map initialisation"

Event: map initialisation

Action:Create item for hero of type "next page"


Trigger 2: "Load next page'

Event: generic unit event: a unit (begins casting an ability)

Conditions: Ability comparision: ability being cast is equal to "roar" (or whatever dummy spell your item casts)

Actions: Set variable: Set ItemPage_1 (1) equal to (item carried by hero(in slot 1))
Set variable: Set ItemPage_1 (1) equal to (item carried by hero(in slot 1))
E.T.C
(keep going till u save all item slots for hero in that variable)

Then have the action to remove all items from slots 1-6 in hero...
So wait... what did we just do?

What happens now is when aplayer clicks on the "next page" item we save all the item types (Not the ittems, the item Types) in the variable Itempage_1... then we deleate all the items in the inventory

Then if the player clicks on that item again, to rreload the original items we do this;

Trigger: "load first page"

Event: Player egins casting an ability

condition: ability being cast is equal to "roar"

Action:
create item for hero of type (Itempage_1 (1))
create item for hero of type (Itempage_1 (2))
create item for hero of type (Itempage_1 (3))
create item for hero of type (Itempage_1 (4))
create item for hero of type (Itempage_1 (5))
create item for hero of type (Itempage_1 (6))

So... what did that do you say?... what that did was when the player clicks the next page item again, We create an item of the same original type that we saved into the variable "Itemtype_1" and gave it to the hero.... in effect it SEEMS like we have a big inventory but we are actually just creating the same item type that the hero sterted with

H have not tried this myself because i have been very busy but it suld work... happy to help and pease give me ur comments

P.S. i am also awaere that this probably didnt make any sence what soever but still... someone might have got it!

=Phew!= that was alot of typing!
 
Level 7
Joined
Jul 30, 2004
Messages
451
Theturtle said:
:D just had a great idea on how to make on extended inventory (more than 6 slots)
I know that alot of you have been asking this and here is a solution
etc..
etc...
H have not tried this myself because i have been very busy but it suld work... happy to help and pease give me ur comments

P.S. i am also awaere that this probably didnt make any sence what soever but still... someone might have got it!

=Phew!= that was alot of typing!

you mean like this?

Code:
//##Start                                                                                         ##
//##Handle Variables                                                                              ##
//==================================================================================================
function H2I takes handle h returns integer
    return h
    return 0
endfunction

//==================================================================================================
function LocalVars takes nothing returns gamecache
    return InitGameCache("jasslocalvars.w3v")
endfunction

//==================================================================================================
function SetInvInt takes string subject, string name, integer value returns nothing
    if value==0 then
        call FlushStoredInteger(LocalVars(), subject,name)
    else
        call StoreInteger(LocalVars(), subject, name, value)
    endif
endfunction

//==================================================================================================
function SetInvHandle takes string subject, string name, handle value returns nothing
    call SetInvInt( subject, name, H2I(value) )
endfunction

//==================================================================================================
function SetHandleBoolean takes handle subject, string name,boolean value returns nothing
    if (not value) then
        call FlushStoredBoolean(LocalVars(), I2S(H2I(subject)), name)
    else
        call StoreBoolean(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

//==================================================================================================
function SetHandleInt takes handle subject, string name, integer value returns nothing
    if value==0 then
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

//==================================================================================================
function SetHandleReal takes handle subject, string name, real value returns nothing
    if value==0 then
        call FlushStoredReal(LocalVars(), I2S(H2I(subject)), name)
    else
        call StoreReal(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

//==================================================================================================
function SetHandleString takes handle subject,string name,string value returns nothing
    if value=="" then
        call FlushStoredString(LocalVars(), I2S(H2I(subject)), name)
    else
        call StoreString(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

//==================================================================================================
function SetHandleHandle takes handle subject, string name, handle value returns nothing
    call SetHandleInt( subject, name, H2I(value) )
endfunction

//==================================================================================================
function GetHandleHandle takes handle subject, string name returns handle
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction

//==================================================================================================
function GetInvHandle takes string subject, string name returns handle
    return GetStoredInteger(LocalVars(), subject, name)
    return null
endfunction

//==================================================================================================
function GetHandleBoolean takes handle subject,string name returns boolean
    return GetStoredBoolean(LocalVars(), I2S(H2I(subject)), name)
endfunction

//==================================================================================================
function GetHandleInt takes handle subject, string name returns integer
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
endfunction

//==================================================================================================
function GetHandleReal takes handle subject, string name returns real
    return GetStoredReal(LocalVars(), I2S(H2I(subject)), name)
endfunction

//==================================================================================================
function GetHandleString takes handle subject,string name returns string
    return GetStoredString(LocalVars(), I2S(H2I(subject)), name)
endfunction

//==================================================================================================
function FlushHandleLocals takes handle subject returns nothing
    call FlushStoredMission(LocalVars(), I2S(H2I(subject)) )
endfunction
//##End                                                                                           ##

Code:
//---------------------------------------------------------------------------
//***************************************************************************
//---------------------------------------------------------------------------
//INVENTORY
//---------------------------------------------------------------------------
//***************************************************************************
//---------------------------------------------------------------------------

//***************************************************************************
//Returns what box the item was dropped on, if it was not a drop order,
//returns -1
//***************************************************************************
function getItemDropBox takes integer o returns integer
    if ( (o > 852001) and (o < 852008) ) then
        return (o - 852001)
    else
        return -1
    endif
endfunction

//***************************************************************************
//Sets an item on the specified page
//***************************************************************************
function setPageItem takes string t, integer playernum, item o, integer page, integer slot returns nothing

    call SetInvHandle( (I2S(playernum) + t + I2S(page) ), ( "item" + I2S(slot) ), o)
    call SetHandleInt( o, "var_nInvSlot" + t, slot )
    call SetHandleInt( o, "var_nInvPage" + t, page )

endfunction

//***************************************************************************
//Adds an item to the first free inventory slot on specified page
//***************************************************************************
function addPageItem takes string t, integer playernum, item o, integer page, integer maxslots returns boolean
    local integer x
    local boolean b

    set b = false
    set x = 1
    loop
        exitwhen x > maxslots
        if ( GetInvHandle((I2S(playernum) + t + I2S(page) ), ( "item" + I2S(x) )) == null ) then
            call SetInvHandle( (I2S(playernum) + t + I2S(page) ), ( "item" + I2S(x) ), o)
            call SetHandleInt( o, "var_nInvSlot" + t, x )
            call SetHandleInt( o, "var_nInvPage" + t, page )
            set b = true
            set x = maxslots
        endif
        set x = x + 1
    endloop
    return b
endfunction

//***************************************************************************
//Adds an item to the first free inventory slot
//***************************************************************************
function addItem takes string t, integer playernum, item o, integer maxslots, integer maxpages returns boolean
    local integer x
    local boolean b

    set b = false
    set x = 1
    loop
        exitwhen x > maxpages
        if ( addPageItem(t, playernum, o, x, maxslots) == true ) then
            set b = true
            set x = maxpages
        endif
        set x = x + 1
    endloop
    return b
endfunction

//***************************************************************************
//Removes an item from a specific inventory page/slot
//***************************************************************************
function removeItemAt takes string t, integer playernum, item o, integer page, integer slot returns nothing
    
    call SetInvHandle( (I2S(playernum) + t + I2S(page) ), ( "item" + I2S(slot) ), null)
    if ( o != null ) then
        call SetHandleInt( o, "var_nInvSlot" + t, 0 )
        call SetHandleInt( o, "var_nInvPage" + t, 0 )
    endif

endfunction

//***************************************************************************
//Removes a specific item from inventory
//***************************************************************************
function removeItem takes string t, integer playernum, item o, integer maxslots, integer maxpages returns boolean
    local integer x
    local integer page
    local boolean b

    set b = false
    set page = 1
    set x = 1
    loop
        exitwhen page > maxpages
        loop
            exitwhen x > maxslots
            if ( GetInvHandle((I2S(playernum) + t + I2S(page) ), ( "item" + I2S(x) )) == o ) then
                call SetInvHandle( (I2S(playernum) + t + I2S(page) ), ( "item" + I2S(x) ), null)
                call SetHandleInt( o, "var_nInvSlot" + t, 0 )
                call SetHandleInt( o, "var_nInvPage" + t, 0 )
                set b = true
                set x = maxslots
                set page = maxpages
            endif
            set x = x + 1
        endloop
        set page = page + 1
    endloop
    return b
endfunction

//***************************************************************************
//Gets an item from an inventory page in a specified slot
//***************************************************************************
function getPageItem takes string t, integer playernum, integer page, integer slot returns item
    
    return GetInvHandle( ( I2S(playernum) + t + I2S(page) ), ( "item" + I2S(slot) ) )

endfunction

//***************************************************************************
//Gets a page of items
//***************************************************************************
function getPage takes string t, integer playernum, integer page, integer num returns nothing
    local integer x
    
    set x = 1
    loop
        exitwhen x > num
        set udg_INVENTORY_itemInvSlot_A[(((playernum - 1) * 6) + x)] = getPageItem(t, playernum, page, x)
        //call DisplayTextToForce( GetPlayersAll(), GetItemName(udg_INVENTORY_itemInvSlot_A[( ( ( udg_OTHER_nPlayerIndex - 1 ) * 6 ) + x )]) )
        set x = x + 1
    endloop
endfunction

//***************************************************************************
//Gives the unit an item in a specified real inventory slot
//***************************************************************************
function giveItemInSlot takes unit u, item i, integer slot returns nothing
    local integer x

    //call PolledWait( 0.01 )

    set x = 1
    loop
        exitwhen x > (slot - 1)
        if ( UnitItemInSlotBJ(u, x) == null ) then
            call UnitAddItemByIdSwapped( 'ches', u )
           set udg_EQUIPMENT_itemDummy_A[x] = GetLastCreatedItem()
        else
            call DoNothing(  )
        endif
        set x = x + 1
    endloop
    call UnitRemoveItemFromSlotSwapped( x, u )
    call SetItemPositionLoc( UnitItemInSlotBJ(u, x), GetRectCenter(GetPlayableMapRect()) )
    call UnitAddItemSwapped( i, u )

    set x = 1
    loop
        exitwhen x > (slot - 1)
        call RemoveItem( udg_EQUIPMENT_itemDummy_A[x] )
        set x = x + 1
    endloop
endfunction

Code:
EQUIP Pickup Equipment
    Events
        Unit - A unit Acquires an item
    Conditions
        ((Hero manipulating item) is in GAME_ugroupPlayerUnits) Equal to True
        INVENTORY_bDisablePickupCheck[(Player number of (Owner of (Hero manipulating item)))] Equal to False
    Actions
        Set OTHER_nPlayerIndex = (Player number of (Owner of (Hero manipulating item)))
        Custom script:   set udg_XTEMP_n01 = GetHandleInt( GetManipulatedItem(), "var_nOwner")
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                XTEMP_n01 Not equal to OTHER_nPlayerIndex
            Then - Actions
                Custom script:   set udg_XTEMP_s01 = GetHandleString( GetManipulatedItem(), "var_sType" )
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        XTEMP_s01 Equal to weapon
                    Then - Actions
                        Set XTEMP_b01 = False
                        Trigger - Run EQUIP Deposite Weapon <gen> (checking conditions)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                XTEMP_b01 Equal to True
                            Then - Actions
                                -------- INV WAS FULL --------
                                Game - Display to (Player group((Player(OTHER_nPlayerIndex)))) the text: Cannot carry anymor...
                            Else - Actions
                                -------- WEAPON --------
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        PLAYER_itemPrimary_A[OTHER_nPlayerIndex] Equal to No item
                                    Then - Actions
                                        Set PLAYER_itemPrimary_A[OTHER_nPlayerIndex] = (Item being manipulated)
                                        Set EQUIPMENT_itemTemp = (Item being manipulated)
                                        Trigger - Run EQUIP Raise Stats <gen> (checking conditions)
                                    Else - Actions
                                        Do nothing
                    Else - Actions
                        Do nothing
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        XTEMP_s01 Equal to armor
                    Then - Actions
                        Set XTEMP_b01 = False
                        Trigger - Run EQUIP Deposite Armor <gen> (checking conditions)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                XTEMP_b01 Equal to True
                            Then - Actions
                                -------- INV WAS FULL --------
                                Game - Display to (Player group((Player(OTHER_nPlayerIndex)))) the text: Cannot carry anymor...
                            Else - Actions
                                -------- ARMOR --------
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        PLAYER_itemArmor_A[OTHER_nPlayerIndex] Equal to No item
                                    Then - Actions
                                        Set PLAYER_itemArmor_A[OTHER_nPlayerIndex] = (Item being manipulated)
                                        Set EQUIPMENT_itemTemp = (Item being manipulated)
                                        Trigger - Run EQUIP Raise Stats <gen> (checking conditions)
                                    Else - Actions
                                        Do nothing
                    Else - Actions
                        Do nothing
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        XTEMP_s01 Equal to shield
                    Then - Actions
                        Set XTEMP_b01 = False
                        Trigger - Run EQUIP Deposite Shield <gen> (checking conditions)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                XTEMP_b01 Equal to True
                            Then - Actions
                                -------- INV WAS FULL --------
                                Game - Display to (Player group((Player(OTHER_nPlayerIndex)))) the text: Cannot carry anymor...
                            Else - Actions
                                -------- SHIELD --------
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        PLAYER_itemSecondary_A[OTHER_nPlayerIndex] Equal to No item
                                    Then - Actions
                                        Set PLAYER_itemSecondary_A[OTHER_nPlayerIndex] = (Item being manipulated)
                                        Set EQUIPMENT_itemTemp = (Item being manipulated)
                                        Trigger - Run EQUIP Raise Stats <gen> (checking conditions)
                                    Else - Actions
                                        Do nothing
                    Else - Actions
                        Do nothing
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        XTEMP_s01 Equal to accessory
                    Then - Actions
                        Set XTEMP_b01 = False
                        Trigger - Run EQUIP Deposite Accessory <gen> (checking conditions)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                XTEMP_b01 Equal to True
                            Then - Actions
                                -------- INV WAS FULL --------
                                Game - Display to (Player group((Player(OTHER_nPlayerIndex)))) the text: Cannot carry anymor...
                            Else - Actions
                                -------- SHIELD --------
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        PLAYER_itemAccessory_A[OTHER_nPlayerIndex] Equal to No item
                                    Then - Actions
                                        Set PLAYER_itemAccessory_A[OTHER_nPlayerIndex] = (Item being manipulated)
                                        Set EQUIPMENT_itemTemp = (Item being manipulated)
                                        Trigger - Run EQUIP Raise Stats <gen> (checking conditions)
                                    Else - Actions
                                        Do nothing
                    Else - Actions
                        Do nothing
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        XTEMP_s01 Equal to other
                    Then - Actions
                        Set XTEMP_b01 = False
                        Trigger - Run EQUIP Deposite Item <gen> (checking conditions)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                XTEMP_b01 Equal to True
                            Then - Actions
                                -------- INV WAS FULL --------
                                Game - Display to (Player group((Player(OTHER_nPlayerIndex)))) the text: Cannot carry anymor...
                            Else - Actions
                                -------- ITEM --------
                    Else - Actions
                        Do nothing
            Else - Actions
                Do nothing

EQUIP Drop Equipment
    Events
        Unit - A unit Loses an item
    Conditions
        ((Hero manipulating item) is in GAME_ugroupPlayerUnits) Equal to True
        INVENTORY_bDisableDropCheck[(Player number of (Owner of (Hero manipulating item)))] Equal to False
    Actions
        Set OTHER_nPlayerIndex = (Player number of (Owner of (Hero manipulating item)))
        Set INVENTORY_bDisableDropCheck[OTHER_nPlayerIndex] = True
        Custom script:   set udg_XTEMP_n01 = GetHandleInt( GetManipulatedItem(), "var_nOwner")
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                XTEMP_n01 Equal to OTHER_nPlayerIndex
            Then - Actions
                Set EQUIPMENT_itemTemp = (Item being manipulated)
                Trigger - Run EQUIP Internal Remove <gen> (checking conditions)
            Else - Actions
                Game - Display to (All players) the text: WARNING - Error Occ...
                Game - Display to (All players) the text: Function "EQUIP Dro...
                Game - Display to (All players) the text: (Error : Unresolved Item/Player Distinction on item  + (Name of (Item being manipulated)))
                Do nothing
        Set INVENTORY_bDisableDropCheck[OTHER_nPlayerIndex] = False

EQUIP Internal Remove
    Events
    Conditions
    Actions
        Custom script:   local item localitem
        Custom script:   set localitem = udg_EQUIPMENT_itemTemp
        Custom script:   set udg_XTEMP_s01 = GetHandleString( udg_EQUIPMENT_itemTemp, "var_sType" )
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                XTEMP_s01 Equal to weapon
            Then - Actions
                Trigger - Run EQUIP Remove Item Weap <gen> (checking conditions)
                -------- dropping equipped primary --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        PLAYER_itemPrimary_A[OTHER_nPlayerIndex] Equal to EQUIPMENT_itemTemp
                    Then - Actions
                        Trigger - Run EQUIP Lower Stats <gen> (checking conditions)
                        Set PLAYER_itemPrimary_A[OTHER_nPlayerIndex] = No item
                    Else - Actions
                        Do nothing
            Else - Actions
                Do nothing
        Custom script:   set udg_EQUIPMENT_itemTemp = localitem
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                XTEMP_s01 Equal to armor
            Then - Actions
                Trigger - Run EQUIP Remove Item Arm <gen> (checking conditions)
                -------- dropping equipped armor --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        PLAYER_itemArmor_A[OTHER_nPlayerIndex] Equal to EQUIPMENT_itemTemp
                    Then - Actions
                        Trigger - Run EQUIP Lower Stats <gen> (checking conditions)
                        Set PLAYER_itemArmor_A[OTHER_nPlayerIndex] = No item
                    Else - Actions
                        Do nothing
            Else - Actions
                Do nothing
        Custom script:   set udg_EQUIPMENT_itemTemp = localitem
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                XTEMP_s01 Equal to shield
            Then - Actions
                Trigger - Run EQUIP Remove Item Shield <gen> (checking conditions)
                -------- dropping equipped shield --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        PLAYER_itemSecondary_A[OTHER_nPlayerIndex] Equal to EQUIPMENT_itemTemp
                    Then - Actions
                        Trigger - Run EQUIP Lower Stats <gen> (checking conditions)
                        Set PLAYER_itemSecondary_A[OTHER_nPlayerIndex] = No item
                    Else - Actions
                        Do nothing
            Else - Actions
                Do nothing
        Custom script:   set udg_EQUIPMENT_itemTemp = localitem
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                XTEMP_s01 Equal to accessory
            Then - Actions
                Trigger - Run EQUIP Remove Item Accessory <gen> (checking conditions)
                -------- dropping equipped accessory --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        PLAYER_itemAccessory_A[OTHER_nPlayerIndex] Equal to EQUIPMENT_itemTemp
                    Then - Actions
                        Trigger - Run EQUIP Lower Stats <gen> (checking conditions)
                        Set PLAYER_itemAccessory_A[OTHER_nPlayerIndex] = No item
                    Else - Actions
                        Do nothing
            Else - Actions
                Do nothing
        Custom script:   set udg_EQUIPMENT_itemTemp = localitem
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                XTEMP_s01 Equal to other
            Then - Actions
                Trigger - Run EQUIP Remove Item Inv <gen> (checking conditions)
            Else - Actions
                Do nothing
        Custom script:   set udg_EQUIPMENT_itemTemp = localitem
        Custom script:   call SetHandleInt( udg_EQUIPMENT_itemTemp, "var_nOwner", 0 )

EQUIP Deposite Weapon
    Events
    Conditions
    Actions
        Custom script:   if ( addPageItem( "invpage", udg_OTHER_nPlayerIndex, GetManipulatedItem(), udg_INVENTORY_nCurInvPage_A[udg_OTHER_nPlayerIndex], 5 ) == true ) then
        Custom script:   if ( addItem( "invpage", udg_OTHER_nPlayerIndex, GetManipulatedItem(), 5, udg_INVENTORY_nMaxInvPages_A[udg_OTHER_nPlayerIndex] ) == true ) then
        Custom script:   if ( addPageItem( "weappage", udg_OTHER_nPlayerIndex, GetManipulatedItem(), udg_INVENTORY_nCurWeapPage_A[udg_OTHER_nPlayerIndex], 5 ) == true ) then
        Custom script:   if ( addItem( "weappage", udg_OTHER_nPlayerIndex, GetManipulatedItem(), 5, udg_INVENTORY_nMaxWeapPages_A[udg_OTHER_nPlayerIndex] ) == true ) then
        -------- Was able to add to both inv and weap --------
        Custom script:   call SetHandleInt( GetManipulatedItem(), "var_nOwner", udg_OTHER_nPlayerIndex )
        Custom script:   set udg_XTEMP_f01 = GetHandleReal( GetManipulatedItem(), "var_fWeight")
        Set PLAYER_fWeightCarried_A[OTHER_nPlayerIndex] = (PLAYER_fWeightCarried_A[OTHER_nPlayerIndex] + XTEMP_f01)
        Trigger - Run PLAYER Adjust Movement Speed <gen> (ignoring conditions)
        Custom script:   else
        -------- Was not able to add to weapon so remove from inv --------
        Custom script:   call removeItem( "invpage", udg_OTHER_nPlayerIndex, GetManipulatedItem(), 5, udg_INVENTORY_nMaxInvPages_A[udg_OTHER_nPlayerIndex] )
        Set XTEMP_point01 = (Position of PLAYER_unitHero_A[OTHER_nPlayerIndex])
        Item - Move (Item being manipulated) to XTEMP_point01
        Custom script:   call RemoveLocation( udg_XTEMP_point01 )
        Set XTEMP_b01 = True
        Custom script:   endif
        Custom script:   else
        Set XTEMP_point01 = (Position of PLAYER_unitHero_A[OTHER_nPlayerIndex])
        Item - Move (Item being manipulated) to XTEMP_point01
        Custom script:   call RemoveLocation( udg_XTEMP_point01 )
        Set XTEMP_b01 = True
        Custom script:   endif

EQUIP Remove Item Inv
    Events
    Conditions
    Actions
        Custom script:   local integer s
        Custom script:   local integer p
        Custom script:   set s = GetHandleInt( udg_EQUIPMENT_itemTemp, "var_nInvSlotinvpage")
        Custom script:   set p = GetHandleInt( udg_EQUIPMENT_itemTemp, "var_nInvPageinvpage")
        Custom script:   call removeItemAt( "invpage", udg_OTHER_nPlayerIndex, udg_EQUIPMENT_itemTemp, p, s )
        Custom script:   set udg_XTEMP_f01 = GetHandleReal(udg_EQUIPMENT_itemTemp, "var_fWeight")
        Set PLAYER_fWeightCarried_A[OTHER_nPlayerIndex] = (PLAYER_fWeightCarried_A[OTHER_nPlayerIndex] - XTEMP_f01)
        Trigger - Run PLAYER Adjust Movement Speed <gen> (ignoring conditions)

EQUIP Next Page
    Events
        Unit - A unit Uses an item
    Conditions
        (Item-type of (Item being manipulated)) Equal to Next Page
    Actions
        Set OTHER_nPlayerIndex = (Player number of (Owner of (Hero manipulating item)))
        Set INVENTORY_bDisableDropCheck[OTHER_nPlayerIndex] = True
        Trigger - Run EQUIP Determine Slots <gen> (checking conditions)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                PLAYER_bEquipmode_A[OTHER_nPlayerIndex] Equal to False
                PLAYER_bSelectWeap1_A[OTHER_nPlayerIndex] Equal to False
            Then - Actions
                -------- Do Pages --------
                For each (Integer A) from 1 to 5, do (Actions)
                    Loop - Actions
                        Set EQUIPMENT_itemTemp = (Item carried by PLAYER_unitHero_A[OTHER_nPlayerIndex] in slot (Integer A))
                        Set XTEMP_point01 = (Center of Temp Area <gen>)
                        Item - Move EQUIPMENT_itemTemp to XTEMP_point01
                        Custom script:   call RemoveLocation( udg_XTEMP_point01 )
                        Item - Hide EQUIPMENT_itemTemp
                Set INVENTORY_nCurInvPage_A[OTHER_nPlayerIndex] = (INVENTORY_nCurInvPage_A[OTHER_nPlayerIndex] + 1)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        INVENTORY_nCurInvPage_A[OTHER_nPlayerIndex] Greater than INVENTORY_nMaxInvPages_A[OTHER_nPlayerIndex]
                    Then - Actions
                        Set INVENTORY_nCurInvPage_A[OTHER_nPlayerIndex] = 1
                    Else - Actions
                        Do nothing
                Game - Display to (Player group((Player(OTHER_nPlayerIndex)))) the text: (Inventory page:   + (String(INVENTORY_nCurInvPage_A[OTHER_nPlayerIndex])))
                Custom script:   call getPage( "invpage", udg_OTHER_nPlayerIndex, udg_INVENTORY_nCurInvPage_A[udg_OTHER_nPlayerIndex], 5)
                For each (Integer A) from 1 to 5, do (Actions)
                    Loop - Actions
                        Set XTEMP_n01 = (Integer A)
                        Set EQUIPMENT_itemTemp = INVENTORY_itemInvSlot_A[(((OTHER_nPlayerIndex - 1) x 6) + XTEMP_n01)]
                        Item - Show EQUIPMENT_itemTemp
                        Custom script:   call giveItemInSlot( udg_PLAYER_unitHero_A[udg_OTHER_nPlayerIndex], udg_EQUIPMENT_itemTemp, udg_XTEMP_n01 )
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                PLAYER_bSelectWeap1_A[OTHER_nPlayerIndex] Equal to True
            Then - Actions
                -------- Do Weap Pages --------
                For each (Integer A) from 1 to 4, do (Actions)
                    Loop - Actions
                        Set EQUIPMENT_itemTemp = (Item carried by PLAYER_unitHero_A[OTHER_nPlayerIndex] in slot (Integer A))
                        Set XTEMP_point01 = (Center of Temp Area <gen>)
                        Item - Move EQUIPMENT_itemTemp to XTEMP_point01
                        Custom script:   call RemoveLocation( udg_XTEMP_point01 )
                        Item - Hide EQUIPMENT_itemTemp
                Set INVENTORY_nCurWeapPage_A[OTHER_nPlayerIndex] = (INVENTORY_nCurWeapPage_A[OTHER_nPlayerIndex] + 1)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        INVENTORY_nCurWeapPage_A[OTHER_nPlayerIndex] Greater than INVENTORY_nMaxWeapPages_A[OTHER_nPlayerIndex]
                    Then - Actions
                        Set INVENTORY_nCurWeapPage_A[OTHER_nPlayerIndex] = 1
                    Else - Actions
                        Do nothing
                Custom script:   call getPage( "weappage", udg_OTHER_nPlayerIndex, udg_INVENTORY_nCurWeapPage_A[udg_OTHER_nPlayerIndex], 4)
                For each (Integer A) from 1 to 4, do (Actions)
                    Loop - Actions
                        Set XTEMP_n01 = (Integer A)
                        Set EQUIPMENT_itemTemp = INVENTORY_itemInvSlot_A[(((OTHER_nPlayerIndex - 1) x 6) + XTEMP_n01)]
                        Item - Show EQUIPMENT_itemTemp
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                EQUIPMENT_itemTemp Not equal to PLAYER_itemPrimary_A[OTHER_nPlayerIndex]
                            Then - Actions
                                Custom script:   call giveItemInSlot( udg_PLAYER_unitHero_A[udg_OTHER_nPlayerIndex], udg_EQUIPMENT_itemTemp, udg_XTEMP_n01 )
                            Else - Actions
                                Do nothing
            Else - Actions
                Do nothing
        Set INVENTORY_bDisableDropCheck[OTHER_nPlayerIndex] = False

just something i came up with a while ago, which isn't exactly a new concept, i know other people have done more advanced versions, but i like to make my own
 
Status
Not open for further replies.
Top