Jump to content

Creating a LogicCommand to build a unit

Recommended Posts

Hi, I am trying to do a simple KW mod that will add units to different factions. However I can't seem to make a functioning LogicCommand to build anything.

I made a file called LCS.xml that modifies the Factory and the Hand of Nod.

<?xml version="1.0" encoding="utf-8"?>
<AssetDeclaration xmlns="uri:ea.com:eala:asset">
		<Cmd>Command_ConstructGDIMCV</Cmd> <!-- added this line -->
		<Cmd>Command_ConstructNODTibTrooperSquad</Cmd> <!-- added this line -->

Then I made LC.xml and tried to define a Logic Command: (I eventually want to make my own NODTibTrooperSquad so the object is just a placeholder for now)

<?xml version="1.0" encoding="utf-8"?>
<AssetDeclaration xmlns="uri:ea.com:eala:asset">


It compiled in WrathEd without any errors. When I got into the game, my Factory was able to produce a GDI MCV but the Tiberium Trooper didn't show up in the Hand of Nod at all, so my LogicCommandSet works but there seems to be something wrong with my LogicCommand.

(I looked at my mod's .big in WrathEd and Command_ConstructNODTibTrooperSquad existed but had 0 AssetReferences, while all the game's built-in Command_Construct* commands have a reference to the thing they're supposed to build. So I feel like that might be what I'm doing wrong but I am not sure how to fix it...)

If it's needed, my Static.xml looks like this:

<?xml version="1.0" encoding="utf-8"?>
<AssetDeclaration xmlns="uri:ea.com:eala:asset">
	<!-- Main Mod File for Static Data -->
		<Include type="reference" source="DATA:static.xml" />
		<Include type="reference" source="DATA:global.xml" />
		<Include type="reference" source="AdditionalMaps\MapMetaData_Global.xml" />
		<Include type="all" source="LC.xml" />
		<Include type="all" source="LCS.xml" />

Anyone know what could be wrong?

Edited by Dog

Share this post

Link to post

Looked into it; have no idea why but for some reason but the object id in the Logic Command does not match the Game Object ID. When I copied MarkedOfKaneTibTrooperSquad from this post to the GameObject xml file and used the find function on Notepad++ (Ctrl+F), the logic command version did not highlight.

Then when I copied the object from your logic command, by pasting as plain text in here the result was; Mar kedOfKaneTibT rooperSqua d. So there is something extra present, albeit no idea what it is.

Recommend retyping, see if it works

Share this post

Link to post

Thanks for investigating! Unfortunately that issue just seems to be a result of copy-pasting to/from here rather than something wrong with my code. I did the same find function thing as you, only I copied from my original code rather than the post, and it matched. Just to make sure, I looked at all of my source files in a hex editor to verify there were no invisible characters or Unicode weirdness and all of them were fine.

Share this post

Link to post

The problem was just that I was using an ancient version of WrathEd. With the update everything worked great.

It's just a simple thing but it's always nice when stuff works! :thumbsup:


Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.