• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[MUI] Full screen inventory and shop + Custom item

content:
- mainly full screen inventory and shop without ~terrain cost and few other lil thing, check the images

Note:

1. Don't post nothing if you can't comment something usefull what improve this (exclude if u talk about in vjass this could be better, also irritate me that bullsht if someone say it is copy since i wrote this from 0 till now exclude the indexer and bribe dd's)

2. If you got good idea or helpfull ideea, comment about how to improve i am glad if u write it here.
ty very much



my rest upload was deleted about full screen craps but if someone want light height non attachment full screen inv. map then have old one http://shadowvzs87.uw.hu/upload/Advanced Inventory v2.0 -- Without attachments.w3x or with attachment http://shadowvzs87.uw.hu/upload/Advanced Inventory v2.0 --.w3x

Triggers and jass functions (outdated - not was time yet for change the uploaded ones)
http://www.hiveworkshop.com/forums/pastebin.php?id=zjvm9h - header
http://www.hiveworkshop.com/forums/pastebin.php?id=sfcvtd - map init
http://www.hiveworkshop.com/forums/pastebin.php?id=z437oq - create interface and trackables
http://www.hiveworkshop.com/forums/pastebin.php?id=tiyrmx - create item and bonus
http://www.hiveworkshop.com/forums/pastebin.php?id=3fuzux - Click to trackable
http://www.hiveworkshop.com/forums/pastebin.php?id=d93bmw - MouseOverTrackable
http://www.hiveworkshop.com/forums/pastebin.php?id=qhvdqs - item pick and stack
http://www.hiveworkshop.com/forums/pastebin.php?id=k9x38m - smaller trigger and functions

UPDATES


v0.99b
- few minor changes (like RegHero function at "init hashtables and .." trigger automatical save hero type into save load hashtable)
- Save - Load code added:
Features:
- data saved directly into hard disc, you can copy paste the code (example u started the map, copy-paste with notepad)
- few thing customizable in header - constants "SL_" functions (SL=the function or variable is part of the save load system)
- saveable: gold/lumber/coord/stat (str/agi/int)/class/hero/level & exp (dynamic), craft skill progress
-stat saving: hero current stat - stat from items - start stat
- since we talk about random stat items, not constant items, code became long, so this
system support multi save/load lines like: -load code1 then -load code2 ...
(where code1 and code2 is the saved code)
- multiple code line limit is 39 line, each line could be around max 100 character
- added the equipment saves too but still don't got time to make the loading part aswell
*idk about inventory saveing worth to do or no*

v0.99a
- fixed the bag system included with multiboard (ex. not was showed in multiboard the 1st item in bag)
and fixed when charm item bonus not was removed/added when u moved into bag, moved out
- summoner class stuffs
- several text fix with item properties in hover tool tip in shop (like if mouse on helm then its show buyable helm mdef/pdef)
- added timer to multiboard item tooltip, damage detection system - set damage part etc
- few minor changes

v0.99
- New socket items added and now easier to register new socket gems
in "Item Registration at Map Init" you need refister like ever item for attach icon to it
then use: call RegSocketGem (ItemRawCode, GemType, Grade, ItemLevelRequiment, ItemStatInArmor1, StatValueInArmor1, ItemStatInWeapon2, StatValueInWeapon2, ItemStatInWings3, StatValueInWings3)
- New socket gems also added to shop for test
- Gems working
- Minor text fix at multiboard pager (when u are at socket view)
- Since items & gems can give critical dmg bonus i reduced the default critical dmg (if u want change then constant function in header DEFAULT_CRITICAL_DAMAGE())
- Minor fix at tooltip in shop about weapon dmg, weapon dmg now globally changeable in header easily
- added minimum damage to weapons, multiboard/stats in inventory (ratio easily changeable in header)
- gem icon showed if u check Socket/Set view and item got inserted gem
- added item stat 82 => this attack or damage but depend on weapon, if physical weapon then give pattak if magic then magic attack, only used for gems

v0.98d
- replaced Damage detection system (see DamageEvent trigger, still using bribe unit indexer but now DDS by looking_for_help)
- at shop -> where is the wings added another 2 unique item, Hammer+Ring, they also a new set
you can combine the sets :)
- greatly decreased armor penetration effect becuase its op vs low hp and high defence boss
- reduced the mobs defence but increased the boss def lv by boss level/2

v0.98c
- set bonus stuff totally changed
- multiboard now show different page the inserted sockets and set list
useing Up / Down arrow on keyboard for change multiboard page
- same time multiboard functions a bit reorganised same like equipment systems
- Set and Unique item datas is in "Item Registratration at Map Init" trigger
- you can set your own set bonus
Note: total set bonus, so if ex. 2 item is equiped from same unique set then you get 1 bonus totally not per piece


v0.98b
- enabled the duratibility showing and reduced the value duratibility (200-500 at max level)
- disable the animation changes for non villager
- removed teh bonus socket slot (i don't see point in it)
- multiboard a bit changed (bonus thing in loop now)
- added 3 different icon to armor/ring/helmet/boot/amulet (depend on quality)
- fixed the bug when full screen player gold floating text dissappear when inventory was launched 2+ times and u equiped something
- bonus block damage add

v0.98
- changes was in:
Header - GetCraftLevel
ClickToTrackable - AddItem2HeroExt, CraftShopItem, FadeSlot, Craft_Quality_Chance, BuyItemFromShop
OnTrackable - Tooltip
Create Interface
Harvester Timer
- changed the prfession/craft leveling formula, now work well
- in shop the tooltip in right bottom corner now show with
yellow that item for what we got sufficient craft skill level
and red what is required higher craft level than we got
- item stack fix when u buy item from shop and its stack with another item
- fixed the bug when the slot 2211/-17/-21 not was clickable :D
- now the life materia lv3-6 craftable too
- rearranged the craft a bit, so can't craft high craft requiment item than ur craft skill
few item like wing/tome need jewellery lv3, life materia and few potion need pahamacist lv1
- added refine stone with 20x stack into shop
- harvest speed is configurable in Harvest Timer trigger.
- harvest speed increased by total craft skill (if you level your crafting skill => harvest faster)
- fixed a minor bug in FadeSlot function (nearly never occured)
- in ClickToTrackable>BuyItemFromShop function settable the craft fail chance and crafted item quality chance
JASS:
    //ClickToTrackable>BuyItemFromShop
    local boolean CraftFail = true
    local integer CraftFailChance = 33
    local integer CQCE_Normal = 80 // 80% quality chance equipment: normal
    local integer CQCE_Magic = 10 // 10% quality chance equipment: magic
    local integer CQCE_Rare = 6 // 6% quality chance equipment: rare
    local integer CQCE_VeryRare = 3 // 3% quality chance equipment: very rare
    local integer CQCE_Excelent = 1 // 1% quality chance equipment: excelent

v0.97
- minor fix with stat window border
- minor labels example at create item trigger
- minor fix of the icons when charged item used in old/regular wc3 inventory
- minor fix with multiboard when u click to potion/life materia etc what got description
- minor fix where any player hero can gain exp not only that one in hero variable array

v0.96
- floating text bug fixed at harvisting
- path blocker changed to flying unit path blocker
- optionable the inventory sensibility when u reicive damage, use chat for toggle it, command: "-inv sens"
- disable the defence bonus per agility because useless if i use my own system

v0.95b
- fix few trade problem (in normal 0.95 u was unable to leave or even u quited there was still the trade partner gold floating text)
- added ally function + replace the red startlocation function to native function what dont use location - in create heroes trigger
- few indentation thing

v0.95
- Tradeing gold and items enable again, so can trade with different players hero without problem
- also notice for scan target now u need type "-scan" then right click to target

v0.94
- dummy.mdx added
- now dont need to create dummy units anymore for inventory hero, just at
register hero set your hero path, then system create a dummy unit
attach the hero model like special effect and set the unit pitch angle with animation index
- added the inventory gold icon for inventory too
- added few thing to inventory hero box for look like 3d box


v0.93
- new design for inventory, dont flicker the destructibles anymore
- debug things remove, weapon activation and buffs tested

v0.92
- buff system added - core part merged into timer trigger
- fixed the revive trigger because the action was attached in loop

v0.91h
- fixed the bug when dummy villager disappear when u wear bow and reopen the inventory, also was few attachment problem after i introduced the non attachment heroes, but now all fixed
- added weapon activation/special skill what activated during u attack somebody


v0.91g
- unit now unselectable during FSS
- dropped and bought items are invulnarable now

v0.91f
- labels and function organizations, table description added

v0.91e
- added few tooltip and minor things
- added potion and gold drop for treasure box

v0.91d
- Bagpack system added, what is it? i added a item what could store 0-24 another item
- you can drop out this item and who pick up can open the bag and can swap item between items in bag and inventory
- when bag is sold to shop (full screen shop) then automatical destroyed all item what was inside with their data
- Treasure box
- Windows transition and close windows with ESC
-Window transition: change the current opened window to another, example from inventory to bag system

v0.91c
- pharmacist craft requiment added for custom potions also gave chance for stronger potions
- if u press ESC when you dont ahve multiboard then its show the total time when u played :D

v0.91b
- created hit function, for easily change the accurancy/eva=< hit rate formula
- added regen pots too
- scan changed, tiny change, use player index not unit custom value for array index but this way easier to check if player use atm a scan or no
- mp regen changed to flat value and isnt % now (ty maker for tip about useing mana regen neutral unit ability)
- set bonus fix (was a bit problem if u equiped too fast the items, its fixed)
- few correction on shop: now if item not craftable then craftbox is hidden, double icon=deselect, now allways buy item if u click 1st to item and 2nd time to any other item in unit inventory what not craft materia of selected item or just no item.
- added the chance option for AddRandomBonus function (this function give random bonus to items)
also made few modification about bonuses, like magic weapon don't get pattack bonus etc
- super potion added [hp/mp], pharmacist depend crafting aswell
- level requiment potion with dynmic heal/mana restore amount

v0.91a
- changed the life regen/mp regen to MUI
- added to drop/shop the Charm item type, 3 rarity:
- Common Charm (1-2 random bonus stat) - 88% chance
- Uncommon Charm (3-5 random stat) - 10% chance
- Superior Charm (5-7 random stat) - 2% chance
- fixed few price
- accurancy/evasion random stat now fixed (was shifted with 1 properties)

v0.9
- changed the item pick/attack so basically the right clicking
- 1st right click on item = item multiboard info, 2nd right click pick up
- 1st click on unit is scan unit, 2nd attack him
- lil fix on multiboard and added 5 materia into shop and into craft system

v0.8
- class restriction text fixed for armors what viable for 2 class too
- scan now periodical check the target hp
- with ESC u can destroy the multiboards

v0.7
- inventory work with non attachment heroes and with attachment heroes (like villager or just normal Paladin)
- inventory and shoping is MUI now, with simple
call RegHeroes ('unit raw code', 'unit raw code 2 for inventory', true/false (attachemnt unit or no), 1 (size, coz some hero could be bigger than inventory window, this way u can set it), 0 (hero class), 2 (unit type default damage without str))
- item class requiment added
- shop discount tiem properties added

v0.6
- added MUI nateria items harvesting, its mean u cant simple just right click and pick up a iron ore, u ened dig out
and this need time, have floating text what show the digging process percentage
Note: - once u digged out something and drop out, dont ened dig out again
- cant 2 people dig same item

v0.5
- added craft level system (higher level item need higher level craft skill)
- chance for getting better eq depend on craft level

v0.4
- drop fix
- added the 4 craft job:
- Blacksmith (weapons)
- Tailor (armors)
- Jeweller (ring/amulet+wing+tome)
- Pharmacist (potions but not added yet)

v0.3
- added info to multiboard tooltip and shop tooltip if mouse over a socket/refines stone/materia, atm u can assign +3 description for each item type
- equipments craft: now for higher level equipment need more craft materia (i use now a function what return with correct mat amount)


v0.2
- at craft you can get enhanced item (20% chance and 80% for normal item)
- this will be changed when i will add the production skills

v0.1
the starting map



[Working]
on item rot system

SCREEN SHOTS

fake%20interface.JPG

new_100.jpg

new_101.jpg

new_102.jpg

new_103.jpg

new_104.jpg

new_105.jpg

new_106.jpg

new_107.jpg

new_108.jpg

new_109.jpg

new_110.jpg
new_111.jpg

new_112.jpg

new_113.jpg



[Credit]
Damage Detection system with indexer:
Bribe

Model and icons:
Ergius - silver ore
Sunchips - few attachemnt
Blizzard - ore icons (copper + iron ore)
PeeKey - emerald/ametyst/ruby icon
others who made attachment and icons, i don't got their name but if u want use this map the pls add credit to them too

Keywords:
custom item stat attachment fun orpg rpg mui mpi full screen
Contents

Shadowvzs ORPG v0.99 (Map)

Reviews
Full screen inventory and shop + Custom item | Reviewed by Maker | 17th Aug 2013 APPROVED [tr][td] This is a cool system with nice features. It seems to work well. However it is a nightmare to import and configure. It should have been done in vjass.

Moderator

M

Moderator


Full screen inventory and shop + Custom item | Reviewed by Maker | 17th Aug 2013
APPROVED

This is a cool system with nice features. It seems to work well.
However it is a nightmare to import and configure.
It should have been done in vjass.
[tr][td]
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
update

added bagpack's (mui store box where u can store items, bag also a item) and treasure/surprise box (randomly give gold/potion or item)


new_109.jpg

new_110.jpg

 
Hmmm I would like you know your point of view about this:
JASS:
//-------------------------------------------------------------------------
//                              CONSTANTS
//-------------------------------------------------------------------------

//special effect paths, example for potion
constant function EFFECT takes integer i  returns string
if i == 26 then
  return "Abilities\\Spells\\Human\\Heal\\HealTarget.mdl"
elseif i == 30 then
  return "Abilities\\Spells\\Undead\\ReplenishMana\\SpiritTouchTarget.mdl"
endif
endfunction

//max stack/charge for stackable items
constant function CHARGE_MAX takes nothing returns integer
 return 99
endfunction

//max bag zise
constant function BAG_SIZE_MAX takes nothing returns integer 
  return 24
endfunction

//etc etc...

using functions just slow down code, it's should be better to just use
JASS:
constant integer CHARGE_MAX = 99
constant integer BAG_SIZE_MAX  = 24

Using functions here are good for cases like that first shown above, and bad in other 2.
Even if you work with structs, scopes and so on, using function to return variable is just inefficient.

That's why I want to hear you opinion about this.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
it is jass and NOT vjass :p thats the point

Maker said:
shadowvzs said:
if i dont want use vjass, then what is the best way for make global constants?

onlyway is the gui global variables? or if i make function what return a simple value that dont slowdown?

i mean lets say in my map the bag size is 24 then:
JASS:
function BAGSIZE takes nothing returns integer
  return 24
endfunction

is noticeable slower than udg_Bag_Size=24 at map init?

That is a perfectly fine way to do constants :)
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Could you make the indentation and naming consistent throughout all the code files? :/

If you're not sure about convention, this one is favored and applied by every resource approved in the JASS section (Some old ones don't follow it)

Indentation is commonly 4 spaces per tab.

i used Script Aligner, so i thought most of code was done....

Nice improvements... I don't really like the idea of putting too much capabilities on a single system though... You can put some of them as external add-ons... but nonetheless, really nice system going...


when i have time and mood also idea (since i dont got too much idea from others) i update it, next update will with weapon special effect and buff
 
In either case,

JASS:
//-----------------------------------------------------------
//      Item / Heroes registration
//-----------------------------------------------------------

function RegItemCat4Shop takes integer c, integer id returns nothing
local integer i = LoadInteger(udg_Shop_Table,c, 0)
local integer a = LoadInteger(udg_Shop_Table,0, 0)
if a < 1000 then
  set a = 1000
endif
set a = a + 1
set i = i + 1
call SaveInteger(udg_Shop_Table, c, 0, i)
call SaveInteger(udg_Shop_Table, 0, 0, a)
call SaveInteger(udg_Shop_Table, c, i, id)
call SaveInteger(udg_Shop_Table, c, -i, a)
endfunction

function RegItem4Shop takes integer c, integer sc, integer itd, integer unique returns nothing
local integer id = LoadInteger(udg_Shop_Table, c, -sc)
local integer i = LoadInteger(udg_Shop_Table, id, 0)+1
call SaveInteger(udg_Shop_Table, id, 0, i)
call SaveInteger(udg_Shop_Table, id, i, itd)
call SaveInteger(udg_Shop_Table, id, -i, unique)
endfunction

function RegisterItem takes integer id, integer dest, string path, integer price, integer lv, string descr, integer subtype returns nothing
if path != null then
  call SaveStr(udg_FSS, 601, id, path)
endif
if descr != null then
  call SaveStr(udg_FSS, 604, id, descr)
endif
  call SaveInteger(udg_FSS, 600, id, dest)
  call SaveInteger(udg_FSS, 602, id, price)
  call SaveInteger(udg_FSS, 603, id, lv)
if subtype > 0 then
  call SaveInteger(udg_FSS, 605, id, subtype)
endif
endfunction

function RegCraft takes integer id, integer d1, integer c1, integer d2, integer c2, integer d3, integer c3 returns nothing
  call SaveInteger(udg_FSS, 606, id, d1)
  call SaveInteger(udg_FSS, 607, id, c1)
  call SaveInteger(udg_FSS, 608, id, d2)
  call SaveInteger(udg_FSS, 609, id, c2)
  call SaveInteger(udg_FSS, 610, id, d3)
  call SaveInteger(udg_FSS, 611, id, c3)
endfunction

function AddDescription takes integer id, string s1, string s2, string s3 returns nothing
  call SaveStr(udg_FSS, 647, id, s1)
  call SaveStr(udg_FSS, 648, id, s2)
  call SaveStr(udg_FSS, 649, id, s3)
endfunction

function RegHeroes takes integer id1, integer id2, boolean Attachment, real size, integer class, integer damage returns nothing
  call SaveInteger(udg_FSS, 630, id1, id2)
  call SaveBoolean(udg_FSS, 631, id1, Attachment)
  call SaveReal(udg_FSS, 632, id1, size)
  call SaveInteger(udg_FSS, 633, id1, class)
  call SaveInteger(udg_FSS, 634, id1, damage)
endfunction

^That's not good alignment :v
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
ty, i edit now and if i am done then upload the new version and change the pastebin things too, if still u notice something else too then pls tell me

i also fixed the destructible flickering in inventory and changed the design too, added buffs, weapon activation, fixed the respawn problem (trigger ran 15x coz was in loop the add action)

still i want check out better the weapon activation effects, remove the debugs from buff, add percentage hp buff, check out the trade again :)
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
System would be better if you use Dummy.mdx.

u opened the map? coz from ur post i must guess no because it is use dummy.mdx for hero dummy and for another interface around inventory dummy hero


so dummy unti and craps are just special effect attached on dummy unit :p

pastebin code not updated yet because still want few thing before align every script and paste into pastebin
 
Last edited:
Level 33
Joined
Apr 24, 2012
Messages
5,113
Oh sorry my bad :D
You can do the interface for the destructables,i use that in my HSS


edit
Okay,i have read the code.
The bad things i must say is the BJ events and indention.

Also,that TriggerAddAction should be replaced by TriggerAddCondition and make that action return boolean.(because TriggerAddCondition doesn't create new thread)

Some codes also lacks in description and comments.The system would be better in description if it has an API.

The User defined globals also should have prefixes, so we won't experience variable collisions.

Messages should be configurable.

Also,I found out you use TAS there.

You also use so many hashtables.

You also must not be scared with keys, the max value of a key is 2^31 and the minimum is 2^31 in negative.

You should evade using locations,you are in JASS now bro,we JASSers rarely use locations,we now use coords.

Suggestion: I would suggest a section for API and Doc,a section for constants,a section for sub-functions or utils and a section for the main triggers.You also don't need to use so many hashtables,because the max value of keys as i have mentioned before is 2^31,so don't be scared to use such thing.

Also,wanna check out this : http://www.hiveworkshop.com/forums/...nsion-176817/?prev=d=list&r=20&u=D4RK_G4ND4LF . This system is sweet and very functional. and also has short codes :D
 
Last edited:
Level 17
Joined
Nov 13, 2006
Messages
1,814
- u mean use dummy unit for interface? i guess better how it is now since easier to show/hide destructible than use alot dummy unit and allways recreate special effect on them (HSS=?)

- i use few bj event i know, i will work on it later just mostly i started everything from gui then converted the functions because was easier to set a event in gui then convert to custom text than search for correct event in jasscraft :)

- in condition in few place i cant use TSA (sometimes its block the multiple function running a TSA(0) at end and dont need another variable for it)

- few variable have prefix, maybe not best :D
Inv_ = inventory related variable
Buff_ buff related
Global_ - universal stat related
Stat_ - base stat for equipment units where we store all item bonus (why? because easier to make percentage boost with Stat_ and Globa_ variable arrays)

- TSA used only at end of few trigger like pick up item for avoid the duplication or somewhere where absolute not important the time and dont screw up something, everything else place i used timers

anyway like i said code not updated yet :p

- configurable message means a new function instead the displaytextfor player?

- idk how to make with less hashtable without calculate too much useless thing, and since 100 or how much hashtable possible on map i guess 6 is ok for nearly everything (stats/prod skills/custom windows/trackables/buffs/drop etc), i tryed avoid the overcroweded long keys like x * y + z keys etc

anyway i readed somewhere if a hashtable stored too much data then the reading and writeing into that hashtable is slower

- where i used location?

- i thought too to useing triggers for separate the sub functions but its very hard and gived up because alot function refer to another what also refer to another function so at end will be chaos if i try do it, i tryed separete in header with bigger comments with alot --------------

even maybe kinda chinese how i write but i have my own order (even to peoples that not so easy to get how its work), so header starting with constants, then elements are tagged (full screen crap, item crap, multiboard crap, attachment craps etc)
then in clickTotrackable i have ~every function what closely related with inventory (add icon/remove icon/close window/swap icon and items/clicking checks/buy/sell/equip requiment checking etc)

- at last:
i checked now that system only a bit but seems that also have long triggers :p
but whatever :
- dont show hide destructibles
- camera lock is bad on that system
- dont have equipments
- dont have advanced item handling like at my map with alot item properties (on that map only few regular craps like armor, life, movement bonus etc but only few of them, where is the critical strike damage, reflect, gold or exp bonus etc)
- its show with ugly white background (idk why)
- dont have trackables with mouseover functions
- cant organize ur inventory same time with old inventory
- unit can go over the inventory
- there no such things like multiple system what use same place, also dont have anything about use that place for decoration when inventory not active to u
etc etc correct me if anything not true between what i listed

anyway ty the response, coz i need fix few thing, if u got where i used location then could be cool :)
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
The only coder i know who doesn't even remember the whole code of the system

its inside the Create Hero and Stat point and gold code.

do you readed something what i not?

coz i dont see any location thing there, everything use x,y, so what u watched there?

plsease help em out where u see location, or do u mean to start location? that created the system not me :p

JASS:
function Trig_Hero_Stat_Point_Conditions takes nothing returns boolean
local integer pl = GetPlayerId(GetTriggerPlayer())+1
local integer cv = GetUnitUserData(GetLevelingUnit())
        set udg_Stat_Point[cv] = udg_Stat_Point[cv] + STAT_PER_LV()
        if udg_Camera_Lock[pl] == 1 and udg_Trader[pl] == 0 then
           call ShowStat(pl)
        endif
    return false
endfunction

function AddStaetEquipmentToHero takes unit u returns nothing
local integer class = LoadInteger(udg_FSS, 633, GetUnitTypeId(u))
local integer rnd
local integer w = 1
if class == 0 then
  set rnd = GetRandomInt(1,3)
elseif class == 1 or class == 2 then
  set rnd = 1
elseif class == 3 or class == 4 then
  set rnd = 2
elseif class == 5 then
  set rnd = 3
endif

  if rnd == 1 then
     if class == 1 then
      set w = 3
     else
      loop
      exitwhen w != 3
        set w = GetRandomInt(1,5)
      endloop     
     endif
     call UnitAddItem(u, LoadItemHandle(udg_CItem_Table,GenerateEQ (3, w, 2, GetHeroLevel(u), GetHeroLevel(u), GetUnitX(u), GetUnitY(u), true, 2),100))
     if w < 3 then
        call UnitAddItem(u, LoadItemHandle(udg_CItem_Table,GenerateEQ (5, 1, 2, GetHeroLevel(u), GetHeroLevel(u), GetUnitX(u), GetUnitY(u), true, 2),100))
     endif
  elseif rnd == 2 then
     if class == 3 then
        set w = 6
     else
        set w = 7
     endif
     call UnitAddItem(u, LoadItemHandle(udg_CItem_Table,GenerateEQ (3, w, 2, GetHeroLevel(u), GetHeroLevel(u), GetUnitX(u), GetUnitY(u), true, 2),100))
  elseif rnd == 3 then
     set w = GetRandomInt(7,8)
     call UnitAddItem(u, LoadItemHandle(udg_CItem_Table,GenerateEQ (3, w, 2, GetHeroLevel(u), GetHeroLevel(u), GetUnitX(u), GetUnitY(u), true, 2),100))
  endif
  call UnitAddItem(u, LoadItemHandle(udg_CItem_Table,GenerateEQ (1, rnd, 2, GetHeroLevel(u), GetHeroLevel(u), GetUnitX(u), GetUnitY(u), true, 2),100))
  call UnitAddItem(u, LoadItemHandle(udg_CItem_Table,GenerateEQ (2, rnd, 2, GetHeroLevel(u), GetHeroLevel(u), GetUnitX(u), GetUnitY(u), true, 2),100))
  call UnitAddItem(u, LoadItemHandle(udg_CItem_Table,GenerateEQ (4, rnd, 2, GetHeroLevel(u), GetHeroLevel(u), GetUnitX(u), GetUnitY(u), true, 2),100))
  //add bag
  call UnitAddItem(u, CreateItem('I00U',GetUnitX(u),GetUnitY(u)))

endfunction

function AddInv2Hero takes unit u returns nothing
local integer cv 
local integer i = GetPlayerId(GetOwningPlayer(u))+1
            call SelectUnitAddForPlayer( u, Player(i-1) )
            call SetHeroLevel( u, 5, false )
            call SuspendHeroXP( u, true )
            // make them permanent
            call SetPlayerAbilityAvailable( Player(i-1), MELEE2RANGED_ID(),  false)
            call UnitAddAbility( u, 'A00D' )
            call UnitAddAbility( u, 'A001' )
            call UnitAddAbility( u, 'A005' )
            call UnitAddAbility( u, 'A006' )
            call UnitAddAbility( u, 'A002' )
            call UnitAddAbility( u, 'A007' )
            call UnitAddAbility( u, 'A008' )
            call UnitAddAbility( u, 'A009' )
            call UnitAddAbility( u, 'A00H' )
            call UnitAddAbility( u, 'A00G' )
            call UnitMakeAbilityPermanent(u, true, 'A00D')
            call UnitMakeAbilityPermanent(u, true, 'A001')
            call UnitMakeAbilityPermanent(u, true, 'A002')
            call UnitMakeAbilityPermanent(u, true, 'A005')
            call UnitMakeAbilityPermanent(u, true, 'A006')
            call UnitMakeAbilityPermanent(u, true, 'A007')
            call UnitMakeAbilityPermanent(u, true, 'A008')
            call UnitMakeAbilityPermanent(u, true, 'A009')
            call UnitMakeAbilityPermanent(u, true, 'A00B')
            call UnitMakeAbilityPermanent(u, true, 'A00E')
            call UnitMakeAbilityPermanent(u, true, 'A00G')
            call UnitMakeAbilityPermanent(u, true, 'A00H')
            set cv = GetUnitUserData(u)
            set udg_Stat_Point[cv] = udg_Stat_Point[cv] + START_POINT()
            call StatRefresh (cv)
            call AddStaetEquipmentToHero (u)
            call SaveBoolean(udg_Stat_Table, 8890, GetHandleId(u), true)
            call TriggerRegisterUnitEvent( gg_trg_Start_Inventory, u, EVENT_UNIT_SPELL_EFFECT )
endfunction

function Trig_Create_Heroes_and_gold_for_test_Actions takes nothing returns nothing
local integer i = 1
local real x 
local real y 
local trigger t1 = CreateTrigger()
local unit u
local integer id
call TriggerAddCondition( t1, Condition( function Trig_Hero_Stat_Point_Conditions ) )

    loop
        exitwhen i > 12
        if ( GetPlayerSlotState(Player(i-1)) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(Player(i-1)) == MAP_CONTROL_USER ) then
            set x = GetPlayerStartLocationX(Player(i-1))
            set y = GetPlayerStartLocationY(Player(i-1))
            set u = CreateUnit( Player(i-1), 'H000', x, y, bj_UNIT_FACING )
            call TriggerRegisterUnitEvent( t1, u, EVENT_UNIT_HERO_LEVEL )
            set udg_Hero[i] = u
            call AddInv2Hero(u)
            set u = CreateUnit( Player(i-1), 'Hpal', x+100, y, bj_UNIT_FACING )
            call TriggerRegisterUnitEvent( t1, u, EVENT_UNIT_HERO_LEVEL )
            call AddInv2Hero(u)
            set u = CreateUnit( Player(i-1), 'Hvwd', x+100, y+100, bj_UNIT_FACING )
            call TriggerRegisterUnitEvent( t1, u, EVENT_UNIT_HERO_LEVEL )
            call AddInv2Hero(u)
            call TriggerRegisterPlayerChatEvent( gg_trg_Trade_Gold_amount, Player(i-1), GetEventPlayerChatString(), true )
            call SetPlayerState( Player(i-1), PLAYER_STATE_RESOURCE_GOLD, 100000 )
            if GetLocalPlayer() == Player(i-1) then
             call ClearSelection()
            endif
        endif
        set i = i + 1
    endloop
set t1 = null
set u = null
call CWInterface()
call ShowTradeWindow()
endfunction

//===========================================================================
function InitTrig_Create_Heroes_and_gold_for_test_and_Lv_up_func takes nothing returns nothing
    set gg_trg_Create_Heroes_and_gold_for_test_and_Lv_up_func = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_Create_Heroes_and_gold_for_test_and_Lv_up_func, 1.00 )
    call TriggerAddAction( gg_trg_Create_Heroes_and_gold_for_test_and_Lv_up_func, function Trig_Create_Heroes_and_gold_for_test_Actions )
endfunction
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
[UPDATE]
- fix few trade problem (in normal 0.95 u was unable to leave or even u quited there was still the trade partner gold floating text)
- added ally function + replace the red startlocation function to native function what dont use location - in create heroes trigger
- few indentation thing

its now i guess a stable version still if someone find bug then please tell me but i guess now its pretty ok

Pastebin codes updated too
 
Coding efficiency aside, there's still some bugs with the system in general, for instance, it's possible to get negative resistances (which become more negative) when you reset attributes (as well as negative armour values) should not be possible really, your test map forgot to block flying units, so you can put an owl scout in there, but that's a semantics thing so not really a problem. It's a bit awkward to get out of the menu with the exit buttons right next to the hero selection boxes, and out of curiousity, what happens if two players are in their inventory at the same time?

You also have a textag bug where you can get them overlapping by spam-clicking them with a hero

The text could be a little more obvious I suppose on it (increase font size?)
, additionally, your clock timer area, should change back after selecting an item, and then click off from it

As far as other things, I'd suggest making it auto-exit when your hero takes damage, and making it inaccessible when the hero recently took damage as a configurable option for people
 

Attachments

  • Bug.png
    Bug.png
    620.5 KB · Views: 105
Level 17
Joined
Nov 13, 2006
Messages
1,814
Coding efficiency aside, there's still some bugs with the system in general, for instance, it's possible to get negative resistances (which become more negative) when you reset attributes (as well as negative armour values) should not be possible really, your test map forgot to block flying units, so you can put an owl scout in there, but that's a semantics thing so not really a problem. It's a bit awkward to get out of the menu with the exit buttons right next to the hero selection boxes, and out of curiousity, what happens if two players are in their inventory at the same time?

You also have a textag bug where you can get them overlapping by spam-clicking them with a hero

The text could be a little more obvious I suppose on it (increase font size?)
, additionally, your clock timer area, should change back after selecting an item, and then click off from it

As far as other things, I'd suggest making it auto-exit when your hero takes damage, and making it inaccessible when the hero recently took damage as a configurable option for people

when happen that negative ressitance? coz i still not experienced with it :/

about flying unit, i used land pathing blocker, i could change that to both

about 2 player in their inventory: both see his inventory, dont make any effect the player A inventory to other player B inventory

when occur the textbug? i found your ss[/b[ - i will fix it

about increased font size, its a bit ugly if i change the size, i could import a better font but i dont see any reason for that coz then need more space for stats and i want make the system space efficient

about auto exit when u reicive the damage is bad, could be easily abused :/

I think this system shall use CSS by Doomlord.
i dont want more ability than needed.....
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
update
- fixed the floating text thing
- fixed the air unit entering to inv. area thing
- inventory sensibility command added (i dont want sure how the best and now close inventory if any of your unit attacked but i can change to specially to only inventory unit, idk what better)

Negative armour and such occurs when you reset stat bonuses (specifically I put a tonne on agility and strength on the ranger, then pressed it and had negative values)

that not bug, in gameplay constant the default defence value before agility is -2, since you restat allways to 5 agility and 3 agility =1 defence result will be -1 armor, its normal but anyway i disable the defence bonus per agility and setted to 0 the default defence because i dont use the regular armor/damage system
 
Top