PDA

View Full Version : CNC3 Mod SDK >> Problem with AutoDepositUpdate



divhashmorex
03-17-2011, 07:51 PM
Hi,
I have started editting a CNC3 yesterday (for fun) and after 1 of changes I cannot play a mod until I reverse that (last) change.

That modification is adding AutoDepositUpdate module from TiberiumSpike to GDISpaceCommandUplink (other changes works correctly)

Listing 1.1 - Part of GDISpaceCommandUplink.xml presenting added code - no other changes in this file


<AutoDepositUpdate
DepositInterval="8s"
DepositAmount="40"
GiveNoXP="true"
Flags="ACTIVE_WHEN_REPAIRING"/>


There are no problems in the compilation step, but when the game (with mod) is started it will crash with info:

Listing 1.2 - Game Crash


---------------------------
Game crash
---------------------------
addModuleInfo - ERROR defining module '' on thing template '0x8136f6f6'. The module '0x0' has tag which must be unique among all modules for this object, but the tag '0x0' is also already on behavior module '%s' within this object.



Please make unique tag names within an object definition.

0xe addresses:

(unknown)(0x0): cnc3game.dat+0x8de3 Debug::PreStaticInit+0x902

(unknown)(0x0): cnc3game.dat+0x27574b Debug::PostStaticInit+0x26bf8d

(unknown)(0x0): cnc3game.dat+0x279d2e Debug::PostStaticInit+0x270570

(unknown)(0x0): cnc3game.dat+0x27a6e0 Debug::PostStaticInit+0x270f22

(unknown)(0x0): cnc3game.dat+0x27ad75 Debug::PostStaticInit+0x2715b7

(unknown)(0x0): cnc3game.dat+0x415600 Debug::PostStaticInit+0x40be42

(unknown)(0x0): cnc3game.dat+0x416628 Debug::PostStaticInit+0x40ce6a

(unknown)(0x0): cnc3game.dat+0x416cb4 Debug::PostStaticInit+0x40d4f6

(unknown)(0x0): cnc3game.dat+0x41704f Debug::PostStaticInit+0x40d891

(unknown)(0x0): cnc3game.dat+0x157bf3 Debug::PostStaticInit+0x14e435

(unknown)(0x0): cnc3game.dat+0x15923c Debug::PostStaticInit+0x14fa7e

(unknown)(0x0): cnc3game.dat+0x152aa1 Debug::PostStaticInit+0x1492e3

(unknown)(0x0): cnc3game.dat+0xa146 Debug::PostStaticInit+0x988

(unknown)(0x0): kernel32.dll+0x16d4f RegisterWaitForInputIdle+0x49


Because of the severity of this error the game will now exit.
---------------------------
OK
---------------------------



I don't know what is the problem, maybe the method is not supported in CNC3 for other structures than tech? Maybe some missing lines?
Command and Conquer 3 Patch 1.09 PL (Polish Version), Mod SDK 5, original BuildMod.bat

Thanks and Sorry for my English :)

Bibber
03-17-2011, 08:11 PM
Give your AutoDepositUpdate an id eg. id="ModuleTag_AutoDepositUpdate"

X3neizes
03-18-2011, 12:16 AM
as Bibber said , you must define a " ID ". The exact code would be this:




<AutoDepositUpdate
id="AutoDepositUpdate"
DepositInterval="8s"
DepositAmount="40"
Flags="ACTIVE_WHEN_REPAIRING"/>



Must be inside "Behaviors" ;)

X3neizes
03-18-2011, 12:24 AM
Other advice . When you "compile" the mod, In the compilation window, appears "the name of the file" that is generating the error, and the line / position you must correct . You use the program "Notepad++" to identify more easily "the line" that is failing :)

divhashmorex
03-19-2011, 01:08 PM
Bibber, thanks :)

X3neizes, thank you too.

I don't know how is it possible, that I didn't understand "Please make unique tag names within an object definition.". This is a very stupid mistake.

I have some experience in modding (Generals), so I don't understand how can I made that mistake...

One thing makes me wonder. When I tried to check is it working correctly, I erased a GameDependency (Prerequisites) and I saw that no money will be deposited if no Refinery is constructed. Is it ok? Or any bug (ex. missing lines?). Can it be changed?

Thanks again

Lauren
03-19-2011, 03:02 PM
If you don't have any Refineries or Silos you can only store the amount that is defined in the player template (MoneyCapSP/MoneyCapMP)

X3neizes
03-19-2011, 04:08 PM
You want to deposit money without the need to construct any building ?. Then copy the code directly inside the " Construction Yard " of each faction . For example for " gdi " , modify the file "GDIConstructionYard.xml".
In this way the money is deposited without the need to build any other building :)

X3neizes
03-19-2011, 04:15 PM
and optional:

add this code to define the " maximum capacity " which may save money "a building ":




<DistributedMoney
id="ModuleTag_DistributedMoney"
Capacity="3000"
OnDieSpawnPercentage="30" />