How to Morph?

How to Morph?

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

User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

How to Morph?

Post by oksnoop2 »

Can someone please explain what morphing is and how i can achieve it. Thanks in advance.
Lurking
Posts: 11
Joined: 20 Feb 2010, 16:56

Re: How to Morph?

Post 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.
Master-Athmos
Posts: 916
Joined: 27 Jun 2009, 01:32

Re: How to Morph?

Post 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...
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: How to Morph?

Post by Google_Frog »

This looks like a job for...

Gadget Database!
Unfortunately it's hard to use
Attachments
morph_defs.lua
(12.38 KiB) Downloaded 32 times
unit_morph.lua
(40.95 KiB) Downloaded 29 times
User avatar
SanadaUjiosan
Conflict Terra Developer
Posts: 907
Joined: 21 Jan 2010, 06:21

Re: How to Morph?

Post 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?
Master-Athmos
Posts: 916
Joined: 27 Jun 2009, 01:32

Re: How to Morph?

Post 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")
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: How to Morph?

Post by Google_Frog »

Don't forget to write your own morph defs. The file I attached still has all the CA ones.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: How to Morph?

Post 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.
Last edited by PicassoCT on 26 Feb 2010, 21:07, edited 1 time in total.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: How to Morph?

Post by Pxtl »

Once again, PicassoCT minds us that he is not so much a person as he is an acid-trip with a keyboard.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: How to Morph?

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

Re: How to Morph?

Post 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.
User avatar
Tribulex
A.N.T.S. Developer
Posts: 1894
Joined: 26 Sep 2009, 21:26

Re: How to Morph?

Post 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.
User avatar
SanadaUjiosan
Conflict Terra Developer
Posts: 907
Joined: 21 Jan 2010, 06:21

Re: How to Morph?

Post 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?
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: How to Morph?

Post 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
User avatar
SanadaUjiosan
Conflict Terra Developer
Posts: 907
Joined: 21 Jan 2010, 06:21

Re: How to Morph?

Post 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.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Re: How to Morph?

Post by 1v0ry_k1ng »

SeanHeron
Engines Of War Developer
Posts: 614
Joined: 09 Jun 2005, 23:39

Re: How to Morph?

Post 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) ?
User avatar
SanadaUjiosan
Conflict Terra Developer
Posts: 907
Joined: 21 Jan 2010, 06:21

Re: How to Morph?

Post 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.
SeanHeron
Engines Of War Developer
Posts: 614
Joined: 09 Jun 2005, 23:39

Re: How to Morph?

Post 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.
User avatar
SanadaUjiosan
Conflict Terra Developer
Posts: 907
Joined: 21 Jan 2010, 06:21

Re: How to Morph?

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

Return to “Game Development”