Page 1 of 1

Modifying Templates

PostPosted: 25 Feb 2016, 20:46
by Alarak
Hello folks,

About a week ago I ran into a snag with templates. at the time it infuriated me as I hadn't touched anything like it yet. but since then I've been trying several attempts on making minor changes to templates in the hopes of letting the AI build tanks according to my design (new templates).

1 week inwards, I've managed to get the game crashed about 2 to 5 minutes in, instead of even before actual play.
I set up about 10 templates in the Nexus AI , see code below
Code: Select all
   /////////////////////////////////////////////////////////////////////
   // SKIRMISH TEMPLATES

   // COMBAT TEMPLATES

   //branchDefault
   numTemplates[0]   int         48

   tmpl[0][0]   TEMPLATE   "Mach1Viper1Wheels"
   tmpl[0][1]   TEMPLATE   "Mach1Viper1Tracks"
   tmpl[0][2]   TEMPLATE   "Mach1Viper2Wheels"
   tmpl[0][3]   TEMPLATE   "Mach1Viper2Wheels"
   tmpl[0][4]   TEMPLATE   "Mach2Viper1Wheels"
   tmpl[0][5]   TEMPLATE   "Mach2Viper1Tracks"
   tmpl[0][6]   TEMPLATE   "Mach2Viper2Tracks"
   tmpl[0][7]   TEMPLATE   "FlamerViper1Wheels"
   tmpl[0][8]   TEMPLATE   "FlamerViper2Wheels"
   tmpl[0][9]   TEMPLATE   "FlamerViper2Tracks"
   tmpl[0][10]   TEMPLATE   "ViperLtCannonHTracks"
   tmpl[0][11]   TEMPLATE   "CobraLtA-Thalftrack"
   tmpl[0][12]   TEMPLATE   "CobraMRLHalftrack"
   tmpl[0][13]   TEMPLATE   "CobraInfernoHTracks"
   tmpl[0][14]   TEMPLATE   "SK-Cobra-Hover-Lancer"
   tmpl[0][15]   TEMPLATE   "Sk-CobraBBHover"
   tmpl[0][16]   TEMPLATE   "CobraMedCnTrks"   
   tmpl[0][17]   TEMPLATE   "SK-Cobra-Track-HVC"
   tmpl[0][18]   TEMPLATE   "CobraHvyCnTrks"


All the entries with "Viper2" are units that use a new light body, and is researchable right after the viper body (so from the start)
The game however crashes on me, presumably as soon as the AI wants to build tanks (I think).
and this is the error message I receive:

Code: Select all
--- Starting log [C:\Users\Paul\Documents\Warzone 2100 3.1\logs\WZlog-0225_191926.txt]---
info    |07:19:26: [realmain:1143] Using C:\Users\Paul\Documents\Warzone 2100 3.1\logs\WZlog-0225_191926.txt debug file
fatal   |07:20:14: [scrSkCanBuildTemplate:1484] scrSkCanBuildTemplate: Unhandled template type


I looked very meticulously and carefully to the names I entered in the stats editor, and the names match. Can someone please help me? what is going wrong?
The error message isn't really helpfull

Re: Modifying Templates

PostPosted: 01 Mar 2016, 21:37
by Alarak
Running into more and more problems as soon as I even touch a template, new or existing.
What am I missing to do?
What does it mean with this error? is the template itself wrong? is the factory inadequate (needing modules or something?)
Can someone please help?

Code: Select all
--- Starting log [C:\Users\Paul\Documents\Warzone 2100 3.1\logs\WZlog-0301_202530.txt]---
info    |08:25:30: [realmain:1143] Using C:\Users\Paul\Documents\Warzone 2100 3.1\logs\WZlog-0301_202530.txt debug file
info    |08:26:36: [structSetManufacture:994] Wrong template for player 3 factory, type 1.
info    |08:26:36: [structSetManufacture:994] Assert in Warzone: structure.cpp:994 (!psTempl || (validTemplateForFactory(psTempl, psStruct) && researchedTemplate(psTempl, psStruct->player, true)) || psStruct->player == scavengerPlayer() || !bMultiPlayer), last script event: 'N/A'
info    |08:26:36: [structSetManufacture:994] Wrong template for player 2 factory, type 1.
info    |08:26:36: [structSetManufacture:994] Assert in Warzone: structure.cpp:994 (!psTempl || (validTemplateForFactory(psTempl, psStruct) && researchedTemplate(psTempl, psStruct->player, true)) || psStruct->player == scavengerPlayer() || !bMultiPlayer), last script event: 'N/A'
info    |08:26:36: [structSetManufacture:994] Wrong template for player 1 factory, type 1.
info    |08:26:36: [structSetManufacture:994] Assert in Warzone: structure.cpp:994 (!psTempl || (validTemplateForFactory(psTempl, psStruct) && researchedTemplate(psTempl, psStruct->player, true)) || psStruct->player == scavengerPlayer() || !bMultiPlayer), last script event: 'N/A'
info    |08:26:36: [structSetManufacture:994] Wrong template for player 6 factory, type 1.
info    |08:26:36: [structSetManufacture:994] Assert in Warzone: structure.cpp:994 (!psTempl || (validTemplateForFactory(psTempl, psStruct) && researchedTemplate(psTempl, psStruct->player, true)) || psStruct->player == scavengerPlayer() || !bMultiPlayer), last script event: 'N/A'
info    |08:26:36: [structSetManufacture:994] Wrong template for player 4 factory, type 1.
info    |08:26:36: [structSetManufacture:994] Assert in Warzone: structure.cpp:994 (!psTempl || (validTemplateForFactory(psTempl, psStruct) && researchedTemplate(psTempl, psStruct->player, true)) || psStruct->player == scavengerPlayer() || !bMultiPlayer), last script event: 'N/A'
info    |08:26:39: [structSetManufacture:994] Wrong template for player 7 factory, type 1.
info    |08:26:39: [structSetManufacture:994] Assert in Warzone: structure.cpp:994 (!psTempl || (validTemplateForFactory(psTempl, psStruct) && researchedTemplate(psTempl, psStruct->player, true)) || psStruct->player == scavengerPlayer() || !bMultiPlayer), last script event: 'N/A'
info    |08:26:39: [structSetManufacture:994] Wrong template for player 5 factory, type 1.
info    |08:26:39: [structSetManufacture:994] Assert in Warzone: structure.cpp:994 (!psTempl || (validTemplateForFactory(psTempl, psStruct) && researchedTemplate(psTempl, psStruct->player, true)) || psStruct->player == scavengerPlayer() || !bMultiPlayer), last script event: 'N/A'
info    |08:27:36: [structSetManufacture:994] Wrong template for player 3 factory, type 1.
info    |08:27:36: [structSetManufacture:994] Assert in Warzone: structure.cpp:994 (!psTempl || (validTemplateForFactory(psTempl, psStruct) && researchedTemplate(psTempl, psStruct->player, true)) || psStruct->player == scavengerPlayer() || !bMultiPlayer), last script event: 'N/A'
info    |08:27:36: [structSetManufacture:994] Wrong template for player 2 factory, type 1.
info    |08:27:36: [structSetManufacture:994] Assert in Warzone: structure.cpp:994 (!psTempl || (validTemplateForFactory(psTempl, psStruct) && researchedTemplate(psTempl, psStruct->player, true)) || psStruct->player == scavengerPlayer() || !bMultiPlayer), last script event: 'N/A'
info    |08:27:36: [structSetManufacture:994] Wrong template for player 1 factory, type 1.
info    |08:27:36: [structSetManufacture:994] Assert in Warzone: structure.cpp:994 (!psTempl || (validTemplateForFactory(psTempl, psStruct) && researchedTemplate(psTempl, psStruct->player, true)) || psStruct->player == scavengerPlayer() || !bMultiPlayer), last script event: 'N/A'
info    |08:27:36: [structSetManufacture:994] Wrong template for player 6 factory, type 1.
info    |08:27:36: [structSetManufacture:994] Assert in Warzone: structure.cpp:994 (!psTempl || (validTemplateForFactory(psTempl, psStruct) && researchedTemplate(psTempl, psStruct->player, true)) || psStruct->player == scavengerPlayer() || !bMultiPlayer), last script event: 'N/A'
info    |08:27:36: [structSetManufacture:994] Wrong template for player 4 factory, type 1.
info    |08:27:36: [structSetManufacture:994] Assert in Warzone: structure.cpp:994 (!psTempl || (validTemplateForFactory(psTempl, psStruct) && researchedTemplate(psTempl, psStruct->player, true)) || psStruct->player == scavengerPlayer() || !bMultiPlayer), last script event: 'N/A'
info    |08:27:39: [structSetManufacture:994] Wrong template for player 7 factory, type 1.
info    |08:27:39: [structSetManufacture:994] Assert in Warzone: structure.cpp:994 (!psTempl || (validTemplateForFactory(psTempl, psStruct) && researchedTemplate(psTempl, psStruct->player, true)) || psStruct->player == scavengerPlayer() || !bMultiPlayer), last script event: 'N/A'
info    |08:27:39: [structSetManufacture:994] Wrong template for player 5 factory, type 1.
info    |08:27:39: [structSetManufacture:994] Assert in Warzone: structure.cpp:994 (!psTempl || (validTemplateForFactory(psTempl, psStruct) && researchedTemplate(psTempl, psStruct->player, true)) || psStruct->player == scavengerPlayer() || !bMultiPlayer), last script event: 'N/A'
info    |08:28:36: [structSetManufacture:994] Wrong template for player 3 factory, type 1.
info    |08:28:36: [structSetManufacture:994] Assert in Warzone: structure.cpp:994 (!psTempl || (validTemplateForFactory(psTempl, psStruct) && researchedTemplate(psTempl, psStruct->player, true)) || psStruct->player == scavengerPlayer() || !bMultiPlayer), last script event: 'N/A'
info    |08:28:36: [structSetManufacture:994] Wrong template for player 2 factory, type 1.
info    |08:28:36: [structSetManufacture:994] Assert in Warzone: structure.cpp:994 (!psTempl || (validTemplateForFactory(psTempl, psStruct) && researchedTemplate(psTempl, psStruct->player, true)) || psStruct->player == scavengerPlayer() || !bMultiPlayer), last script event: 'N/A'
info    |08:28:36: [structSetManufacture:994] Wrong template for player 1 factory, type 1.
info    |08:28:36: [structSetManufacture:994] Assert in Warzone: structure.cpp:994 (!psTempl || (validTemplateForFactory(psTempl, psStruct) && researchedTemplate(psTempl, psStruct->player, true)) || psStruct->player == scavengerPlayer() || !bMultiPlayer), last script event: 'N/A'
fatal   |08:28:38: [scrSkCanBuildTemplate:1484] scrSkCanBuildTemplate: Unhandled template type

Re: Modifying Templates

PostPosted: 14 Mar 2016, 03:16
by vexed
I highly suggest you do NOT use the old, deprecated API, and instead, use the JS version.
Less error prone.

And in looking at the errors above, seems something wasn't researched correctly before it was made.

Re: Modifying Templates

PostPosted: 05 Apr 2017, 23:52
by MIH-XTC
You're getting that error because you have to add these templates to the stats/templates.json file first and then add the object name to nexus.vlo. If you created a new body "viper2" you need to add it to body.json. I attached a copy of templates.json and nexus.vlo that already have all of the good templates in the tech tree from start to finish. A few of the templates in nexus.vlo contain weapons that I created (maybe like 3-4) so you will need to remove them or else you'll get an error. Other than that you should just be able to copy and paste the template arrays.