Skip to content
This repository has been archived by the owner on Jul 25, 2021. It is now read-only.

spawnObject() types vs. spawnObjectJSON() names #30

Open
Benjamin-Dobell opened this issue Apr 30, 2020 · 1 comment
Open

spawnObject() types vs. spawnObjectJSON() names #30

Benjamin-Dobell opened this issue Apr 30, 2020 · 1 comment

Comments

@Benjamin-Dobell
Copy link
Member

Benjamin-Dobell commented Apr 30, 2020

In addition to resource names, spawnObject() accepts user friendly names as well:

  • Arms Dice
  • Backgammon Board
  • Barrel
  • Bear
  • Bishop Cast Iron
  • Bishop Chrome
  • Bishop Dark Wood
  • Bishop Light Wood
  • Black Ball
  • Black Checker
  • Black Pawn
  • Blue 10
  • Blue Ball
  • Blue Pawn
  • Blue Rectangle
  • Brown Backgammon
  • CardBot
  • CardBots Head Deck
  • CardBots Main Deck
  • Chair
  • Checkers Board
  • Chess Board
  • Chest
  • Chimera
  • Chinese Checkers Board
  • Coin 2 (Currently unspawnable, internal error on spawn attempt)
  • Coin 3 (Currently unspawnable, internal error on spawn attempt)
  • Coin 4 (Currently unspawnable, internal error on spawn attempt)
  • Coin 5 (Currently unspawnable, internal error on spawn attempt)
  • Coin Ace (Currently unspawnable, internal error on spawn attempt)
  • Coin Blank (Currently unspawnable, internal error on spawn attempt)
  • Corner
  • Crowns Dice
  • Custom Board
  • Custom Deck
  • Custom Figurine
  • Custom Model
  • Cyclops
  • D4 Chrome
  • D4
  • D6 Black
  • D6 Blue
  • D6 Chrome
  • D6 Green
  • D6 Red
  • D6
  • D8 Chrome
  • D8
  • D10 Chrome
  • D10
  • D12 Chrome
  • D12
  • D20 Chrome
  • D20
  • Digital Clock
  • Dragonide
  • Evil Watcher
  • Floor
  • Ghoul
  • Giant Rat
  • Giant Viper
  • Go Board
  • GO Bowl Black
  • GO Bowl White
  • GO Piece Black
  • GO Piece White
  • Goblin
  • Gold 1000
  • Golem
  • Green 50
  • Green Ball
  • Green Pawn
  • Green Triangle
  • Griffon
  • Hydra
  • Joker
  • Kimi Kat
  • King Cast Iron
  • King Chrome
  • King Dark Wood
  • King Light Wood
  • Knight Cast Iron
  • Knight Chrome
  • Knight Dark Wood
  • Knight Light Wood
  • Knight of Knil
  • Kobold
  • Lizard Warrior
  • Loot Bag
  • Manticora
  • Mara
  • Metal Ball
  • Moons Dice
  • Mummy
  • Ogre
  • Orange Pawn
  • Orc
  • Pachisi Board
  • Pawn Cast Iron
  • Pawn Chrome
  • Pawn Dark Wood
  • Pawn Light Wood
  • Pink Ball
  • Pink Pawn
  • Purple Pawn
  • Quarter
  • Queen Cast Iron
  • Queen Chrome
  • Queen Dark Wood
  • Queen Light Wood
  • Random Card
  • Random Domino
  • Random Mahjong
  • Red 100
  • Red Ball
  • Red Checker
  • Red Pawn
  • Red Square
  • Reversi Board
  • Reversi Chip
  • Rock
  • Rook Cast Iron
  • Rook Chrome
  • Rook Dark Wood
  • Rook Light Wood
  • Silver 500
  • Sir Loin
  • Skeleton Knight
  • Square 2 (Currently unspawnable, internal error on spawn attempt)
  • Square 3 (Currently unspawnable, internal error on spawn attempt)
  • Square 4 (Currently unspawnable, internal error on spawn attempt)
  • Square 5 (Currently unspawnable, internal error on spawn attempt)
  • Square Ace (Currently unspawnable, internal error on spawn attempt)
  • Square Blank (Currently unspawnable, internal error on spawn attempt)
  • Standard Deck
  • Suns Dice
  • Table
  • Tablet
  • Tree Ent
  • Tree
  • Troll
  • Vampire
  • Wall
  • Werewolf
  • White Backgammon
  • White Ball
  • White Checker
  • White Pawn
  • Wolf
  • Wyvern
  • Yellow Ball
  • Yellow Pawn
  • Zeke Kodoku
  • Zomblor

Where as spawnObjectJSON() takes a name within the JSON i.e. object.name. The following list was obtained by spawning the above objects, however this list is non-exhaustive:

  • backgammon_board
  • backgammon_piece_brown
  • backgammon_piece_white
  • Bag
  • BlockRectangle
  • BlockSquare
  • BlockTriangle
  • Card
  • Checker_black
  • Checker_Board
  • Checker_red
  • Checker_white
  • Chess_Bishop
  • Chess_Board
  • Chess_King
  • Chess_Knight
  • Chess_Pawn
  • Chess_Queen
  • Chess_Rook
  • Chinese_Checkers_Board
  • Chinese_Checkers_Piece
  • Chip_10
  • Chip_50
  • Chip_100
  • Chip_500
  • Chip_1000
  • Custom_Board
  • Custom_Model
  • Deck
  • Deck_CardBot_Head
  • Deck_CardBot_Main
  • DeckCustom
  • Die_4
  • Die_6
  • Die_6_Rounded
  • Die_8
  • Die_10
  • Die_12
  • Die_20
  • Die_Piecepack
  • Digital_Clock
  • Domino
  • Figurine_Card_Bot
  • Figurine_Custom
  • Figurine_Kimi_Kat
  • Figurine_Knil
  • Figurine_Mara
  • Figurine_Sir_Loin
  • Figurine_Zeke
  • Figurine_Zomblor
  • Go_Board
  • go_game_bowl_black
  • go_game_bowl_white
  • go_game_piece_black
  • go_game_piece_white
  • Mahjong_Tile
  • Metal Ball
  • Pachisi_board
  • PlayerPawn
  • Quarter
  • reversi_board
  • reversi_chip
  • rpg_BEAR
  • rpg_CHIMERA
  • rpg_CYCLOP
  • rpg_DRAGONIDE
  • rpg_EVIL_WATCHER
  • rpg_GHOUL
  • rpg_GIANT_VIPER
  • rpg_GOBLIN
  • rpg_GOLEM
  • rpg_GRIFFON
  • rpg_HYDRA
  • rpg_KOBOLD
  • rpg_LIZARD_WARRIOR
  • rpg_MANTICORA
  • rpg_MUMMY
  • rpg_OGRE
  • rpg_ORC
  • rpg_RAT
  • rpg_SKELETON_KNIGHT
  • rpg_TREE_ENT
  • rpg_TROLL
  • rpg_VAMPIRE
  • rpg_WEREWOLF
  • rpg_WOLF
  • rpg_WYVERN
  • Tablet
  • Tileset_Barrel
  • Tileset_Chair
  • Tileset_Chest
  • Tileset_Corner
  • Tileset_Floor
  • Tileset_Rock
  • Tileset_Table
  • Tileset_Tree
  • Tileset_Wall

Currently the Spawn Objects documentation has the latter only. This may be confusing for users who wish to consume the simpler (albeit more constrained) spawnObject() API.

You may have noticed two things about the above lists:

  1. Despite one list being generated from the other, there are more spawnObject() "user friendly names" than there are spawnObjectJSON() names. This is because some "user friendly names" map to the same resource, but have had additional configuration changes made such that they look different.
  2. The list above is missing plenty of spawnable resource names that are already documented e.g. rpg_DARKNESS_WARLORD. That's because these objects simply don't have a "user friendly name". You must use their "resource name" instead.

The mappings between between "resource names" and "user friendly names" (as per point 1 above) are available here.

Ideally we should add something to API docs to explain all this.

@Benjamin-Dobell
Copy link
Member Author

Benjamin-Dobell commented Apr 30, 2020

Just looking into this some more, and amended the above with some corrections.

Perhaps Berserk's intention is that the "user friendly names" for spawnObject() are supposed to be deprecated?

However, objects like "Pink Pawn" can't be spawned with a resource name alone, because the corresponding resource ("PlayerPawn") must have its colour set to pink (by default it's white). That means without documenting the above friendly names it's impossible to spawn a pink pawn using spawnObject(). Instead you must use spawnObjectJSON()and specify the ColorDiffuse and MaterialIndex = 7.

Basically, we should probably either document the friendly names (as they can be useful, as above), or we should mark spawnObject() as deprecated, because users may rightfully be confused about how to spawn a Pink Pawn etc.

Essentially, without this friendly name list, spawnObject() is fairly useless.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant