Scripting Problem - With DyDo

For AI and campaign script related discussions and questions
Post Reply
Mats
Trained
Trained
Posts: 137
Joined: 31 Jan 2010, 16:22
Location: Various

Scripting Problem - With DyDo

Post by Mats » 05 Mar 2010, 18:49

I wanted to change how DyDo treats research. I saw that DylanDog had put in some code to force research of some topics (for example, force research of whirlwind AA site if attacked with VTOLs). I was trying to put in some code to force research of cobra vehicle body early in the game. I put in:

bool bResearchCobra;

bool bResearchCobra = true;

if(bResearchCobra = true)
{
(copied DylanDog's code exactly, put changing AAsite to the appropriate tank body (I think it was R-Body-05) and changed so that when it was executed bResearchCobra was made false (so we don't execute this again).
}

I have looked and compared with DylanDog's code and it seems like it should work and read through the scripting tuts. Any idea what is the problem here? I can't quote exact code because it's on the laptop at home and I'm in the library in the city centre...

Btw, my goal is to force each personality to use the research path better and for DyDo to select either rockets tech path OR cannons tech path and focus strongly on one instead of wasting valuable research on both at the same time, as well as some small improvements, like not wasting time researching light cannon bunkers etc...
Full of ideas - Most are probably useless. Feel free to ignore them :)

User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany
Contact:

Re: Scripting Problem - With DyDo

Post by DylanDog » 20 Mar 2010, 23:55

I would suggest you to modify instead the vlo files, the "core" of the reasearch is there not in the slo files. In the slo files I have forced some research only if certain events happens. I suggest you leave the slo files as they are.

Look at the player0.vlo for example. The research path for the general1 is stored in the array research[][], the one for general2 is stored in the array general2[][], then general3[][] and finally general4[][].

I think it is quite easy to understand but let me know if you need some more help.
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).

User avatar
Black NEXUS
Trained
Trained
Posts: 100
Joined: 12 Sep 2009, 14:11
Location: Germany

Re: Scripting Problem - With DyDo

Post by Black NEXUS » 13 May 2010, 00:59

How can i include new Trucks and Repair Untis? I have a Truck und Repair-Unit with VTOL propulsion, wich the AI should build.

Include new Templates for Tanks is a bit more difficult than a Template for Cyborg, because a Cyborg has only one Body and one build-loop.
Join NeoX-Virt - The Software-Forge on neox-virt.de

User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany
Contact:

Re: Scripting Problem - With DyDo

Post by DylanDog » 14 May 2010, 13:36

see this simple guide I made to explain how to change the templates in DyDo AI.
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).

User avatar
Black NEXUS
Trained
Trained
Posts: 100
Joined: 12 Sep 2009, 14:11
Location: Germany

Re: Scripting Problem - With DyDo

Post by Black NEXUS » 14 May 2010, 13:42

I know, but this is only for Tanks, Cyborgs has a litte bit other function^^

Important for me is the include of the new Truck and Repair-Unit.
Join NeoX-Virt - The Software-Forge on neox-virt.de

User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany
Contact:

Re: Scripting Problem - With DyDo

Post by DylanDog » 14 May 2010, 14:35

This requires a bit of modding knowledge.

You have to add first the template you want to build in the relevant txt files (templates.txt, assignweapons.txt and names.txt if I remember well) and create a mod with that.

Then follow the guide I made to replace an existing template with yours, look at the bottom of the guide where it starts with "Now let`s have a look at the templates which are built..."

Then launch warzone with both mods (the one you have made and the dydo modified one)

The real problem in adding completely new templates (not included in warzone standard ones) is that DyDo has to research the technologies to allow the building of that template. There is no point in adding a new template if DyDo does not research such technologies...I think that it should not be a problem for the repair VTOL you want to add but I cannot ensure 100%
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).

User avatar
Black NEXUS
Trained
Trained
Posts: 100
Joined: 12 Sep 2009, 14:11
Location: Germany

Re: Scripting Problem - With DyDo

Post by Black NEXUS » 14 May 2010, 22:36

Ok, i have for testing all included, but only Player 0. The Game starts normaly, but after 3 seconds, it will crash without Error. In the log file are following:

Code: Select all

script  |10:29:38: [scrDebugFile] 0min; Schwarz #3 [1-2] ;1 ;do_Research; pursue [0][1] steps left (22) nProdSelect(0) power(3007) _VTOLprob(20%)
error   |10:29:38: [scrNumTemplatesInProduction] scrNumTemplatesInProduction: Invalid template pointer
error   |10:29:38: [scrNumTemplatesInProduction] Assert in Warzone: ../../../src/scriptfuncs.c:6844 (psTemplate != ((void *)0)), last script event: 'SelectTankTemplate'
All intagers are right, in the vlo and slo. I don't know whats wrong...
Join NeoX-Virt - The Software-Forge on neox-virt.de

User avatar
Buginator
Professional
Professional
Posts: 3285
Joined: 04 Nov 2007, 02:20

Re: Scripting Problem - With DyDo

Post by Buginator » 15 May 2010, 04:33

Looks like the issue is with the template.
"Invalid template pointer"...
and it ends here.

User avatar
Black NEXUS
Trained
Trained
Posts: 100
Joined: 12 Sep 2009, 14:11
Location: Germany

Re: Scripting Problem - With DyDo

Post by Black NEXUS » 15 May 2010, 09:54

But wich Template... All Templates are testet for a human Player! I have edit the User (human -> AI) and it doesn't work. If you ask, in the assignweapons.txt too.

The only thing I can think of, is the new truck.
Join NeoX-Virt - The Software-Forge on neox-virt.de

User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany
Contact:

Re: Scripting Problem - With DyDo

Post by DylanDog » 15 May 2010, 13:42

Buginator is right. The problem is in the template you have added. The fact you can build that template as human player does not mean AI can build that too. Have you updated the relevant txt files (templates.txt, assignweapons.txt and names.txt if I remember well) with that template? you can also send me your mod and I will have a look at it...at some point next week.
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).

User avatar
Black NEXUS
Trained
Trained
Posts: 100
Joined: 12 Sep 2009, 14:11
Location: Germany

Re: Scripting Problem - With DyDo

Post by Black NEXUS » 15 May 2010, 15:04

The only one, wich use human and ai is the VTOL-Truck, but the original Truck is it too and this Truck makes no problemes... I must test it, but if it is the Prob, i have to create a duplicate of the unit only for the ai.

//EDIT
I don't know whats the comment "//further checks to ensure not only the last available template is built" means. Is there a error? I load all importens files as attatchment.
Attachments
zdm_filelog_01.rar
Important Files of the ZdM-Mod for check.
(75.67 KiB) Downloaded 126 times
Join NeoX-Virt - The Software-Forge on neox-virt.de

Post Reply