Mood is a thing for - Page 7

Mood is a thing for

Discuss maps & map creation - from concept to execution to the ever elusive release.

Moderator: Moderators

User avatar
zoggop
Posts: 289
Joined: 07 Sep 2010, 18:47

Re: Mood is a thing for

Post by zoggop »

Updating this thing to work in 98, and thought i'd try to make the worm eating animation actually grab the unit and bring it down. Spring.UnitScript.AttachUnit is working, but the attached unit disappears once it's attached. I can still select the attached unit, and see its selection box (so I can see that it's moving the way it ought to), but there's no unit rendered. Anyone have an idea why this might be?

here's the worm's unit script

Code: Select all

return {
	sworm = {
		blocking = false,
		buildPic = "sworm.png",
		canMove = true,
		description = "Giant hungry beast.",
		footprintX = 6,
		footprintZ = 6,
		holdSteady = true,
		iconType = "sworm",
		isFirePlatform = true,
		isTransport = true,
		levelGround = false,
		loadingRadius = 256,
		maxDamage = 9999,
		name = "Sand Worm",
		objectName = "swormOpenMouth-180_50out-r45.s3o",
		script = [[sWormOpenMouth.lua]],
		stealth = true,
		transmaxunits = [[10]],
		transportCapacity = 1000,
  		transportMass = 500000,
 		transportSize = 100000,
		customParams = {
 			ignoreplacementrestriction = true,
		},
	},
}
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Mood is a thing for

Post by FLOZi »

That's the unitdef, please post script (do you attach to '-1' piece?)
User avatar
zoggop
Posts: 289
Joined: 07 Sep 2010, 18:47

Re: Mood is a thing for

Post by zoggop »

https://github.com/zoggop/cattle-and-lo ... nMouth.lua

did a quick echo, the piece ("foodmagnet") is 10
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Mood is a thing for

Post by Jools »

We have sandworms in Spring? Cool. Very cool!
8611
XTA Developer
Posts: 242
Joined: 29 Dec 2014, 08:22

Re: Mood is a thing for

Post by 8611 »

The Spring.UnitScript.AttachUnit things still works in 98, so seems to be something with that script/model/mod.
There was too much other error spam to test the map.
The sync/unsynced seperation got changed a bit and requires "stricter" use of if gadgetHandler:IsSyncedCode() then ... else...
I assume you know what else to fix etc. ;)


Try to attach the unit but do not move the piece around. Then move piece around but only above ground, then try underground,...
Press alt+v or type /DebugColVol to see units hitbox, maybe more detailed than looking at selectionbox.
With /wiremap you can track what units do under the terrain..

If the attached unit can still be selected that already means it is not attached to piecenumber -1 because "in this state it will never be be selectable"
https://github.com/spring/spring/blob/d ... g.txt#L525

Unrelated, do not pack as solid archives.
User avatar
zoggop
Posts: 289
Joined: 07 Sep 2010, 18:47

Re: Mood is a thing for

Post by zoggop »

thank you so much for taking a look!
8611 wrote:There was too much other error spam to test the map.
The sync/unsynced seperation got changed a bit and requires "stricter" use of if gadgetHandler:IsSyncedCode() then ... else...
ya, loading up the map for the first time in a while and getting all this error spam is what made me realize i need to update it. i've resolved all the sync/unsync problems in the version on github.
Press alt+v or type /DebugColVol
ooo, v. helpful
User avatar
zoggop
Posts: 289
Joined: 07 Sep 2010, 18:47

Re: Mood is a thing for

Post by zoggop »

okay, now all the worm unit script does is:

Code: Select all

function script.Create()
local x,y,z = Spring.GetUnitPosition (unitID)
if (x and y and z) then
	local nearunits=Spring.GetUnitsInSphere  (x,y,z, 32) or "nothing"
	if (nearunits~="nothing") then		
		for _, nearunitid in ipairs (nearunits) do
			if (nearunitid~=unitID) then
				-- SwallowTest(nearunitid)
				AttachUnit(foodmagnet, nearunitid)
				Sleep(3000)
				DropUnit(nearunitid)
				break
			end
		end
	end
end
end
(where AttachUnit = Spring.UnitScript.AttachUnit, and DropUnit = Spring.UnitScript.DropUnit)

result? worm appears. nearby unit disappears for three seconds. nearby unit reappears and drops to the ground.
Attachments
armpw_dropped.png
armpw_dropped.png (133.23 KiB) Viewed 4109 times
armpw_attached.png
armpw_attached.png (131.5 KiB) Viewed 4109 times
User avatar
zoggop
Posts: 289
Joined: 07 Sep 2010, 18:47

Re: Mood is a thing for

Post by zoggop »

okay, the whole problem was

Code: Select all

holdSteady = true,
in the unit def
8611
XTA Developer
Posts: 242
Joined: 29 Dec 2014, 08:22

Re: Mood is a thing for

Post by 8611 »

It it eating an energy storage? (try with a mobile unit?)

holdSteady=true/false should just change how passenger's orientation behaves...
From those pictures I see no reason why passenger should be invisible. Engine bug?
Here holdSteady does things with vectors:
https://github.com/spring/spring/blob/d ... it.cpp#L67
Drawing problems in https://springrts.com/mantis/view.php?id=2376 & https://springrts.com/mantis/view.php?id=2222 were related to vector things too, maybe it is similiar...?
User avatar
zoggop
Posts: 289
Joined: 07 Sep 2010, 18:47

Re: Mood is a thing for

Post by zoggop »

8611 wrote:It it eating an energy storage? (try with a mobile unit?)
ah, no that's a peewee, its colvol is just a cylinder apparently.
8611 wrote:holdSteady=true/false should just change how passenger's orientation behaves...
From those pictures I see no reason why passenger should be invisible
agreed. i would say it's this particular piece's fault, b/c it's tiny & not visible itself, but i tried attaching to other pieces too with same result.
8611 wrote:Engine bug?
I guess the question is, are there any examples of using holdSteady successfully?
User avatar
qray
Posts: 377
Joined: 02 Feb 2009, 18:49

Re: Mood is a thing for

Post by qray »

Thanks for updating, it's great to have the worms back! :-)

Always liked this map (looks great, and the different play due to worms is a cool variety of game play).
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Mood is a thing for

Post by FLOZi »

zoggop wrote: I guess the question is, are there any examples of using holdSteady successfully?
MCL uses holdsteady on the dropships which deploy upgrades, was working last I checked (but that was some time ago)
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Mood is a thing for

Post by Forboding Angel »

Sandworms confirmed.

https://youtu.be/i0YkVp-Kv_k
Post Reply

Return to “Map Creation”