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

March 2013 News Batch

Status
Not open for further replies.

178091-albums5176-picture57849.png

March 2013 News Batch

Contributions by:
rankmod.gif
[c]I3lackDeath (Resource Moderator)
[r]
rankmod.gif
[c]Magtheridon96 (Resource Moderator)
178091-albums5176-picture67310.png

178091-albums5176-picture67311.png
178091-albums5176-picture67312.png
178091-albums5176-picture67313.png
178091-albums5176-picture67314.png

178091-albums5176-picture67315.png
178091-albums5176-picture67316.png
178091-albums5176-picture67317.png
178091-albums5176-picture67318.png

178091-albums5176-picture67319.png
178091-albums5176-picture67320.png
178091-albums5176-picture67321.png
178091-albums5176-picture67322.png

178091-albums5176-picture67323.png

(Click the icons above - they will take you to the respective News Batch section.)

178091-albums5176-picture67140.png

(Click the tabs below to switch between different Resource Spotlights)

Maps

Models

Icons

Spells


Top 5 Maps of March

178091-albums5176-picture67646.jpg
custom_1.gif
Over the Hills Ep.1
Type: Cinematic
Category: Miscellanous / Other
Author: tobyfat50

178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
(Highly Recommended)
php_space01.gif

178091-albums5176-picture67647.jpg
custom_12.gif
Azeroth Marathon AI
Type: Mini-Game, RPG
Category: Medieval / Warcraft
Author: HammerFist132

178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55343.gif
(Recommended)
178091-albums5176-picture67648.jpg
custom_12.gif
Splatter
Type: Melee
Category: Medieval / Warcraft
Author: normalice

178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55343.gif
(Recommended)
php_space01.gif


178091-albums5176-picture67649.jpg
custom_8.gif
Magical Forest
Type: Template / Terrain
Category: Miscellanous / Other
Author: Situ

178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55343.gif
(Recommended)
php_space01.gif


178091-albums5176-picture67650.jpg
custom_12.gif
Road of Glory
Type: Hero Arena, Other
Category: Medieval / Warcraft
Author: Tirlititi

178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55343.gif
(Recommended)
php_space01.gif



Top 5 Models of March

178091-albums5176-picture67831.jpg
BE Arcane Annihilator
Type: Unit
Category: Mechanical, Other, BE
Author(s): Frankster

178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
(Highly Recommended)
178091-albums5176-picture67832.jpg
Orb of Fire
Type: Missile
Category: Orc, Creep, Demon, etc.
Author: UgoUgo

178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55343.gif
(Recommended)
178091-albums5176-picture67833.jpg
Gorynych
Type: Unit
Category: Creep, Dinosaur/Prehistoric
Author: Doom Wolf

178091-albums5176-picture55343.gif
178091-albums5176-picture55343.gif
178091-albums5176-picture55343.gif
178091-albums5176-picture55343.gif
178091-albums5176-picture55343.gif
(Not rated)
178091-albums5176-picture67834.jpg
Goblin Flame Tank
Type: Unit
Category: Goblin
Author: MiniMage

178091-albums5176-picture55343.gif
178091-albums5176-picture55343.gif
178091-albums5176-picture55343.gif
178091-albums5176-picture55343.gif
178091-albums5176-picture55343.gif
(Not rated)
178091-albums5176-picture67835.jpg
Swordsman
Type: Hero
Category: Human
Author: Kitabatake

178091-albums5176-picture55343.gif
178091-albums5176-picture55343.gif
178091-albums5176-picture55343.gif
178091-albums5176-picture55343.gif
178091-albums5176-picture55343.gif
(Not rated)

Top 6 Icons of March




BTNHellishMastery by Marcos DAB

BTNGoblinHeroAviator by Marcos DAB

BTNEating by Sin'dorei300

BTNAirRevenant by Sin'dorei300

BTNDarknessStorm by UgoUgo

BTNHearbreak by PeeKay

Top 5 Spells of March

178091-albums5176-picture67678.jpg
Arcane Drain
Type: Target Ground
Category: GUI / Triggers
Author: Tank-Commander

178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55343.gif
(Recommended)
php_space01.gif

178091-albums5176-picture67679.jpg
Clonestar
Type: Target Ground
Category: GUI / Triggers
Author: Kyousuke Imadori

178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55343.gif
(Recommended)
178091-albums5176-picture67680.jpg
Item Restriction System
Type: System
Category: JASS, JESP
Author: Doomlord

178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55343.gif
(Recommended)
php_space01.gif


178091-albums5176-picture67681.jpg
Physical Damage Detection
Type: System
Category: JASS, GUI / Triggers
Author: looking_for_help

178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55343.gif
(Recommended)
php_space01.gif


178091-albums5176-picture67682.jpg
Volcanic Crush
Type: Target Object
Category: GUI / Triggers
Author: Tank-Commander

178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55343.gif
(Recommended)
php_space01.gif



178091-albums5176-picture67138.png

178091-albums5176-picture59148.jpg
God's Word: The True Way (by PUVer)

<<Welcome to Farrield - the world where gods play with destinies of mortals, where Lady Magic unofficially rules and abandoned caves and dark dungeons keep mighty arthefacts, where always is the power that decides to break the balance and to tip the scales to their advantage!>>
Be sure to continue checking out the Hive's news section, a new post will be released later with a more detailed coverage of the Project of March 2013.

Type: SPRPG
178091-albums5176-picture67822.jpg
Requiem (by Kithraya)

<<I decided to create a map, which is derived by the graphics engine as possible, to create beautiful landscapes, a magical world, a rich storyline and lots of NPCs.
The project is titled Requiem. This is an adventure game (solving logical puzzles) and RPG.>>

Type: Adventure/RPG
178091-albums5176-picture67820.jpg
Extreme Survival (by UndeadImmortal)

<<Extreme Survival is a survival/defense map, which features a customized UI, different item types with attach models, an advanced damage display system, etc.>>
A playable version is available, check out the project's thread!

Type: Survival/Defense
178091-albums5176-picture67821.jpg
Heroes Tale (by Hell_Master)

<<Heroes Tale is a typical RPG inspired by Diablo III: Your hero becomes stronger over times, collects new items and must battle evil. A unique feature however is the introduction of other heroes that will help you for a while and others that will follow you till the end.>>
Hell_Master has also written short stories based on the project.

Type: SPRPG
178091-albums5176-picture67823.jpg
Symphony [ORPG]: Rise of the Ancients (by Legendary)

<<Symphony is an ORPG supported by the typical save/load system, where your main objective is to defeat the boss Salvatoris. It features jobs for the different classes, guilds, professions (similar to jobs), quest boards and hard world bosses.>>
The project's thread presents the game in a detailed way and also contains beautiful screenshots!

Type: ORPG

(These projects were the top 5 of March 2013, nominated&voted for by the community!)


178091-albums5176-picture67135.png




178091-albums5176-picture67139.png


Questions

Rules


Coding:
  • [Easy] How does one retrieve the gold cost of a unit or item during the game?
  • [Modest] What event will not fire until all previous network operations have finished?
  • [Modest] What JASS natives can be used to support polymorphism?
  • [Hard] What string ID will the string "ololo" have internally knowing that the max string ID
    before iterating forwards over all possible substrings in the string "lolooolololoooolooololool" is 562?
    Given: "lo" has an ID of 232 and "l" has an ID of 563.

The Hive:
  • [Easy] Who received a custom Chat Icon this month?
    • Answered: Misha
  • [Easy] Which icon is used for the Ice Queen's Tiara Award, included in the [Quest]: In search of the coldest breeze event?
  • [Modest] Which Section Submission Rules are yet to be published?
    • Answered: Models
  • [Modest] In which project do you have to defeat 'Salvatoris'?

Blizzard:
  • [Modest] What event does the Banner for "Hive's Arena" represent?
    • Answered: Manifestation of the Zerg Overmind on Aiur

  • The objective is to answer as many questions as possible and get the most answers right to earn reputation points!
  • You are not allowed to edit your post with new answers, just double post if you have to.
  • Everyone except for Magtheridon96 & I3lackDeath & Nestharus is allowed to participate.


178091-albums5176-picture67136.png


warcraft0561.gif
SuPa-
Join Date: 18.03.2007
Posts: 2297 [Ranking: 121st]
Rep: 867 [Ranking: 62nd]
Hobbies: Modeling & Sculpting
Blizzard Games played: Warcraft 3 & Starcraft II & Diablo III
Modeling debut: 2007

8th June 2012Top Rated Model
178091-albums5176-picture59142.jpg
Beholder
Type: Unit
Category: Miscellanous / Other
Downloads: 2063

178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
178091-albums5176-picture55344.gif
(Highly Recommended)
13th April 2008Most Downloaded Model
178091-albums5176-picture67358.jpg
PinkyDemon
Type: Unit
Category: Alien / Futuristic
Downloads: 2411

178091-albums5176-picture55343.gif
178091-albums5176-picture55343.gif
178091-albums5176-picture55343.gif
178091-albums5176-picture55343.gif
178091-albums5176-picture55343.gif
(Not rated)

Awards Showcase:

animation01_2nd.gif
Animation Contest #1 - Runner Up
Entry: Dancing Illidan
skinning04_3rd.gif
Texturing Contest #4 - Third Place
Entry: Ominous Purple-ish Blue Blob
modeling04_2nd.gif
Modeling Contest #4 - Runner Up
Entry: Centaur Robot
modeling08_2nd.gif
Modeling Contest #8 - Runner Up
Entry: Dragon Rider
modeling17_3rd.gif
Modeling Contest #17 - Runner Up
Entry: Corruptor
donor02.gif
PayPal Donor
Entry: Has donated >$20 to The Hive.

(How miserable, after all these years, still no first place!!)
(I was also gonna include links to his entries, but the Hive's search took an arrow to the knee and Ralle lost his pants)



"Currently working on a Magma Elemental redux (now editing the animations)"

Off to Ralle's shenanigans:
178091-albums5176-picture67410.gif
Deolrin

As of 28.03.2013, longtime Hive user Deolrin is a Resource Moderator, primarily focusing on the models section.

[Models :: Message]
178091-albums5176-picture67411.gif
Misha

As of 28.03.2013, the experienced modeler Misha is a Resource Moderator, primarily focusing on the models section.

[Models :: Message]

Hive's Staff


178091-albums5176-picture67137.png


user.png
Site:
  • A new sticky is now available in Arena > Contest Archive: 'Contest Archive - List'
    • Since it is hard to find old contests that have long been archived, all contests will now be accessible through an organized list. Note that the list is currently being worked on.
  • -Grendel, one of the Hive's best modelers and also model moderator, has sadly left us.
    • A spotlight will be made for him in the next news batch!
  • User InfinateAnswers is conducting a survey on the average gamer!
    • Post your age and also at which age you started playing video games!
  • The news batch has received a small visual upgrade, thanks to I3lackDeath! He has created the beautiful and new Index!
  • Ralle will be going on vacation tomorrow, so be sure to wish him a happy birthday on his profile!
 
Last edited:
Im not included in the Top again :(

(I was also gonna include links to his entries, but the Hive's search took an arrow to the knee and Ralle lost his pants)
LMAO

Internet, why u no show me images :/

Questions and Answers:

How does one retrieve the gold cost of a unit or item during the game?

To retrieve units:
By implementing the following natives in the code:
JASS:
native GetUnitGoldCost takes integer unitid returns integer
native GetUnitWoodCost takes integer unitid returns integer
You can also use this:
JASS:
library GetUnitCost /* v1.0.1.0
*************************************************************************************
*
*   */uses/*
*       */ UnitIndexer /*               hiveworkshop.com/forums/jass-functions-413/system-unit-indexer-172090/
*       */ RegisterPlayerUnitEvent /*   hiveworkshop.com/forums/jass-resources-412/snippet-registerplayerunitevent-203338/
*
************************************************************************************
*
*    Functions
*
*       function GetUnitTypeIdGoldCost takes integer unitTypeId returns integer
*       function GetUnitTypeIdWoodCost takes integer unitTypeId returns integer
*
*                   NATIVES WORK WITH NON-HERO UNITS ONLY
*/
        native GetUnitGoldCost takes integer unitid returns integer
        native GetUnitWoodCost takes integer unitid returns integer
/*
*       function GetUnitTotalGoldCost takes unit whichUnit returns integer
*           -   Gets total unit gold cost including prior upgrades
*       function GetUnitTotalWoodCost takes unit whichUnit returns integer
*           -   Gets total unit wood cost including prior upgrades
*
************************************************************************************/
//! textmacro UNIT_COST
    globals
        private Table g = 0                 //unit type id gold cost table
        private Table l = 0                 //unit type id lumber cost table
        private integer array gu            //unit gold cost array (indexed)
        private integer array lu            //unit lumber cost array (indexed)
        private integer array ug            //upgrade gold
        private integer array ul            //upgrade lumber
    endglobals
    //unit cost (sell)
    private function O takes nothing returns boolean
        call RemoveUnit(GetSoldUnit())
        return false
    endfunction
    private function LogUnit takes integer id returns nothing
        //store previous gold, lumber, and food
        local integer k=GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)
        local integer w=GetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER)
        local integer h=GetPlayerState(p,PLAYER_STATE_RESOURCE_FOOD_USED)
        local integer m=GetPlayerState(p,PLAYER_STATE_RESOURCE_FOOD_CAP)
        call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,1000000)
        call SetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER,1000000)
        call SetPlayerState(p,PLAYER_STATE_RESOURCE_FOOD_USED,0)
        call SetPlayerState(p,PLAYER_STATE_RESOURCE_FOOD_CAP,100000)
        //build unit
        set UnitIndexer.enabled=false
        call AddUnitToStock(u,id,1,1)
        call IssueNeutralImmediateOrderById(p,u,id)
        call RemoveUnitFromStock(u,id)
        set UnitIndexer.enabled = true
        //retrieve gold and lumber cost
        set g[id]=1000000-GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)
        set l[id]=1000000-GetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER)
        //set player gold back to what it was
        call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,k)
        call SetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER,w)
        call SetPlayerState(p,PLAYER_STATE_RESOURCE_FOOD_USED,h)
        call SetPlayerState(p,PLAYER_STATE_RESOURCE_FOOD_CAP,m)
    endfunction
    function GetUnitTypeIdGoldCost takes integer id returns integer
        debug if (null!=UnitId2String(id)) then
            if (not g.has(id)) then
                if (IsHeroUnitId(id)) then
                    call LogUnit(id)
                else
                    set g[id]=GetUnitGoldCost(id)
                    set l[id]=GetUnitWoodCost(id)
                endif
            endif
            return g[id]
        debug else
            debug call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,"COSTS ERROR: INVALID UNIT TYPE ID")
        debug endif
        debug return 0
    endfunction
    function GetUnitTypeIdWoodCost takes integer id returns integer
        debug if (null!=UnitId2String(id)) then
            if (not g.has(id)) then
                if (IsHeroUnitId(id)) then
                    call LogUnit(id)
                else
                    set g[id]=GetUnitGoldCost(id)
                    set l[id]=GetUnitWoodCost(id)
                endif
            endif
            return l[id]
        debug else
            debug call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,"COSTS ERROR: INVALID UNIT TYPE ID")
        debug endif
        debug return 0
    endfunction
    function GetUnitTotalGoldCost takes unit t returns integer
        debug if (null!=t) then
            if (0==GetUnitUserData(t)) then
                return GetUnitTypeIdGoldCost(GetUnitTypeId(t))
            endif
            return gu[GetUnitUserData(t)]
        debug else
            debug call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,"COSTS ERROR: INVALID UNIT")
        debug endif
        debug return 0
    endfunction
    function GetUnitTotalWoodCost takes unit t returns integer
        debug if (null!=t) then
            if (0==GetUnitUserData(t)) then
                return GetUnitTypeIdWoodCost(GetUnitTypeId(t))
            endif
            return lu[GetUnitUserData(t)]
        debug else
            debug call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,"COSTS ERROR: INVALID UNIT")
        debug endif
        debug return 0
    endfunction
    //on unit index
    private function I takes nothing returns boolean
        local integer i=GetUnitTypeId(GetIndexedUnit())
        local integer k=GetIndexedUnitId()
        //store gold/lumber cost for unit
        set gu[k]=GetUnitTypeIdGoldCost(i)
        set lu[k]=l[i]
        return false
    endfunction
    //on unit deindex
    private function D takes nothing returns boolean
        local integer k=GetIndexedUnitId()
        //reset gold/lumber cost for unit
        set gu[k]=0
        set lu[k]=0
        return false
    endfunction
    //on unit upgrade start
    private function US takes nothing returns boolean
        local integer k=GetUnitUserData(GetTriggerUnit())
        local integer i=GetUnitTypeId(GetTriggerUnit())
        //if the unit is indexed, store upgrade gold/lumber cost
        if (0!=k) then
            set ug[k]=GetUnitTypeIdGoldCost(i)
            set ul[k]=l[i]
            set gu[k]=ug[k]+gu[k]
            set lu[k]=ul[k]+lu[k]
        endif
        return false
    endfunction
    //on unit upgrade cancel
    private function UC takes nothing returns boolean
        local integer k=GetUnitUserData(GetTriggerUnit())
        //if unit is indexed, add upgrade cost to cost
        if (0!=k) then
            set gu[k]=gu[k]-ug[k]
            set lu[k]=lu[k]-ul[k]
        endif
        return false
    endfunction
//! endtextmacro
//! textmacro UNIT_COST_2
    local trigger t=CreateTrigger()           //sell unit
//! endtextmacro
//! textmacro UNIT_COST_3
    set g=Table.create()                  //gold table
    set l=Table.create()                  //lumber table
    //register unit indexing for setting/resetting gold/lumber costs for units
    call RegisterUnitIndexEvent(Condition(function I),UnitIndexer.INDEX)
    call RegisterUnitIndexEvent(Condition(function D),UnitIndexer.DEINDEX)
    //this is done for removing units that are sold for getting their costs
    call TriggerRegisterUnitEvent(t,u,EVENT_UNIT_SELL)
    call TriggerAddCondition(t,Condition(function O))
    
    //this is done for updating unit gold/lumber costs on upgrade
    call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_UPGRADE_START, function US)
    call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_UPGRADE_CANCEL, function UC)
//! endtextmacro
endlibrary

For items:
JASS:
library GetItemCost /* v1.0.0.1
************************************************************************************
*
*    Functions
*
*       function GetItemTypeIdGoldCost takes integer itemTypeId returns integer
*       function GetItemTypeIdWoodCost takes integer itemTypeId returns integer
*       function GetItemTypeIdCharges takes integer itemTypeId returns integer
*
*       function GetItemGoldCost takes item whichItem returns integer
*           -   Gets total item gold cost including item charges
*       function GetItemWoodCost takes item whichItem returns integer
*           -   Gets total item wood cost including item charges
*
************************************************************************************/
//! textmacro ITEM_COST
    globals
        private Table gi=0                  //item type id gold cost table
        private Table li=0                  //item type id lumber cost table
        private Table ci=0                  //item type id charge table
        private boolexpr b=null             //enum item function
        private real d=0                    //distance
        private item fi=null                //found item
        private integer it=0                //item type filter
        private rect r                      //world rect
        private real pe                     //percent divider
    endglobals
    //item cost (enum)
    //Select Unit method is not used in this case because it only seems to work
    //with players 0-11. Even with the use of 0 through 11, it can be buggy.
    private function E takes nothing returns boolean
        local real x                        //x coord
        local real y                        //y coord
        local item s=GetFilterItem()        //filter item
        //find the closest item of the matching type
        if (it==GetItemTypeId(s)) then
            //retrieve x,y as percents so that the values are smaller
            //magnitudes of coordinates can easily flow well above 2^31-1 limit
            set x=(GetWidgetX(s)-WorldBounds.minX)/pe        //percent
            set y=(GetWidgetY(s)-WorldBounds.minY)/pe        //percent
            set x=SquareRoot(x*x+y*y)         //magnitude
            //The item was sold at max coordinates, meaning 141.421356% (distance from bot left to top right)
            //the entire world must be enumerated over due to pathing (item might not be placed at unit)
            //when the pathing reaches a certain point, the item is placed at the unit
            //this will find the item with the greatest magnitude, thus approaching 141.421356%
            if (x>d) then
                set d=x
                set fi=s
            endif
        endif
        set s=null
        return false
    endfunction
    private function LogItem takes integer id returns nothing
        //get previous gold/lumber
        local integer k = GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)
        local integer w = GetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER)
        local item ts
        call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,1000000)
        call SetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER,1000000)
        //build item
        call AddItemToStock(u,id,1,1)
        call IssueNeutralImmediateOrderById(p,u,id)
        call RemoveItemFromStock(u,id)
        //find and remove item
        set it=id         //item type id to find
        set d=-1          //closest range
        call EnumItemsInRect(r,b,null)
        set ci[id]=GetItemCharges(fi)
        call RemoveItem(fi)
        set fi=null
        //retrieve gold and lumber cost
        set gi[id]=1000000-GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)
        set li[id]=1000000-GetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER)
        //set player gold back to what it was
        call SetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD,k)
        call SetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER,w)
    endfunction
    function GetItemTypeIdGoldCost takes integer id returns integer
        if (not gi.has(id)) then
            call LogItem(id)
        endif
        return gi[id]
    endfunction
    function GetItemTypeIdWoodCost takes integer id returns integer
        if (not gi.has(id)) then
            call LogItem(id)
        endif
        return li[id]
    endfunction
    function GetItemTypeIdCharges takes integer id returns integer
        if (not gi.has(id)) then
            call LogItem(id)
        endif
        return ci[id]
    endfunction
    function GetItemGoldCost takes item i returns integer
        local integer s = GetItemTypeId(i)
        local real s2 = GetItemTypeIdCharges(s)
        if (s2 > 0) then
            return R2I(gi[s]*(GetItemCharges(i)/s2))
        endif
        return gi[s]
    endfunction
    function GetItemWoodCost takes item i returns integer
        local integer s = GetItemTypeId(i)
        local real s2 = GetItemTypeIdCharges(s)
        if (s2 > 0) then
            return R2I(li[s]*(GetItemCharges(i)/s2))
        endif
        return li[s]
    endfunction
//! endtextmacro
//! textmacro ITEM_COST_2
    //item pathing can only go out 1024
    //after 1024, it is just placed at the unit it was sold at
    set r=Rect(WorldBounds.maxX-1088,WorldBounds.maxY-1088,WorldBounds.maxX,WorldBounds.maxY)
    set b=Condition(function E)           //item enum function
    set gi=Table.create()                 //gold item table
    set li=Table.create()                 //lumber item table
    set ci=Table.create()                 //charge item table
    set pe=(WorldBounds.maxX-WorldBounds.minX)*100        //percent divider
//! endtextmacro
endlibrary

What event will not fire until all previous network operations have finished?
constant playerunitevent EVENT_PLAYER_UNIT_SELECTED = ConvertPlayerUnitEvent(24)

[Hard] Given a relative merge value of 64000 and a constant merge value of 0.1,
determine the maximum number of timers that can exist of timeout 9.00. (Timeout is 0.03125)
288 timers
Idk what the real answer is,i just guessed that.
But when i calculated something,the result is 0.347

What JASS natives can be used to support polymorphism?
What is polymorphism? Changing forms?
 
Most of the answers given to the coding questions are incorrect, so I'll just highlight the correct ones.
Almia, I didn't want you to link an entire resource, I wanted an algorithm to be described, because those AI natives that could be added to Warcraft III are not enough because they don't work for a certain case.

Ender said:
What JASS natives can be used to support polymorphism?
anything that evaluates boolexprs, so EvaulateTrigger, EnumPlayerInForceCounted etc...

Correct. There are 7 natives, 2 of which are TriggerRegisterVariableEvent(trigger, string, limitop, real) and CreateTrigger()
Give the other 5 and the answer will be complete.

(+1)

Almia said:
What event will not fire until all previous network operations have finished?
constant playerunitevent EVENT_PLAYER_UNIT_SELECTED = ConvertPlayerUnitEvent(24)

Correct.

(+2)
 
How does one retrieve the gold cost of a unit or item during the game?

Okay how about this.
A hashtable/table that saves the unit-type's gold cost and item cost.

A function that creates a dummy barracks(or a structure that trains units)/shop which the unit-type/item-type will be added to stock.The dummy player(Player(14)) then sells the unit/item.Save the Max Gold - Current Gold for the unit-type/item-type.

About the hard question,all i can think is this formula:
Log(64000/9)/230.258509*9
 
Almia said:
Okay how about this.
A hashtable/table that saves the unit-type's gold cost and item cost.

A function that creates a dummy barracks(or a structure that trains units)/shop which the unit-type/item-type will be added to stock.The dummy player(Player(14)) then sells the unit/item.Save the Max Gold - Current Gold for the unit-type/item-type.

Close enough.

(+1)
 
Status
Not open for further replies.
Top