Broken Unit

Broken Unit

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
SanadaUjiosan
Conflict Terra Developer
Posts: 907
Joined: 21 Jan 2010, 06:21

Broken Unit

Post by SanadaUjiosan »

Okay I give up. This unit I'm working on is just refusing to work, and I'm completely perplexed. So can someone take a look at this stuff and see what's wrong?

The problem is that it doesn't shoot, at least not the way I'd like it to. It won't attack ground. But if I bring it into first person mode, I can force for 6 of the 8 guns.

It builds units just fine.

The unit is meant to be a starting off unit, able to build workers like a factory, and also have some defenses. I've looked over the script several times and I can't see any errors. Oh, and infolog:

http://pastebin.com/FVxZ6iYj

It's a big'un.
Attachments
bflagshipbase.lua
Script
(6.19 KiB) Downloaded 19 times
bflagshipbase.lua
Unit Def
(7.04 KiB) Downloaded 13 times
Master-Athmos
Posts: 916
Joined: 27 Jun 2009, 01:32

Re: Broken Unit

Post by Master-Athmos »

Check the piece names in your s3o file, the definition of the pieces at the beginning and later on in your script:

You e.g. define:

Code: Select all

	local rearrturrel = piece "rearrturre"
But later on call:

Code: Select all

        	Turn(rearrturret, y_axis, heading, math.rad(90))
So you one time wrote "turrel" and one time "turret". Double check all of those things and maybe also post the s3o file if it still doesn't work...
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Broken Unit

Post by FLOZi »

An Attack order given to a factory will just set the attack order for the units it produces. It'll still fire on any units that come into range by itself though.
User avatar
SanadaUjiosan
Conflict Terra Developer
Posts: 907
Joined: 21 Jan 2010, 06:21

Re: Broken Unit

Post by SanadaUjiosan »

Nothing like stupid reasons for things breaking. Thanks a lot Athmos for pointing that out. Those are the mistakes I'm prone to make.

Thanks Flozi for explaining that bit, that sure does help.

Now, there's one last thing concerning this unit that I'd like to get some input on. I know the answer will probably require some degree of Script Fu, but what I'm hoping for is an easy fix in a unit def or something.

This unit is, as you may have figured out, supposed to be like a headquarters. But, it's not that cut and dry. Basically, you start the game with a flagship type unit, a mobile flying unit (gunship movement), but this flagship unit can't build anything. It can, however, morph into the unit this thread is about, the headquarters that can build workers and defend against attackers.

I used the morph gadget to achieve this, and of course, it appears pretty janky. The flagship takes off and flies to morph, and then when it's done, the headquarters appears briefly mid-air before it immediately plummets to the ground. Pretty goofy looking.

Basically, is there a way for me to work around this? Ideally, I want it to only morph when the flagship is landed. Makes sense after all.

If this is too hard to achieve, that is fine. To be honest it's mostly a cosmetic thing, and at this point in time, I'm more concerned with functionality, and thankfully the above posts helped me achieve that. Thanks again guys.

Oh, one last question. Is there an AI that knows how to morph? I noticed in my tests with RAI0.601 that it did not morph any of my morph-able buildings, which makes me think it doesn't know how. AI that can morph will really help me in testing my game.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Broken Unit

Post by FLOZi »

You'll have to modify the morph gadget to check for the flying status of the unit.
Master-Athmos
Posts: 916
Joined: 27 Jun 2009, 01:32

Re: Broken Unit

Post by Master-Athmos »

Is there an AI that knows how to morph?
No although afaik NTAI was meant to have somethind considering this at some point but I think it never got integrated and I also don't know if there exists a public release of a version that works with the latest Spring versions...
Post Reply

Return to “Game Development”