• 🏆 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!

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