Skip to content

babaissarkar/WISh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WISh

A GUI item inventory system for War of Legends era (An addon for The Battle for Wesnoth).

Usage

Campaign Files

In _main.cfg, at the very beginning of this file, add:

#ifhave ~add-ons/WISh/_main.cfg
    {~add-ons/WISh/utils}
#endif

What does this do?

It loads the WISh resource in the top-level so that the [campaign] tag can recognise it.

Next step is loading the resource:

[campaign]
    # load inventory items
    # load WISH
    [load_resource]
        id=wish_items
    [/load_resource]
[/campaign]

Scenario Files

The main macro that places an item on map is:

{WISH_ITEM_PICK_UP ID X Y CANNOT_PICKUP_MESSAGE IMAGE_SHOWN_IN_POPUP OBJECT_WML TYPE=weapon TAKE_IT_STRING="Equip" LEAVE_IT_STRING="Leave"}

Note that this can only be used inside an event.

Example code from Knyghtmare's SotBE rework project

{WISH_ITEM_PICK_UP 
        rock_of_frost_resisting 22 17

        (_"This trinket can be equipped by most units except goblins.")

        ("items/rock.png") (
        [object]
            id=rock_of_frost_resisting
            name= _ "Rock of Frost Resistance"
            take_only_once=no
            image="items/rock.png"
            description= _ "Increase cold resistance by 5%."
            [filter]
                side=1
                [not]
                    race=goblin
                [/not]
            [/filter]

            [effect]
                apply_to=resistance
                replace=no
                [resistance]
                    cold=-5
                [/resistance]
            [/effect]
        [/object]
    ) 
    (TYPE=trinket)}
  • OBJECT is an extended version of the [object] from core, namely it supports the following additional keys and tags:
    • locked: boolean, when true, the item cannot be unequipped or sold or remove in anyway except by the unit dying.
    • lock_msg: string, the message shown when trying to remove a locked item.
    • gold_value: Cost of the item, i.e., the gold you get when you sell this item.
    • subtag [filter]: Only units satisfying the condition can pickup this [object].
  • TYPE: Optional macro argument specifying the type of the equipment. An unit can only have one item of each type at a time. Please note TYPE can be any 4 values: weapon (default if not specified), armor, trinket, amulet. We have no further plans on expanding the TYPE= value list.
  • TAKE_IT_STRING and LEAVE_IT_STRING: Optional macro arguments that specify the caption text to be shown on the Equip and Leave buttons. Default values are (obviously) Equip and Leave.

Inventory

Accessible via Right click on unit > Inventory if the unit has an item equipped.

Screenshots

Image 1

Image 2

Image 3

About

War of Legends Inventory System addon (WISh)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages