MegaGlest Forum

Archives (read only) => Glest Advanced Engine => General discussion => Topic started by: ElimiNator on 8 May 2011, 05:20:15

Title: Queston about water units.
Post by: ElimiNator on 8 May 2011, 05:20:15
Can I have a different animation for walking on land and swimming in water for my amphibious unit?
Title: Re: Queston about water units.
Post by: Zoythrus on 8 May 2011, 05:39:46
as far as i know.....no.....
Title: Re: Queston about water units.
Post by: Psychedelic_hands on 8 May 2011, 10:30:02
I asked this exact question to Silnarm the other week, and the answer is no.... But he said it was a good idea, so maybe there's a slight chance of it one day being implemented..... Maybe?  ::) ::)
Title: Re: Queston about water units.
Post by: ElimiNator on 10 May 2011, 15:28:53
To bad, I wouldn't want my dino to swim inland or walk on the water...
Title: Re: Queston about water units.
Post by: will on 10 May 2011, 15:32:00
Two units might move between them land-based and sea-based?

I think Mr War tried submarines that way - don't know the outcome
Title: Re: Queston about water units.
Post by: John.d.h on 10 May 2011, 17:57:31
I think your best bet is to find an animation that looks alright for both.  It would be nice to have different move skills for different fields, though.  Then you could have different speeds and everything too.
Title: Re: Queston about water units.
Post by: silnarm on 11 May 2011, 22:21:42
I did sneak a little something into git.. but now John has me thinking...
Title: Re: Queston about water units.
Post by: ElimiNator on 17 May 2011, 15:51:40
I think your best bet is to find an animation that looks alright for both.  It would be nice to have different move skills for different fields, though.  Then you could have different speeds and everything too.
Yah, he could waddle slowly on land and swim swiftly in water.
Title: Re: Queston about water units.
Post by: titi on 17 May 2011, 20:50:34
Water is special .... there are two completly different ways of moving on/in the water:

1. walk on the ground
2. dive/float/swim

dive float swim can be done with different animations/height, but move on ground is a different in general.
I think a full solution might be a special move skill for water movement.

A more simple approach is to just give a a unit a diving_depth property which is used while the unit "walks" in water.
Title: Re: Queston about water units.
Post by: will on 17 May 2011, 20:55:47
Water is special .... there are two completly different ways of moving on/in the water:

1. walk on the ground
2. dive/float/swim

dive float swim can be done with different animations/height, but move on ground is a different in general.
I think a full solution might be a special move skill for water movement.

A more simple approach is to just give a a unit a diving_depth property which is used while the unit "walks" in water.

How does the XML look? Are there any examples of units that use these attributes?

(couldn't find anything on the wiki or google; perhaps I looked in the wrong place?)
Title: Re: Queston about water units.
Post by: hailstone on 17 May 2011, 22:26:24
Red Alert 3 has lots of units that can go on land and water. Not sure if it helps but here is a xml file for a unit which shows it has transition animations to/from water:
http://forums.commandandconquer.com/jforum/posts/list/21422.page
Title: Re: Queston about water units.
Post by: silnarm on 28 May 2011, 13:39:05
This is how it can be done now,

Code: [Select]
<animation>
<!-- by surface type, if you use this specifiy all that may make sense for this unit,
  -- ie, for amphibious units all three,
  -- for land units 'land' & 'fordable'
  -- for any-water units 'fordable' and 'deep-water'
  -- For units of field 'air' or 'deep-water' this makes no sense.
-->
<surface type="land" path="models/walking.g3d" />
<surface type="fordable" path="models/wading.g3d" />
<surface type="deep-water" path="models/swimming.g3d" />

<!-- all optional, played when changing from one surface type to another -->
<surface-change from="land" to"deep-water" path="models/dive.g3d" />
<surface-change from="fordable" to"deep-water" path="models/dive.g3d" />

</animation>

All skill stats are the same, including animation speed :(  But it is functional, if it gets implemented properly later (at least allowing different anim-speed, if not using seperate skills) and anyone uses this method, it can be 'translated' to the new system in the engine with ease.

Title: Re: Queston about water units.
Post by: Omega on 28 May 2011, 18:57:00
Woo, nice. Will this/is this in 0.4?

Also, can this be added to the wiki with all possible variables?