Page 1 of 2

How to Morph?

Posted: 26 Feb 2010, 09:32
by oksnoop2
Can someone please explain what morphing is and how i can achieve it. Thanks in advance.

Re: How to Morph?

Posted: 26 Feb 2010, 09:43
by Lurking
Relax your mind. Be at peace with nature and matter. Reach down into your soul and lose consciousness of the world around you. Picture an animal, object or entity for which you desire to morph into. Dig into its very being and understand its ways. When you come back to living you shall be enlightened and as a whole, morphed being.

Re: How to Morph?

Posted: 26 Feb 2010, 10:43
by Master-Athmos
Morphing is a feature implemented via Lua. In Luarules/Gadgest you have the unit_morph.lua giving all the logics needed while in Luarules/Configs there is a morph_defs.lua which defines what should morph into what for whatever conditions...

Re: How to Morph?

Posted: 26 Feb 2010, 10:48
by Google_Frog
This looks like a job for...

Gadget Database!
Unfortunately it's hard to use

Re: How to Morph?

Posted: 26 Feb 2010, 11:08
by SanadaUjiosan
This is what I got when I simply plugged those files into the proper areas, then changed the first entry in the morph_defs to accommodate my unit names:

Code: Select all

[      0] Failed to load: unit_morph.lua  (Include() could not load 'LuaRules/colors.h.lua')
I scanned the rest of the info-log and saw nothing else that I think is related.

Is this colors.h.lua also needed?

Re: How to Morph?

Posted: 26 Feb 2010, 11:35
by Master-Athmos
Yes - I just looked it up. You'll find this in the morph gadget:

Code: Select all

include("LuaRules/colors.h.lua")

Re: How to Morph?

Posted: 26 Feb 2010, 14:17
by Google_Frog
Don't forget to write your own morph defs. The file I attached still has all the CA ones.

Re: How to Morph?

Posted: 26 Feb 2010, 21:04
by PicassoCT
A Morphing is about making a 3-Dimensional Object with lots of seemingly wasted Polygons and then saving it, creating a copy and remodell that copy into something diffrent. After that you add a Morpher on the original and select the changed object (no additional polygons added to that) and now you can slide between those two states.

It is heavily used in games for facial animation and - some quite disgusting things, for example organic, pulsating movements and idling (Ids-beating Heart in Quake3 is such a Morphing Animation).

A friend i know once did a Alien, that spit some sort of egg out of its mouth, that would rapidly growing suck through a umbilical the juices out of its spawningmotheralien, growing into a excact copy, that would repeat the same cycle. He called it a walking-animation by birth/death alone. Such things aint good for the mind.

Re: How to Morph?

Posted: 26 Feb 2010, 21:06
by Pxtl
Once again, PicassoCT minds us that he is not so much a person as he is an acid-trip with a keyboard.

Re: How to Morph?

Posted: 26 Feb 2010, 21:08
by PicassoCT
You should try it, you would see Spring with diffrent eyes, and maybee realize i m the only normal mapper here ;)

All those other guys, man they do freeaaaky things, nearly real world like. FORB is constantly tripping and nobody complains ;)

Re: How to Morph?

Posted: 26 Feb 2010, 21:37
by Forboding Angel
Pxtl wrote:Once again, PicassoCT minds us that he is not so much a person as he is an acid-trip with a keyboard.
THank god I'm not the only one that noticed.

Re: How to Morph?

Posted: 27 Feb 2010, 04:03
by Tribulex
Master-Athmos wrote:Yes - I just looked it up. You'll find this in the morph gadget:

Code: Select all

include("LuaRules/colors.h.lua")
just a header file with color values. If you write a gadget dont use it. its just a device to anger noobs.

Re: How to Morph?

Posted: 28 Feb 2010, 04:33
by SanadaUjiosan
Taking the colors.h.lua line out of the unit_morph seemed to break a lot more, as it started wondering where other files were.

I then found colors.h.lua and plugged it in. I got a morph button for my unit, but clicking it just turned it off (it is onoffable.) Can units that morph not be onoffable?

Re: How to Morph?

Posted: 28 Feb 2010, 12:31
by PicassoCT
Forboding Angel wrote:
Pxtl wrote:Once again, PicassoCT minds us that he is not so much a person as he is an acid-trip with a keyboard.
THank god I'm not the only one that noticed.

Sorry man, no jokes about things that got potential. Spring could use some gadget for organic units and Transformers.

http://www.megaupload.com/?d=Q0S40Z8F

Re: How to Morph?

Posted: 20 Mar 2010, 20:55
by SanadaUjiosan
Going to bump this. Morph still doesn't work for me, not that I've really done anything to try and fix it. Is the gadget universal, in that it's not trying to use things from, say, CA or something? Or maybe the morph defs is just really messed up.

Re: How to Morph?

Posted: 20 Mar 2010, 23:05
by 1v0ry_k1ng

Re: How to Morph?

Posted: 20 Mar 2010, 23:41
by SeanHeron
I gave the gadget on offer a spin with Masse's game - Damned - and it ran ok for me (with colors.h and config as you'd already noticed - but no further additions required).
Afraid I can't comment on on/offable units, I have no idea there. Did you give it a try with other units (ie non on/offables) ?

Re: How to Morph?

Posted: 21 Mar 2010, 02:01
by SanadaUjiosan
Man do I feel silly. Morph was indeed working, I just did not notice it.

Ok, so it seems this morph gadget gives no visual indication that it is indeed morphing. Am I insane in remembering other games having like a ghosted image or wireframe of the unit it is morphing into? How would I get this indication, because I think that would be dandy.

And, how much of this stuff at the end of this morph defs from CA do I need? I'd like things to be trim.

Code: Select all

local modOptions
if (Spring.GetModOptions) then
  modOptions = Spring.GetModOptions()
end

if (modOptions and modOptions.commtype == 'default') then

  morphDefs.armcom = {
    into = 'armcomdgun',
	metal = 800,
	energy = 800,
    time = 40,
	
    rank = 0,
  }
  
  morphDefs.corcom = {
    into = 'corcomdgun',
    time = 40,
	metal = 800,
	energy = 800,
    rank = 0,
  }

end
if (modOptions and modOptions.commtype == 'advcomm') then
    morphDefs.corcom = {
   { into = 'corcomdgun2',
    time = 30,
    rank = 0,
  },
  {
    into = 'corcombuild2',
    time = 30,
    rank = 0,
  },
  {
    into = 'corcombattle2',
    time = 30,
    rank = 0,
  },
  }
      morphDefs.armcom = {
   { into = 'armcomdgun2',
    time = 30,
    rank = 0,
  },
  {
    into = 'armcombuild2',
    time = 30,
    rank = 0,
  },
  {
    into = 'armcombattle2',
    time = 30,
    rank = 0,
  },
}

end



--
-- Here's an example of why active configuration
-- scripts are better then static TDF files...
--

--
-- devolution, babe  (useful for testing)
--
if (devolution) then
  local devoDefs = {}
  for src,data in pairs(morphDefs) do
    devoDefs[data.into] = { into = src, time = 10, metal = 1, energy = 1 }
  end
  for src,data in pairs(devoDefs) do
    morphDefs[src] = data
  end
end


return morphDefs
By the way, on/off ables can indeed morph. I was being silly.

Re: How to Morph?

Posted: 21 Mar 2010, 20:43
by SeanHeron
Easy enough to miss things, especially if you've been frustrated because of errors / had to fudge your way through.

This is the file I was using - I'm pretty sure you could drop the devolution section (ie the whole if clause at the bottom, and then of course also the variable declaration " local devolution = false")

Code: Select all

-- $Id: morph_defs.lua 4643 2009-05-22 05:52:27Z carrepairer $
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

local devolution = false


local morphDefs = {

  orc_warrior1 = {
    {
      into = 'orc_warrior2',
      time = 20,
    },
  },
}

 
--
-- Here's an example of why active configuration
-- scripts are better then static TDF files...
--

--
-- devolution, babe  (useful for testing)
--
if (devolution) then
  local devoDefs = {}
  for src,data in pairs(morphDefs) do
    devoDefs[data.into] = { into = src, time = 10, metal = 1, energy = 1 }
  end
  for src,data in pairs(devoDefs) do
    morphDefs[src] = data
  end
end


return morphDefs

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
For the record, I'll make sure the morph gadget gets on the GadgetDatabase, to increase it's usefullness a good bit :-) (though Google was referring to adding stuff to the DB, I think, not to browsing and downloading.


Ok, I might as well:
[code]--------------------------------------------------------------------------------

local morphDefs = {

orc_warrior1 = {
{
into = 'orc_warrior2',
time = 20,
},
},
}


return morphDefs

--------------------------------------------------------------------------------[/code] That would be what's actually necessary (ie with stuff I was referring to above removed), I think.

Re: How to Morph?

Posted: 22 Mar 2010, 02:50
by SanadaUjiosan
Thanks a whole lot for the trimmed down morph defs, it's working :-)

Just to stress the matter: How do I get a visual indication of the morph, like a ghosted image? I just observed it in CA so I know it's there.