question of a amphibious nature

question of a amphibious nature

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
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

question of a amphibious nature

Post by oksnoop2 »

I want my amphibious mechs to behave like subs while in the water, that is swim shortly below the surface. And when they reach land, they change their orientation and begin walking upright. I tried setSFXoccupy ( 1 curTerrainType ) from the lua wiki, but it keeps telling me to correct the line in confusing ways, like adding "..."'s and "("'s near curTerrainType. Any suggestions?
User avatar
SanadaUjiosan
Conflict Terra Developer
Posts: 907
Joined: 21 Jan 2010, 06:21

Re: question of a amphibious nature

Post by SanadaUjiosan »

Has anyone done aquatic mechs/units like this?

From what I've seen of BA, amphibious units for the most part just travel on the seafloor like normal, and are just allowed to cross the waterline. I think that's pretty boring.
User avatar
TheRegisteredOne
Posts: 398
Joined: 10 Dec 2005, 21:39

Re: question of a amphibious nature

Post by TheRegisteredOne »

This is actually ridiculously easy. Lol. Someone else should come forth with details =p.
User avatar
SanadaUjiosan
Conflict Terra Developer
Posts: 907
Joined: 21 Jan 2010, 06:21

Re: question of a amphibious nature

Post by SanadaUjiosan »

Yes, someone should. My project's more or less hit a relative crawl because the last units I need to make are the two amphibious mechs.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: question of a amphibious nature

Post by FLOZi »

Check out the DUKW in S44.

http://spring1944.svn.sourceforge.net/v ... iew=markup

And this script include;

http://spring1944.svn.sourceforge.net/v ... iew=markup

Although it'd probably be better to use SetSFXOccupy than running the loop
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Re: question of a amphibious nature

Post by SinbadEV »

your basically asking for a hovercraft BTW
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: question of a amphibious nature

Post by knorke »

Pelcian amphi bots in numerous *a mods transform when going into/out water if that is of any help.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: question of a amphibious nature

Post by zwzsg »

Hovers travel over the surface.
Ships travel at the surface.
Subs travel under the surface.


Learn the difference. It could save your comm.
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Re: question of a amphibious nature

Post by SinbadEV »

I feel this thread has not gone sufficiently off-topic:

http://wimp.com/flyinghovercraft/
User avatar
SanadaUjiosan
Conflict Terra Developer
Posts: 907
Joined: 21 Jan 2010, 06:21

Re: question of a amphibious nature

Post by SanadaUjiosan »

Infolog:

Code: Select all

[      0] Failed to load: bamphmech.lua  ([string "scripts/bamphmech.lua"]:42: <name> or '...' expected near '1')
Script:

Code: Select all

	function script.setSFXoccupy(1)
		Turn(waist, x_axis, 1.55, 10)
	end
Maybe I'm just stupid, but the infolog's suggestion doesn't make sense to me. Suggestions?

Let it be said that the LuaCallins and LuaCallouts pages in the wiki may make sense to people who already know it, but parts of it aren't very intuitive to people who are ignorant of the whole lua process.

Oh, and that link was pretty cool. I hadn't seen that before. That'd be pretty awesome to have.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: question of a amphibious nature

Post by Tobi »

SanadaUjiosan wrote:

Code: Select all

	function script.setSFXoccupy(1)
	end
What makes you think this is a correct function declaration?

Hint: look what is usually between the parentheses.
User avatar
SanadaUjiosan
Conflict Terra Developer
Posts: 907
Joined: 21 Jan 2010, 06:21

Re: question of a amphibious nature

Post by SanadaUjiosan »

Tobi wrote:
SanadaUjiosan wrote:

Code: Select all

	function script.setSFXoccupy(1)
	end
What makes you think this is a correct function declaration?

Hint: look what is usually between the parentheses.
If I thought it was correct I wouldn't be asking for some help.
setSFXoccupy ( number curTerrainType ) -> nil
Called when terrain type changes. Terrain type is calculated with the following rules (in this order):
If unit is being transported -> curTerrainType = 0
If ground height < -5 and unit is always upright -> curTerrainType = 2
If ground height < -5 and unit is not always upright -> curTerrainType = 1
If ground height < 0 and unit is always upright -> curTerrainType = 1
Otherwise -> curTerrainType = 4
Where is curTerrainType = 3 ? :-)
Candidate to be changed to something saner later on.
That's what I'm going from. I tried throwing in the curTerrainType in there too but it didn't work either. The (1) was my last attempt before I posted what I had.

Infolog gives me the same error when I have that in there.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: question of a amphibious nature

Post by FLOZi »

Code: Select all

function script.setSFXoccupy(sfxType)
  if sfxType == 0 then
    -- unit is being transported
  else if sfxType == 1 then
    -- your unit is in water
  end
end
And so on.

Edit; what's with the strange capitalisation in setSFXoccupy? Why not SetSFXOccupy?
Post Reply

Return to “Game Development”