Reclaim doesnt work.

Reclaim doesnt work.

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
code_man
Posts: 260
Joined: 19 Jan 2014, 13:10

Reclaim doesnt work.

Post by code_man »

My harvesters dont reclaim tiberium and i have no idea why.
The cursor changes to reclaim cursor and harvys get in range of the crystals but nothing then happens.
Pretty sure its not the feature that is a problem.
Need a hint here.

Code: Select all

local unitName = "harvester"

local unitDef = {
    buildPic = "harvester.png",
    category = "TANK SMALL NOTAIR NOTSUB",
    objectName = "vehicles/harvester.dae",
    name = "Tiberium Harvester",
    tEDClass = "TANK",
    unitName = "harvester",
    script = "harvester.lua",
    collisionVolumeType = "box",
    collisionVolumeScales = {25, 25, 50},
    --collisionVolumeOffsets = {32, 32, 16},
    
    buildTime = 140,
    description = "Tiberium collector",
    maxDamage = 1000,
    radarDistance = 0,
    sightDistance = 200,
    soundCategory = "TANK",
    buildCostMetal = 1400,
    
    acceleration = 0.05,
    brakeRate = 0.25,
    footprintX = 3,
    footprintZ = 4,
    maxSlope = 20,
    maxVelocity = 2.5,
    maxReverseVelocity = 0.25,
    maxWaterDepth = 20,
    movementClass = "Default",
    turnRate = 200,
    turnInPlace = false,
    turnInPlaceSpeedLimit = 10,

    canMove = true,
    leaveTracks = 1,

    reclaimable = false,
    capturable = false,

    idleAutoHeal = 1.0, -- First C&C had no harvester self repair but its convenient so we use 

    explodeAs = "harvester_explosion",

    sounds = {
        select = {
            "tone16.wav",
        },
        ok = {
            "newtarg1.wav",
        },
        arrived = {
            "tone2.wav",
        },
    },
}

if false then
    unitDef.canAttack = 1
    unitDef.canGuard = 1
    unitDef.canFight = 1
    unitDef.canPatrol = 1

    unitDef.kamikaze = true
    unitDef.kamikazeDistance = 100.0
    unitDef.selfDestructCountdown = 3
    unitDef.fireState = 1
else
    unitDef.builder = true
    unitDef.buildDistance = 64.0
    unitDef.workerTime = 1.0
    unitDef.canRestore = false
    unitDef.canReclaim = true
    unitDef.canBeAssisted = false
    unitDef.canAssist = false
    unitDef.canRepair = false
end

local weaponDefs = {
    harvester_explosion = {
	weapontype = "Cannon",
	areaofeffect = 250,
	avoidfeature = false,
	avoidfriendly = true,
	canattackground = true,
	collidefriendly = true,
	collisionsize = 8,
	commandfire = false,
	craterboost = 0,
	cratermult = 0,
	edgeeffectiveness = 0.1,
	explosionspeed = 128,
	impulseboost = 0,
	impulsefactor = 0,
	intensity = 1,
	noselfdamage = false,
	range = 25,
        soundstart = "tnkfire3",
        soundhit = "xplos",
	reloadtime = 10,
	rgbcolor = "1.0 1.0 1.0",
	turret = false,
	texture1 = "flame",
	weaponvelocity = 800,
	explosiongenerator = "custom:TANKGUN_FX",
	damage = {
            infantry = 500,
	    default = 500,
            heavy_armor = 250,
	},
    },
}

unitDef.weaponDefs = weaponDefs
return lowerkeys({ [unitName]  =  unitDef })
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Reclaim doesnt work.

Post by Anarchid »

Builder (reclaimer, assister, repairer...) units need certain animation callins implemented in order for the relevant functionality to work.

Reference: http://springrts.com/wiki/Animation-Lua ... _factories

Can i see your animation script?
Last edited by Anarchid on 25 Mar 2014, 13:15, edited 1 time in total.
User avatar
code_man
Posts: 260
Joined: 19 Jan 2014, 13:10

Re: Reclaim doesnt work.

Post by code_man »

I suspected something like that but i couldnt find anything in the anim callin page that seemed right.

Code: Select all

-- harvester.lua

-- Harvester animations

include("wheeled_vehicle.lua")

function script.Activate()

end 

function script.Deactivate() 

end
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Reclaim doesnt work.

Post by Anarchid »

I think you need StartBuilding too, and a few others.

I've added the link to my post above, but i was too slow with the edit :P

You can find them here: http://springrts.com/wiki/Animation-Lua ... _factories
User avatar
code_man
Posts: 260
Joined: 19 Jan 2014, 13:10

Re: Reclaim doesnt work.

Post by code_man »

I think i already tried with building callins, but il try again.

EDIT2:
It does work now i think but it takes EXTREMELY long time.
Il have to do some examination.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Reclaim doesnt work.

Post by Anarchid »

unitDef.workerTime = 1.0
Increasing this value will likely result in quicker reclaim.
User avatar
code_man
Posts: 260
Joined: 19 Jan 2014, 13:10

Re: Reclaim doesnt work.

Post by code_man »

I added reclaimTime to the featuredef its working fine now, thanks.
Tough reclaimTime default comes down to 600, is this supposed to be 10 minutes?
Seems like a shitty default value tbh, 10 minutes for a 100 resources is kinda loooong.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Reclaim doesnt work.

Post by FLOZi »

http://springrts.com/wiki/Gamedev:Featu ... _Resources

float reclaimTime Default: (metal + energy) * 6.0

The actual time taken is a function of the builders reclaimSpeed, of course.
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: Reclaim doesnt work.

Post by Pressure Line »

That and no-one uses '1' as the workertime anyway. Much better to use ~100, then balance the reclaimtime of your features if required.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Reclaim doesnt work.

Post by Forboding Angel »

Pressure Line wrote:That and no-one uses '1' as the workertime anyway. Much better to use ~100, then balance the reclaimtime of your features if required.
O_O, You be talkin' crazy.

Silly.
Post Reply

Return to “Game Development”