land ships

land ships

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
eronoobos
Posts: 73
Joined: 27 Mar 2015, 20:25

land ships

Post 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.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: land ships

Post 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)
8611z
Posts: 169
Joined: 08 Jul 2015, 20:20

Re: land ships

Post 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.
User avatar
eronoobos
Posts: 73
Joined: 27 Mar 2015, 20:25

Re: land ships

Post 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.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: land ships

Post by Forboding Angel »

Image

Amidoinitrite?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: land ships

Post by smoth »

the way we used to fake that was detecting if it was on water or not and used a hover fwiw.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: land ships

Post 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.
Post Reply

Return to “Game Development”