question of a amphibious nature
Moderator: Moderators
question of a amphibious nature
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?
- SanadaUjiosan
- Conflict Terra Developer
- Posts: 907
- Joined: 21 Jan 2010, 06:21
Re: question of a amphibious nature
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.
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.
- TheRegisteredOne
- Posts: 398
- Joined: 10 Dec 2005, 21:39
Re: question of a amphibious nature
This is actually ridiculously easy. Lol. Someone else should come forth with details =p.
- SanadaUjiosan
- Conflict Terra Developer
- Posts: 907
- Joined: 21 Jan 2010, 06:21
Re: question of a amphibious nature
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
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
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
your basically asking for a hovercraft BTW
Re: question of a amphibious nature
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
Hovers travel over the surface.
Ships travel at the surface.
Subs travel under the surface.
Learn the difference. It could save your comm.
Ships travel at the surface.
Subs travel under the surface.
Learn the difference. It could save your comm.
- SanadaUjiosan
- Conflict Terra Developer
- Posts: 907
- Joined: 21 Jan 2010, 06:21
Re: question of a amphibious nature
Infolog:
Script:
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.
Code: Select all
[ 0] Failed to load: bamphmech.lua ([string "scripts/bamphmech.lua"]:42: <name> or '...' expected near '1')
Code: Select all
function script.setSFXoccupy(1)
Turn(waist, x_axis, 1.55, 10)
end
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
What makes you think this is a correct function declaration?SanadaUjiosan wrote:Code: Select all
function script.setSFXoccupy(1) end
Hint: look what is usually between the parentheses.
- SanadaUjiosan
- Conflict Terra Developer
- Posts: 907
- Joined: 21 Jan 2010, 06:21
Re: question of a amphibious nature
If I thought it was correct I wouldn't be asking for some help.Tobi wrote:What makes you think this is a correct function declaration?SanadaUjiosan wrote:Code: Select all
function script.setSFXoccupy(1) end
Hint: look what is usually between the parentheses.
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.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.
Infolog gives me the same error when I have that in there.
Re: question of a amphibious nature
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
Edit; what's with the strange capitalisation in setSFXoccupy? Why not SetSFXOccupy?