Mod Question Repository... Questions come in, answers go out - Page 35

Mod Question Repository... Questions come in, answers go out

Resources to get you going on your new project, or to help you over some emergent problems during your development cycle.

Moderator: Moderators

Locked
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Mod Question Repository... Questions come in, answers go out

Post by Evil4Zerggin »

A lot of the COB .h's floating around out there have it.
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: Mod Question Repository... Questions come in, answers go out

Post by REVENGE »

I posted the following in the lua forum, but I want to know if there's a better, non lua way of going about this. Basically, I want a unit to be able to move around, but I want to prevent players from issuing the "Move" order. canmove=0 won't do, because this disables movement entirely. Here's my post:
Ok, say I use RemoveUnitCmd to prevent a player from issuing CMD.MOVE to a certain unit.

But if I select this unit, along with another unit who's CMD.MOVE is not disabled, then every MOVE command I issue to the other unit is carried over to my move disabled unit, essentially allowing it to move again.

Is there anyway to prevent this from happening?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Mod Question Repository... Questions come in, answers go out

Post by KDR_11k »

Code: Select all

function gadget:AllowCommand(u, ud, team, cmd, param, opt, synced)
   if ud == whateverunitdefitis then
      return synced
   end
   return true
end
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: Mod Question Repository... Questions come in, answers go out

Post by REVENGE »

What param would I feed it to disable the cmdid I send it?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Mod Question Repository... Questions come in, answers go out

Post by KDR_11k »

Um, what? You just make the if condition say what you want it to say...
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: Mod Question Repository... Questions come in, answers go out

Post by REVENGE »

Ah...I see...
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Re: Mod Question Repository... Questions come in, answers go out

Post by Das Bruce »

Making an aircraft able to transport seems to make it fly like traditional OTA transports, ie like a bloated cow. Is there any way around this?
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: Mod Question Repository... Questions come in, answers go out

Post by REVENGE »

Are transports limited to Gunship flight mechanics? Or could you have them fly like vtols.
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Mod Question Repository... Questions come in, answers go out

Post by Evil4Zerggin »

Unfortunately:

Code: Select all

if ((type == "Builder") || ud->hoverAttack || ud->transportCapacity) {
			CTAAirMoveType* mt = SAFE_NEW CTAAirMoveType(unit);
So it's hardcoded to behave like a gunship.
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Re: Mod Question Repository... Questions come in, answers go out

Post by Das Bruce »

/edit/ slow reply /edit/

That sucks, any chance of a patch? Will it work if you just removed that clause?
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: Mod Question Repository... Questions come in, answers go out

Post by REVENGE »

What's the code that dictates how the loading is done? I'm assuming it's going to be special, hardcoded stuff for air transports, which might not work with vtol type aircraft movement.
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Re: Mod Question Repository... Questions come in, answers go out

Post by Das Bruce »

It's quite likely, but I can still hope. :roll:
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Mod Question Repository... Questions come in, answers go out

Post by bobthedinosaur »

trying to make a builder that can construct 100s of units (land units) very fast, factories just jam up because vehicles can move out of the way as they are near insta build speed, so i tried it out as a flier with manual building type construction style (for mobile units) but it will build about 2 at a time an then get distracted and starts slowly drifting away. any suggestions on how to get this to work?
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: Mod Question Repository... Questions come in, answers go out

Post by Warlord Zsinj »

That's not half the problem. It wouldn't be so bad if gunships behaved with any semblance of intelligence...
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: Mod Question Repository... Questions come in, answers go out

Post by REVENGE »

Does it need to fly? Otherwise, I'd suggest something like a nanotower with a *very* fast turn-rate and as much build power as you would need to crank stuff out at speed.

You could do altshift build and make a field of units quickly if it pleases you so. With the unit-mover gadget from CA, you could have it build a line of units with Repeat On, and the units will automatically move out of the way after being built.
Sheekel
Posts: 1391
Joined: 19 Apr 2005, 19:23

Re: Mod Question Repository... Questions come in, answers go out

Post by Sheekel »

Units in OTA does not fire automatically on radar targets unless you have built the radar targeting building. Is there a setting for weapons or units in spring to enable this feature?
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: Mod Question Repository... Questions come in, answers go out

Post by Warlord Zsinj »

No; pretty much every 'pure TA' mod since the beginning has wanted this.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Mod Question Repository... Questions come in, answers go out

Post by Argh »

That would be fairly easy Gadget code, but it'd require COB integration, I think, because there is no call-in for a unit's aiming state(iirc)- it would have to call Lua and then cancel a command to aim if the target's state ~= visible and there weren't any Targeting Centers built, basically.

TBH, I always hated that part of OTA, because it ate so much micro-time, but it'd be quite easily done via COB-->Lua, imo.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Mod Question Repository... Questions come in, answers go out

Post by bobthedinosaur »

so im trying to make a unit behave like a bunker. it is a mobile unit that can not move or rotate and has fireplatform true, (this works fine) it also has a large hit sphere than units that can be loaded into it, however it seems the units that are loaded are take more damage and are hit by enemy fire more often. so i tried throwing a shield weapon on it and the same thing happens. fire goes thru it and kills the unit inside, not offering any bonus for the units inside by having the bunker take the brunt of damage.

any suggestions?
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: Mod Question Repository... Questions come in, answers go out

Post by Hoi »

A bunker is an (inmobile) transport with the fireplatform=1 (something like that) tag
Locked

Return to “Game Development Tutorials & Resources”