Page 1 of 1
question of a amphibious nature
Posted: 01 Mar 2010, 06:12
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?
Re: question of a amphibious nature
Posted: 01 Mar 2010, 16:37
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.
Re: question of a amphibious nature
Posted: 03 Mar 2010, 04:37
by TheRegisteredOne
This is actually ridiculously easy. Lol. Someone else should come forth with details =p.
Re: question of a amphibious nature
Posted: 03 Mar 2010, 11:18
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.
Re: question of a amphibious nature
Posted: 03 Mar 2010, 14:43
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
Re: question of a amphibious nature
Posted: 03 Mar 2010, 15:08
by SinbadEV
your basically asking for a hovercraft BTW
Re: question of a amphibious nature
Posted: 03 Mar 2010, 16:21
by knorke
Pelcian amphi bots in numerous *a mods transform when going into/out water if that is of any help.
Re: question of a amphibious nature
Posted: 03 Mar 2010, 16:55
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.
Re: question of a amphibious nature
Posted: 03 Mar 2010, 17:18
by SinbadEV
I feel this thread has not gone sufficiently off-topic:
http://wimp.com/flyinghovercraft/
Re: question of a amphibious nature
Posted: 03 Mar 2010, 18:38
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.
Re: question of a amphibious nature
Posted: 03 Mar 2010, 19:30
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.
Re: question of a amphibious nature
Posted: 03 Mar 2010, 19:43
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.
Re: question of a amphibious nature
Posted: 03 Mar 2010, 19:55
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?