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

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
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

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

Post by Argh »

How to prevent C from going for A when A is loaded into B?
That's actually going to be pretty hard. Probably the best bet is to use Lua and swap A for D, an identical-looking Unit which can't be shot by C, at the time that Loading occurs.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

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

Post by CarRepairer »

Argh wrote:
How to prevent C from going for A when A is loaded into B?
That's actually going to be pretty hard. Probably the best bet is to use Lua and swap A for D, an identical-looking Unit which can't be shot by C, at the time that Loading occurs.
Ouch, that's not good. I hope a better solution comes about in the future. Do units chase after units in transports that aren't firingplatform?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

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

Post by Argh »

They get treated like any other Unit, if they're active that way, so that they get engaged correctly, IIRC.

Swapping Units isn't too bad; you can get the target ID in TransportPickup(unitID) in BOS, call Lua, then do the swap, then immediately issue another Load command to the Transport. Just make the D version unable to move, and if the Transport doesn't arrive for whatever reason, swap it back with A after a few seconds. That can potentially be irritating to players, ofc, but IDK how to avoid that otherwise, since Transport behavior is so... eh... hardcoded and unflexible atm.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

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

Post by CarRepairer »

Argh wrote:They get treated like any other Unit, if they're active that way, so that they get engaged correctly, IIRC.

Swapping Units isn't too bad; you can get the target ID in TransportPickup(unitID) in BOS, call Lua, then do the swap, then immediately issue another Load command to the Transport. Just make the D version unable to move, and if the Transport doesn't arrive for whatever reason, swap it back with A after a few seconds. That can potentially be irritating to players, ofc, but IDK how to avoid that otherwise, since Transport behavior is so... eh... hardcoded and unflexible atm.
It wouldn't work well for what I'm doing. I might have to find an alternate solution. I might try making certain units not chase anyone at all, by putting the full set in their nochasecategory, and complementing it with badtargetcategories of units that are likely to be transported.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

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

Post by Argh »

Hmm. Why is it imperative that they not attempt to attack the transport?

I mean... you're talking about mounting guys in a transport, who can apparently shoot at enemies. Either it's a ground transport, and anything should be fair game... or it's an air transport, and you merely have to make it fly high enough to be out've range / targeting cone of most things, so they won't try to attack it anyhow. If you explain what game effect you're after, maybe there's an alternative way to solve your puzzle.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

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

Post by CarRepairer »

I'm new to working on this stuff so it may be a quirk of some of the weapons. I'm trying out different melee units by experimenting with both the invisible shortrange missile and the actual spring melee weapon type.

The transports are ground transports for the most part, functioning like bunkers in starcraft, but this would apply to a flying transport (which I plan to make, with firingplatform) even more so. I just found that the shortrange units would sometimes not even attack the transport itself and get confused trying to reach the unit inside - very strange. It may be a combination of factors including my anim scripting and weapon setup but that still doesn't make sense to me. I'd rather the attacker not even try to target the transport or the loaded unit at all as it would be 100% futile in some cases (melee vs. air units).
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

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

Post by Argh »

I'm new to working on this stuff so it may be a quirk of some of the weapons. I'm trying out different melee units by experimenting with both the invisible shortrange missile and the actual spring melee weapon type.
Don't use either. Use a short-term beamweapon that's invisible (texture reference a non-existent texture).

The melee weapon isn't useful atm. It really needs to be fixed to obey AimWeapon callin behaviors, etc.
The transports are ground transports for the most part, functioning like bunkers in starcraft, but this would apply to a flying transport (which I plan to make, with firingplatform) even more so. I just found that the shortrange units would sometimes not even attack the transport itself and get confused trying to reach the unit inside - very strange. It may be a combination of factors including my anim scripting and weapon setup but that still doesn't make sense to me. I'd rather the attacker not even try to target the transport or the loaded unit at all as it would be 100% futile in some cases (melee vs. air units).
OK. Ground transports: you're probably stuck, unless you want to go the Lua route.

Air transports: just make 'em go higher than the ranges used by melee- in a typical fantasy game, that won't be very high up at all. Combine that with weapon arcs, and I can guarantee that nobody will be trying to chase flying transports. A ceiling of 200 or whatever is nothing, don't stress about it. You only need absurd ceilings like I use or Forb does if you have objects tall enough that clipping is a problem on a regular basis.
User avatar
wilbefast
Posts: 255
Joined: 14 Oct 2009, 18:04

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

Post by wilbefast »

Argh: I'm using "LaserCannon" for melee - reckon it's about the simplest weapon type around since "Melee" itself apparently doesn't work that well.
Do you think BeamWeapon would be more appropriate?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

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

Post by Argh »

Use BeamLaser. No flight time, no inaccuracy if you don't want it, obeys turret, won't miss because of hitsphere collisions, etc., etc.

Melee should basically just be BeamLaser without the visuals (imo).

Attached is my Space Chicken basic "claw" weapon, for reference purposes.
Attachments
Claws.zip
(700 Bytes) Downloaded 27 times
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

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

Post by CarRepairer »

Thanks for the claws. I am working on converting my weapons to use those defs (but greatly enhanced because it's in lua).
User avatar
PTSnoop
Posts: 97
Joined: 09 Sep 2009, 19:05

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

Post by PTSnoop »

Here's a problem I've been having for a while. At the moment, I've got weapondefs as lua in the "weapons" folder, in the form

Code: Select all

local weaponDef = 
{
    weaponname = 
    {
        ... long list of stats...
    }
}
return weaponDef
The problem with this is calling the weapons in the (lua) unitdef. When I want to write

Code: Select all

weapons = {
    [1] = {
        def = "spikelaser",
        badTargetCategory = "BUILDING",
    },
    [2] = {
        def = "spikelaser",
        badTargetCategory = "BUILDING",
    },
    [3] = {
        def = "spherespawn",
        onlyTargetCategory = "NOTAIR",
        mainDir = "0 0 1",
        maxAngleDif = 360,
    },
},
then the unit ends up with no weapons; instead I have to write

Code: Select all

weapons =
{
    "spikelaser",
    "spikelaser",
    "spherespawn",
},
which loses all the onlyTargetCategory and other information. How do I get this other information into the unitdef? (I've tried things like onlytargetcategory3 = "NOTAIR", but it doesn't seem to be working.)
User avatar
PTSnoop
Posts: 97
Joined: 09 Sep 2009, 19:05

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

Post by PTSnoop »

Hopeful bump.

Also: is there a way to give units hitboxes instead of hitspheres in Upspring? I know The Cursed has mobile units with hitcylinders; how do I give my units something similar?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

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

Post by Argh »

is there a way to give units hitboxes instead of hitspheres in Upspring?
No, you have to use code, either in unitDef or by using Lua or by using COB (it's flexible, and yeah, you can change it).

It's documented in the Wiki, but here's a quick example of doing a box collision volume:

Code: Select all

	CollisionVolumeType=Box;
	CollisionVolumeScales=160 44 160;
	CollisionVolumeOffsets=0 22 0;
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 »

Argh wrote: It's documented in the Wiki,
Where exactly?
thedude
Posts: 66
Joined: 21 Aug 2009, 12:47

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

Post by thedude »

Is it possible to make a vehicle factory with a repair station?
I mean when a damaged vehicle is send to the vehicle factory he moves to the repair station of this building and will be repaired there.
(Does one of the mods have this?)
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 »

i dont think it can be done, but construction vehicles and other mobile builders can generally repair other units
User avatar
Alchemist
Posts: 81
Joined: 21 Oct 2005, 23:46

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

Post by Alchemist »

you could probably model in an extra nano turret or something on the side of the factory and have it disabled by default with its script and usa lua to detect if there are any nearby units that are in need of repair and take control of said turrent via lua to act as the repair station.
User avatar
PTSnoop
Posts: 97
Joined: 09 Sep 2009, 19:05

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

Post by PTSnoop »

IIRC the CA airplane plant does something like what you're asking. I'm not sure if it's aircraft-only but it's probably worth a look.

---

At the moment, my WIP game can be easily won by the first person to fly one plane over the enemy base and fire missiles at all the buildings to completely halt unit production. Is there some way of setting up hitspheres or hitboxes so that the under-construction units can't be attacked, or would I need some sort of Lua for this?
thedude
Posts: 66
Joined: 21 Aug 2009, 12:47

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

Post by thedude »

the CA airplane plant does something like what you're asking
I dont't get how this works. If I build an airplane plant and then a Hawk and after that damage him and give him an order to move to the airplane plant he just starts to guard that building (I think) :?
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 »

snoop: you want units being built to take no damage until complete?

dude: most mods have a separate unit for aircraft repairing ie repaid pad. are you sure the mod you are playing has a repair pad with the factory?
Locked

Return to “Game Development Tutorials & Resources”