Page 1 of 1

land ships

Posted: 18 Mar 2016, 10:44
by eronoobos
Are there any circumstances under which units with a movement class with speedmodclass = 3 (ship) can move on land, or under it, or float above it? This is for the sand worm map. I can't think of any other way to use the native pathfinder to avoid rocks. The rocks are a different terraintype, and there's no water on the map, so ship movement multiplier can be set to 0.0. I made a unit

Code: Select all

	underworm = {
		movementClass = "UNDERSAND",
		maxVelocity = 1.0,
		acceleration = 1.0,
		turnRate = 100,
		turnInPlace = false,
		waterline = -150,
		crushResistance = 99999,
		blocking = false,
		buildPic = "sworm.png",
		canMove = true,
		description = "I'd like to be under the sand, in a sand worm's garden.",
		footprintX = 1,
		footprintZ = 1,
		iconType = "sworm",
		levelGround = false,
		maxDamage = 9999,
		name = "Sand Worm",
		objectName = "swormOpenMouth-180_50out-r45.s3o",
		script = [[nullscript.lua]],
		-- stealth = true,
		-- canCloak =  true,
		-- initCloaked = true,
		customParams = {
 			ignoreplacementrestriction = true,
		},
	},
and movement class

Code: Select all

	UNDERSAND = {
		speedmodclass = 3,
		crushstrength = 0,
		footprintx = 1,
		footprintz = 1,
		maxslope = 90,
		maxwaterslope = 90,
		minwaterdepth = -9999,
		avoidmobilesonpath = false,
	},
it can't move, which, yes, is probably how it should be.

Re: land ships

Posted: 18 Mar 2016, 11:41
by Kloot
Are there any circumstances under which units with a movement class with speedmodclass = 3 (ship) can move on land, or under it, or float above it?
under it: enable and use MoveCtrl for the unit (https://springrts.com/wiki/Lua_MoveCtrl)
on land: change the unit's MoveDef to one with speedmodclass 0 or 1 (https://springrts.com/wiki/Lua_MoveCtrl ... ontrolling)
float above it: change the unit's MoveDef to one with speedmodclass 2 (same way as above)

Re: land ships

Posted: 18 Mar 2016, 12:04
by 8611z
This is for the sand worm map. I can't think of any other way to use the native pathfinder to avoid rocks.
Terrain can have different speedmodifiers for four types: tank, kbot, hover, ship
You could pick one move-type and decide that this type is only used for worms.
The "ship" type can not move on land. (If you use Spring.MoveCtrl.SetMoveDef then it stops being a "ship"?)
And if is this meant to work with existing mods, then all move-types are used in basically every mod by various non-worm units.

Re: land ships

Posted: 18 Mar 2016, 17:45
by eronoobos
8611z wrote:Terrain can have different speedmodifiers for four types: tank, kbot, hover, ship.
You could pick one move-type and decide that this type is only used for worms.
The "ship" type can not move on land. (If you use Spring.MoveCtrl.SetMoveDef then it stops being a "ship"?)
And if is this meant to work with existing mods, then all move-types are used in basically every mod by various non-worm units.
this is a clearer description of my problem than I gave. The only reason I wanted to use ship was because on a map without water, it wouldn't cause a whole class of a mod's units to stop working. I'm using the past tense because you've convinced me this is not possible. Oh well, the non-unit worm's current ability to navigate rocks isn't so bad. I could implement A* in Lua I suppose.

edit:
under it: enable and use MoveCtrl for the unit (https://springrts.com/wiki/Lua_MoveCtrl)
would allow it to move, but the whole point was to get the pathfinder to navigate around non-sand terrain types for me.

Re: land ships

Posted: 18 Mar 2016, 22:32
by Forboding Angel
Image

Amidoinitrite?

Re: land ships

Posted: 24 Mar 2016, 08:32
by smoth
the way we used to fake that was detecting if it was on water or not and used a hover fwiw.

Re: land ships

Posted: 24 Mar 2016, 11:05
by Forboding Angel
Just use a hover movetype and script to discover when it hits land and turn upright = false and have it sprout some treads or something.