• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

Harvesting, Living market npc, crafting methode

Status
Not open for further replies.
Level 17
Joined
Nov 13, 2006
Messages
1,814
i want show this methode because i think maybe somebody think its usefull and make a tutorial witj correct english :D

Few word about system:

- i use unit models for make visually a gathering, each second decrease the target hp until u channel the harvest hidden ability, but if channel ability interrupted then target(materia) healed back, also until harvesting process cant harvest another unit same materia

- i use harvest ability simple reason: i use villager npc and melee ranged transform but if i use ability with 50 range then ranged villager also act like melee, since during this proces i remove unit attachment and replace with pickle, after harvest provcess i remove pickle and reattach the weapon

- npc's sleeping at night, and their house have sleeping effect

- any hero can harvest who got harvest hidden ability, so players too not just bots

- can make more harvester npc, with different job, atm for me 1 harvest herbs another harvest mats.

- when harvester bot return to home then give the harvested items to home and u can buy their, so acctually bots store every collected item at their house (like in settlers), when u buy 1 item then its decrease the item stock in house or in unit by 1.

- u can craft item with mats at market npc (ofc if dont have enough mats then its dont crafted), with progressbar (look like crafting but unit training and unit will removed after item is created)

Now coming the buggy part:
- if u buy from harvester bot during harvesting process then u interupt his job for 1 sec :p
- sometimes bots go away for a short time but return back to job

so if somebody can fix it the its a fairly good system if u improve this idea line

i upload the map and few ss, also snce i alot time replace the attachment files, i dont gived credits yet, but if somebody want use this attachment pls do that :p

@Hashjie - not just for rpg, its new way in strategy

Image this because possible:
since every harvester can do cuztomizable job, also easy add a new one if we use 1 timer + linked list for indexing harvesters

- 1 harvester cut down tree, 1 extract stone, 1 extract iron and bring to material headquearter and u build buildings via this materia, so gold+lumber building is past, u can use any materia for building, same like at crafting

- since each headqueater can store 11-12 item type, u can make 1 for constr. materials, 1 for food, 1 for raw food materia (flour,wheat,water etc)

- 1 harvester gather wheat and seed it when he cant harvest in x range more wheat. then 1 carrier harvester bot bring mats to hq, bring wheat to mill, another carry bring flour and water to bakery

- harvester bots could change profession easily if u use a integer array (ex: Job[harvester cv]=x, example 1 woodcutter,2 forester,3 farmer, 4 miller, 5 baker, 6 stone manson ..... 99 carry, 100 soldier, etc)

- if make harvest bots t hero, then u can level up them and example a lv10 woodcutter could be also carpenter etc etc etc

maybe u understand this is a new way, so u can do settler/culture kind from normal wc3



Header & map init
JASS:
function AddUnitToMatList takes unit u returns nothing
    local integer i = 0
    loop
        exitwhen udg_H_HUA[i] == null
        set i = i + 1
    endloop
    set udg_H_HUA[i] = u
    if i > udg_H_Mat_Index then
        set udg_H_Mat_Index = i
    endif
endfunction

function SearchUnitInMatList takes integer t, integer cv returns integer
    local integer i = 0
    local integer f = - 1
    local integer pv
    local integer cvhq = GetUnitUserData( udg_H_Home[cv] )
    local integer stock
    local real gtime = GetTimeOfDay( )
    loop
        exitwhen i > udg_H_Mat_Index or f != - 1
        set cv = GetUnitUserData( udg_H_HUA[i] )
        if udg_Buff_Harvest[cv] == false and gtime < 18.00 and gtime > 6.00 and udg_H_HUA[i] != null and udg_H_Target[cv] == null then
            set pv = GetUnitPointValue( udg_H_HUA[i] )
            set stock = LoadInteger( udg_H_Stock_Table, cvhq, pv )
            if stock < udg_H_StockMax then
                if t==1 then
                    if pv < 50 then
                        set f = i
                    endif
                elseif t==2 then
                    if pv >= 50 then
                        set f = i
                    endif
                endif
            endif
        endif
        set i = i + 1
    endloop
    return f
endfunction


function RemoveUnitFromMatList takes unit u returns nothing
    local integer i = 0
    loop
        exitwhen udg_H_HUA[i] == u
        set i = i + 1
    endloop
    set udg_H_HUA[i] = null
    if i == udg_H_Mat_Index then
        set udg_H_Mat_Index = udg_H_Mat_Index - 1
    endif
endfunction

harvest creating (if u modify then u can use linked list so then u can customize easily and change his job with simple select diff. target than normal)
JASS:
    local integer i = 0
    local integer a
    local integer v = 1
    local integer cv
    local integer t
    local unit u
    local real x
    local real y
            set x = GetRandomReal(GetRectMinX(udg_Region[1]), GetRectMaxX(udg_Region[1]))
            set y = GetRandomReal(GetRectMinY(udg_Region[1]), GetRectMaxY(udg_Region[1]))
            set udg_HarvesterBot[0] = CreateUnit( Player(PLAYER_NEUTRAL_PASSIVE), 'n005', x, y, 0 )
            set x = GetRandomReal(GetRectMinX(udg_Region[0]), GetRectMaxX(udg_Region[0]))
            set y = GetRandomReal(GetRectMinY(udg_Region[0]), GetRectMaxY(udg_Region[0]))
            set cv = GetUnitUserData(udg_HarvesterBot[0])
            set udg_H_Job[cv] = 1
            set udg_H_Home[cv] = CreateUnit( Player(PLAYER_NEUTRAL_PASSIVE), 'n007', x, y, 0 )
            set x = GetRandomReal(GetRectMinX(udg_Region[1]), GetRectMaxX(udg_Region[1]))
            set y = GetRandomReal(GetRectMinY(udg_Region[1]), GetRectMaxY(udg_Region[1]))
            call TriggerRegisterUnitInRange( gg_trg_Harvester_home, udg_H_Home[cv], 50.00, null )
            set udg_HarvesterBot[1] = CreateUnit( Player(PLAYER_NEUTRAL_PASSIVE), 'n008', x, y, 0 )
            set x = GetRandomReal(GetRectMinX(udg_Region[0]), GetRectMaxX(udg_Region[0]))
            set y = GetRandomReal(GetRectMinY(udg_Region[0]), GetRectMaxY(udg_Region[0]))
            set cv = GetUnitUserData(udg_HarvesterBot[1])
            set udg_H_Job[cv] = 2
            set udg_H_Home[cv] = CreateUnit( Player(PLAYER_NEUTRAL_PASSIVE), 'n009', x, y, 0 )
            call TriggerRegisterUnitInRange( gg_trg_Harvester_home, udg_H_Home[cv], 50.00, null )

buffing+harvesting same timer
JASS:
function Trig_Timer_Actions takes nothing returns nothing
    local integer buffvalue // R2I(Pow(buffid, 2)) buffvalue what i add to unit buff value
    local integer bv //buff value
    local integer i = 0
    local integer pv = 0
    local integer cc 
    local integer po = 0
    local integer cv
    local integer count = 0
    local integer buffid = 0
    local integer maxbuff = udg_Buff_Max
    local integer times = 0

    loop
        exitwhen i > udg_Buff_IndexB
        if udg_Buff_Unit[i] != null then
            set cv = GetUnitUserData(udg_Buff_Unit[i])
            if IsUnitType(udg_Buff_Unit[i], UNIT_TYPE_DEAD) or udg_Buff_Purge[cv] then
                call ClearUnitBuff (i, cv)
            else
                set bv = udg_Buff_Value[cv]
                if bv > 0 then
                    loop
                        exitwhen bv == 0
                        set po = udg_Buff_ID2V[maxbuff - count]
                        if bv >= po then
                            set bv = bv - po
                            set buffid = maxbuff - count//maxbuff - count
                            set times = LoadInteger(udg_Buff_Timer, cv, buffid)
                            if times < 1 then
                                call RemoveUnitBuff (i, buffid)
                            else
                                call SaveInteger(udg_Buff_Timer, cv, buffid, times - 1)
                            endif
                        endif
                        set count = count + 1
                    endloop
                endif
                set count = 0
                set udg_Buff_Purge[cv] = false
            endif
        endif
        set i = i + 1
    endloop
    set i = 0
    loop
        exitwhen i > udg_Buff_IndexH
        set cv = GetUnitUserData(udg_Buff_HUnit[i])
        if IsUnitType(udg_Buff_HUnit[i], UNIT_TYPE_DEAD) or IsUnitType(udg_Buff_HTarget[cv], UNIT_TYPE_DEAD) or OrderId2String(GetUnitCurrentOrder(udg_Buff_HUnit[i])) != "harvest" then
            call UnitRemoveAbility( udg_Buff_HUnit[i], udg_HarvesterAbility )
            call UnitAddAbility( udg_Buff_HUnit[i], udg_HarvesterAbility )
            set udg_Buff_Harvest[GetUnitUserData(udg_Buff_HTarget[cv])] = false
            call SetWidgetLife(udg_Buff_HTarget[cv], 100)
            set udg_Buff_HUnit[i] = null
            set udg_Buff_HTarget[cv] = null
            set udg_Buff_Harvested[cv] = 0
        else
            if udg_Buff_Harvested[cv] < 10 then
                call SetWidgetLife(udg_Buff_HTarget[cv], 100 - udg_Buff_Harvested[cv] * 10)
                set udg_Buff_Harvested[cv] = udg_Buff_Harvested[cv] + 1

            else
                call UnitRemoveAbility( udg_Buff_HUnit[i], udg_HarvesterAbility )
                call UnitAddAbility( udg_Buff_HUnit[i], udg_HarvesterAbility )
                set pv = GetUnitPointValue(udg_Buff_HTarget[cv])
                call DestroyEffect ( AddSpecialEffect (udg_Effects[61], GetUnitX(udg_Buff_HTarget[cv]), GetUnitY(udg_Buff_HTarget[cv])))
                //call GroupRemoveUnit(udg_H_HUA, udg_Buff_HTarget[cv])
                call RemoveUnitFromMatList(udg_Buff_HTarget[cv])

                if GetUnitPointValue(udg_Buff_HUnit[i]) < 2000 then
                      call CreateItemToHero (udg_Buff_HUnit[i], udg_H_Items[pv], 1)
                      call cattachment (GetPlayerId(GetOwningPlayer(udg_Buff_HUnit[i]))+1,0)
                   else
                      //set udg_H_Count[pv] = udg_H_Count[pv] + 1
                      set cc = LoadInteger(udg_H_Stock_Table, cv, pv) + 1
                      call SaveInteger(udg_H_Stock_Table, cv, pv, cc)
                      call AddItemToStock( udg_Buff_HUnit[i], udg_H_Items[pv], cc, cc )
                      set udg_H_Target[cv] = null
                endif

                call DestroyEffect( udg_PickAxe[cv] )
                set udg_Buff_Harvest[GetUnitUserData(udg_Buff_HTarget[cv])] = false
                set udg_Buff_HUnit[i] = null
                call KillUnit( udg_Buff_HTarget[cv] )
                set udg_Buff_HTarget[cv] = null
                set udg_Buff_Harvested[cv] = 0

            endif

        endif

        set i = i + 1

    endloop
endfunction

//===========================================================================
function InitTrig_Timer takes nothing returns nothing
    set gg_trg_Timer = CreateTrigger( )
    call TriggerRegisterTimerEventPeriodic( gg_trg_Timer, 1.00 )
    call TriggerAddAction( gg_trg_Timer, function Trig_Timer_Actions )
endfunction

rest harvest thing
JASS:
function Trig_Harvest_Conditions takes nothing returns boolean
* * * * return udg_H_Unit[GetUnitPointValue(GetOrderTargetUnit())] == GetUnitTypeId(GetOrderTargetUnit()) and udg_Buff_Harvest[GetUnitUserData(GetOrderTargetUnit())] == false and OrderId2String(GetUnitCurrentOrder(GetTriggerUnit())) == "smart"
endfunction




function Trig_Harvest_Actions takes nothing returns nothing
local integer pv = GetUnitPointValue(GetTriggerUnit())
* * if pv < 2000 then
* * call rattachment (GetPlayerId(GetTriggerPlayer())+1,0)
* * endif
* * call IssueTargetOrder( GetTriggerUnit(), "harvest", GetOrderTargetUnit() )




endfunction




//===========================================================================
function InitTrig_Harvest takes nothing returns nothing
* * set gg_trg_Harvest = CreateTrigger( *)
* * call TriggerRegisterAnyUnitEventBJ( gg_trg_Harvest, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
* * call TriggerAddCondition( gg_trg_Harvest, Condition( function Trig_Harvest_Conditions ) )
* * call TriggerAddAction( gg_trg_Harvest, function Trig_Harvest_Actions )
endfunction

JASS:
function Trig_Start_Harvest_Conditions takes nothing returns boolean
    return udg_HarvesterAbility == GetSpellAbilityId()
endfunction

function Trig_Start_Harvest_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit t = GetSpellTargetUnit()
local integer pv = GetUnitPointValue (u)
    set udg_CV=NewHarvesterIndex()
    set udg_Buff_Harvest[GetUnitUserData(t)] = true
    set udg_Buff_HTarget[GetUnitUserData(u)] = t
    set udg_Buff_HUnit[udg_CV] = u
    if pv < 2000 then
        set udg_PickAxe[udg_CV] = AddSpecialEffectTarget("Pickle.mdl", u, "hand left")
    endif
set u = null
set t = null
endfunction

//===========================================================================
function InitTrig_Start_Harvest takes nothing returns nothing
    set gg_trg_Start_Harvest = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Start_Harvest, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_Start_Harvest, Condition( function Trig_Start_Harvest_Conditions ) )
    call TriggerAddAction( gg_trg_Start_Harvest, function Trig_Start_Harvest_Actions )
endfunction

the engine, maybe here the problem why the bot hit the target and after 3 sec run away then run back and continue and finish the harvesting
JASS:
function Trig_Harvester_bot_Actions takes nothing returns nothing
    local integer i = 0
    local integer targetid
    local integer mat_filter
    local unit u
    local integer cv
    local string horder
    local real gtime = GetTimeOfDay( )
    loop
        exitwhen i > udg_H_Max_Bot
        set u = udg_HarvesterBot[i]
        set cv = GetUnitUserData( u )
        set horder = OrderId2String( GetUnitCurrentOrder( u ) )
            if udg_H_Action[cv] != 0 and gtime < 18.00 and gtime > 6.00 then
                set udg_H_Action[cv] = 0
                call PauseUnit ( udg_HarvesterBot[i], false )
                call ShowUnit( udg_HarvesterBot[i], true )
                call DestroyEffect ( udg_H_SF[cv] )
                set udg_H_Target[cv] = null
            endif

        if udg_H_Action[cv] == 0 and udg_H_Target[cv] == null then
                set mat_filter = udg_H_Job[cv]
                set targetid = SearchUnitInMatList ( mat_filter, cv )
                if targetid != - 1 then
                    set udg_H_Target[cv] = udg_H_HUA[targetid]
                    call IssueTargetOrder( udg_HarvesterBot[i], "smart", udg_H_Target[cv] )
                    else
                    set udg_H_Action[cv] = 1
                    set udg_H_Target[cv] = null                      
                    call IssuePointOrder ( u, "move" , GetUnitX( udg_H_Home[cv] ), GetUnitY( udg_H_Home[cv] ) )
                endif
        endif

        if horder != "harvest" and udg_H_Target[cv] != null and udg_H_Action[cv] == 0 then
            call IssueTargetOrder( u, "smart", udg_H_Target[cv] )
        endif

       if (( gtime > 18.00 or gtime < 6.00 ) and udg_H_Target[cv] == null and udg_H_Action[cv] == 0) and horder != "harvest" or udg_H_Action[cv] == 1 and udg_H_Target[cv] == null and horder != "harvest"  then
                    set udg_H_Action[cv] = 1
                    call IssuePointOrder ( u, "move" , GetUnitX( udg_H_Home[cv] ), GetUnitY( udg_H_Home[cv] ) )
       endif
       set i = i + 1
    endloop
    set u = null
endfunction

//===========================================================================
function InitTrig_Harvester_bot takes nothing returns nothing
    set gg_trg_Harvester_bot = CreateTrigger( )
    call TriggerRegisterTimerEventPeriodic( gg_trg_Harvester_bot, 3.00 )
    call TriggerAddAction( gg_trg_Harvester_bot, function Trig_Harvester_bot_Actions )
endfunction

home/sleeping
JASS:
function Trig_Harvester_home_Conditions takes nothing returns boolean
local integer cv = GetUnitUserData(GetTriggerUnit())
    return udg_H_Action[cv] == 1 and udg_H_Job[cv] > 0
endfunction

function Trig_Harvester_home_Actions takes nothing returns nothing
local integer i = 0
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer hqcv = GetUnitUserData(udg_H_Home[cv])
local integer stock
local integer hqstock
    set udg_H_Action[cv] = 2
    call ShowUnit(u, false)
    call PauseUnit (u, true)
    set udg_H_SF[cv] = AddSpecialEffectTarget(udg_Effects[60], udg_H_Home[cv], "overhead")
loop
exitwhen i > 100
set hqstock = LoadInteger(udg_H_Stock_Table, hqcv, i)
set stock = LoadInteger(udg_H_Stock_Table, cv, i)
if stock > 0 then
    call RemoveItemFromStock( u, udg_H_Items[i] )
    call AddItemToStock( udg_H_Home[cv], udg_H_Items[i], stock+hqstock, stock+hqstock )
endif
set i = i + 1
endloop
set u = null
endfunction

//===========================================================================
function InitTrig_Harvester_home takes nothing returns nothing
    set gg_trg_Harvester_home = CreateTrigger(  )
    call TriggerAddCondition( gg_trg_Harvester_home, Condition( function Trig_Harvester_home_Conditions ) )
    call TriggerAddAction( gg_trg_Harvester_home, function Trig_Harvester_home_Actions )
endfunction

decrease stock item
JASS:
function Trig_Buy_from_Harvesterbot_Conditions takes nothing returns boolean
local integer pv = GetUnitPointValue(GetSellingUnit())

    return pv == 1000 or pv > 1999
endfunction

function Trig_Buy_from_Harvesterbot_Actions takes nothing returns nothing
local item it = GetSoldItem()
local unit u = GetSellingUnit()
local integer cv = GetUnitUserData(u)
local integer pv = GetItemLevel(it)
local integer stock = LoadInteger(udg_H_Stock_Table, cv, pv) - 1

call SaveInteger(udg_H_Stock_Table, cv, pv, stock)

        if stock == 0 then
            call RemoveItemFromStock( u, udg_H_Items[pv] )
        else
            call AddItemToStock(u, udg_H_Items[pv], stock, stock )
         
        endif

set it = null
endfunction

//===========================================================================
function InitTrig_Buy_from_Harvesterbot takes nothing returns nothing
    set gg_trg_Buy_from_Harvesterbot = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Buy_from_Harvesterbot, EVENT_PLAYER_UNIT_SELL_ITEM )
    call TriggerAddCondition( gg_trg_Buy_from_Harvesterbot, Condition( function Trig_Buy_from_Harvesterbot_Conditions ) )
    call TriggerAddAction( gg_trg_Buy_from_Harvesterbot, function Trig_Buy_from_Harvesterbot_Actions )
endfunction

 

Attachments

  • 1.jpg
    1.jpg
    209.4 KB · Views: 167
  • 2.jpg
    2.jpg
    204.2 KB · Views: 159
  • 3.jpg
    3.jpg
    210.4 KB · Views: 162
  • 4.jpg
    4.jpg
    219.4 KB · Views: 394
  • 49new.w3x
    2.1 MB · Views: 74
Last edited:
Level 14
Joined
Apr 20, 2009
Messages
1,543
I must say shadowvzs you've surpassed yourself this time!

This is an awesome idea and a great system, sadly enough I do not have the time to help fixing these bugs or to help creating a tutorial on it :(
I would have loved to do it if only I had more time >.<! I'm way to bussy these days :S
Eeeerm 1 thing though, shouldn't this be in a different forum ^.^..?

Either ways, you deserve a +rep from me :goblin_good_job:
I guess you're going to implement this into your RPG Template? :ogre_datass:

Really, outstanding work bro ;)

EDIT: I haven't tested the map yet, I just looked at the description and screenshots and it sounds promising.
I have to go to sleep that's why I didn't test it yet. I'll do so tomorrow.
I'm not sure if you've already thought of this but:

You might be abled to implement a function with a chat command for example:
-equip

Which then displays this multiboard. (Make sure to store which multiboard was shown previously to that player).
Then when the player presses the minimize multiboard button, you can show the previous multiboard that the player had.
Just make sure you show the multiboard locally to each player and that you hide the equip multiboard before showing the previous multiboard.

(I did this before in a map that I was creating with a friend of mine)

I used it like this:
-score

To see how many double kills/tripple kills etc a player has made and how much "stat" points that player has.
This was linked to a save/load system. The stat points where used for removing restrictions on items that can only be bought when the player has achieved certain stats.
For each multikill the player recieved stats, they also recieved stats when the game ends and when certain rounds where won.

Then in order to have less leavers I made sure that the save code was shown at the end of the game locally for each player.
Which they can then use to load their stats the next game :p.
Also: Ranks ^.^

(Just some idea's for your RPG template, I hope you like them)
Allthough I doubt that the score system will be usefull for RPG's though. But the chat command appearing multiboard might be nice.
 
Last edited:
Level 17
Joined
Nov 13, 2006
Messages
1,814
double and triple kill i dont think good ideea if we talk about rpg, since rpg mostly not player vs player.

also unequip done via dialog button (show only unequipable items ofc)

multiboard done with array

but 1st i edited 1st post, maybe now u can understand this thing more better for strategy, than rpg, at rpg just increase the fun but in strategy case its a new engine, u can use material based buildings and not gold+lumber, u can select harvesters job (if u select mushroom than that harvester will harvest mushroom instead stone)

!!! most jass code uploaded for system, so u can review maybe u find the problem!!!
 

Attachments

  • 5.jpg
    5.jpg
    228.5 KB · Views: 136
Level 7
Joined
Jan 28, 2012
Messages
266
Nice job,
I have a couple of questions. Why does your home function the way it does? wouldn't be better to have each unit set its home separately? wouldn't linked lists work better? also why are you using point value?

also where is the function rattachment? (i don't have access to W editor otherwise i would have downloaded your map) Edit: Got home, found it.

what problem are you having?

(slightly off topic) this has a similar concept to something i am working on
 
Last edited:
Level 17
Joined
Nov 13, 2006
Messages
1,814
Nice job,
I have a couple of questions. Why does your home function the way it does? wouldn't be better to have each unit set its home separately? wouldn't linked lists work better? also why are you using point value?

also where is the function rattachment? (i don't have access to W editor otherwise i would have downloaded your map) Edit: Got home, found it.

what problem are you having?

(slightly off topic) this has a similar concept to something i am working on

1. my home function transfer the items from harvester bot, to head quester/home, so if bot gathered 2 mushroom then remove that 2 from him and add to home, also in this part i attach sleeping animation to building, hide the harvester bot so look like the bot is resting

2. in map init i set separetly also damn easily u can set another home because home look like this H_Home[custom value of harvester bot], each bot have different custom value so u can set different home to every bot

3. its something like linked list, just here i dont shift the current units because then i must change every value in hashtable and variables, so overall its pretty same output i think

4. point value make easier life
example if mushroom got 50 point value then i dont must check every harvestable item== with harvested item, simple just check point value and give that item so if point value is 50 then i give mushroom item to unit what is H_Items[50] => so basically after u harvested a item u dont need loop for check the unit type just give h_item[harvested unit point value]

also this a good way to identify the units, example what is home and what harvesting, harvested unit or what is normal unit. with if combinations u can use for damn much thing,
example in my map i use for make different between ranged unit/magical/melee normal, same time make difference between harvestable unit also make difference between harvester bots (but this replaceable with job variable, i use that now)

u can convert easily the unit to item if u use point value like item array index and also back (not needed but good) if u use item level for make difference between harvested materia (item level also usefull for save the stocked items, example in hashtable key1=stock unit custom value, key2= harvested item level and u save the amount what u got at that stock building/unit)

5. rattachment and cattachment, i dont copied but u can check in map, its basically 2 function what remove the attachments from hero and create back. why? coz if u want use a villager on ur map, then removeing a attached weapon need few sec till effect die after it is destroyed, but if u use bear form ability then its instant, so basically i made a if, if a player villager hero is the harvester, then remove his weapon attachment instantly and give to him a pick axe attachment and after harvesting is done then replace back to normal weapon, if any other unit the harvester unit then we dont need this

6. maybe that topic have similiar subject but i dont readed that until yesterday night, coz i made this longer ago just now i made bot's too for neutral hostile units, mostly 2 week ago got ideea after i made my buff system, if u check the map u can use more buff same time with single timer and without any visible buff icon thats why harvesters was the next since it is work similiar way than that and than my arrow rain what is in spell section (every sec check unit order+~unit array with 1 timer) :p

1st time when i watched similiar ideea was the island of settlers map, where u harvested stone, just it gived gold, after that appeared more similiar ideeas, but allways somehow unfinished, so or was eye candy the harvesting but u cant see the item, or simple harvest with item.

somehow it must be a system what look good, also player can follow what happen with harvested thing, not just a increase something in multiboard, if u use market or item in invetory for show what happen with harvested thing is more realistic way.
1st of all, market item storeing got 1 bugg, interrupt the order if unit harvesting but another side can hold 2x more item type, also if u mix the both then i think is a better way (so harvesting unit store item in inventory then give to hq/home/storage building where u use market item selling)

i dont watched yet any system where u can follow what happen with harvested materia and i dont like that when materia just a 1 number from sky, with hashtable+market u can make storage from every unit

(a bit look like settlers 2, yea that was my favorite strategy and i think 1st what was most exciting in that style [1996])
 
Last edited:
Level 7
Joined
Jan 28, 2012
Messages
266
ahhh okay, that makes sense

i understand why you are using the point value now,

thanks for explaining.


my comment about the something i am working, stemmend from the fact that i haven't seen any wc3 maps that have automation besides yours uses a completely different method from what i am working on,
I haven't played settlers two, but i have played the settlers Heritage of a king.
 
Last edited:
Level 17
Joined
Nov 13, 2006
Messages
1,814
then i show a pic
http://games.holyfile.com/upload/screenshot2097-1.jpeg

basically, have carriers and workers, carrier bring mat/raw resource to building or from building to storage building (if not primary mat building because example a woodcutter dont need mat but a sawmill building need)

then worker go out do his job, come back to home and carrier bring it to storage building from home. acctually here market type storage buildings look like a bit like headquearter/storage building in settlers coz u can follow the mat visually too just here u need more storage for all materia :)
 
Status
Not open for further replies.
Top