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

Struct with arrays hmmf?

Status
Not open for further replies.
Level 15
Joined
Nov 30, 2007
Messages
1,202
Could someone please tell me what I'm doing wrong here? Thanks in advance. :>

JASS:
library CityLibrary initializer Init

    globals
        private constant integer n_building_types = 10
        private City array city
    endglobals

    struct City
        string name
        integer array building_type_count[n_building_types]
        integer construction_count
        group g
        unit u    
    endstruct

    private function Init takes nothing returns nothing
        city[0] = City.create()
        city[0].name = "Stockholm"
        call BJDebugMsg("I live in " + city[0].name + "!")    
    endfunction

endlibrary
 
Status
Not open for further replies.
Top