Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

How to create character NPC with one file Sticky

A topic by BaDanNi created Jun 11, 2019 Views: 278
Viewing posts 1 to 1
Developer (1 edit)

version: 0.0.4a

Command in Ren'Py: call NPC_loader("world_def/npc.json")

How Works: NPC_loader read the name of the character and create it.

            <NPC A name> =NPC(<NPC A name>.Copitalize(), parameters NPC, parameters renpy.Character)


The structure of the NPC generation file (json) is as follows:

{

"NPC":[{NPC A},{NPC B},{NPC C}],
 "name":"NPC_world",
 "version":"0.0.4a"

}


You can add more elements, which can be parameters of the Character class of Ren'Py. NPC A has the structure as shown below:

 {
  "name":"soldiera",
  "HP":200,
  "MP":30,
  "base_HP":200,
  "base_MP":30,
  "base_attack":5,
  "base_defense":9,
  "base_magic":0,
  "base_resist":0,
  "base_agility":4,
  "base_luck":0,
  "hit_rate":80,
  "critical":14,
  "Phys_eva":4,
  "Magi_eva":10,
  "crit_eva":0,
  "color":"#6d4c33",
  "what_color":"#ffffff"
 }