From The Depths
pug Jun 11, 2017 @ 9:53am
Help with LUA
So I'm making a submarine, and I wanted to use LUA to control it.

I used this LUA code: http://www.fromthedepthsgame.com/forum/showthread.php?tid=8882

I put in everything he/she required, Front hydro foils, Pitch, yaw, roll, front, props, airpumps, target AI and mainframe, etc.

I then pasted the LUA into the ingame block and nothing happened, it wont correct roll pitch yaw, it doesn't react to enemies, nothing, am I doing something wrong?
< >
Showing 1-15 of 20 comments
dszombiex Jun 11, 2017 @ 11:02am 
It's possible, I'd have to look at it.
Koekiegast Jun 11, 2017 @ 11:33am 
a: you sure it is on?
b: maybe it requires the ai to be in let's say combat mode and there to be a enemie
pug Jun 11, 2017 @ 11:37am 
It's on, and it says not to add in naval AI so there is no combat mode, I tried adding in enemies, no response.
dszombiex Jun 11, 2017 @ 11:40am 
Originally posted by Koekiegast:
a: you sure it is on?
b: maybe it requires the ai to be in let's say combat mode and there to be a enemie

That lua replaces AI and would fight any onboard AI for control of the vehicle.
pug Jun 11, 2017 @ 11:43am 
I got it to work, turns out the code had some a letter at the end that messed it up lol.
mellow Jun 11, 2017 @ 5:41pm 
umm i need lua help too, i just wana know how to get the xyz of a missle
dszombiex Jun 11, 2017 @ 6:26pm 
Originally posted by an lol mellow:
umm i need lua help too, i just wana know how to get the xyz of a missle

--Assuming one mainframe with a munitions warning system connected to it
for i=0, I:GetNumberOfWarnings(0), 1 do
local warningInfo = I:GetMissileWarning(0, i)
local position = warningInfo.Position
I:LogToHud('x: ' ..position.x.. ' y: ' ..position.y.. 'z: ' ..position.z)
end
mellow Jun 11, 2017 @ 7:27pm 
Originally posted by dszombiex:
Originally posted by an lol mellow:
umm i need lua help too, i just wana know how to get the xyz of a missle

--Assuming one mainframe with a munitions warning system connected to it
for i=0, I:GetNumberOfWarnings(0), 1 do
local warningInfo = I:GetMissileWarning(0, i)
local position = warningInfo.Position
I:LogToHud('x: ' ..position.x.. ' y: ' ..position.y.. 'z: ' ..position.z)
end
oh thnx :) so for
I:GetLuaControlledMissileInfo(luaTransceiverIndex,missileIndex)
whats missle index mean?
pug Jun 11, 2017 @ 8:01pm 
Btw is there any way to turn LUA off? I want it to stop attacking enemies when they are no longer able to fight.
dszombiex Jun 11, 2017 @ 9:11pm 
Originally posted by -Lt. Pugsley-:
Btw is there any way to turn LUA off? I want it to stop attacking enemies when they are no longer able to fight.

Without going into the lua block itself, you'd have to program the lua to do nothing if you turn the "AI" to OFF mode in the map.
dszombiex Jun 11, 2017 @ 9:12pm 
Originally posted by an lol mellow:
Originally posted by dszombiex:

--Assuming one mainframe with a munitions warning system connected to it
for i=0, I:GetNumberOfWarnings(0), 1 do
local warningInfo = I:GetMissileWarning(0, i)
local position = warningInfo.Position
I:LogToHud('x: ' ..position.x.. ' y: ' ..position.y.. 'z: ' ..position.z)
end
oh thnx :) so for
I:GetLuaControlledMissileInfo(luaTransceiverIndex,missileIndex)
whats missle index mean?

There could be tens of missiles alive. The index is which missile you're going to get the info for.
mellow Jun 11, 2017 @ 9:17pm 
Originally posted by dszombiex:
Originally posted by an lol mellow:
oh thnx :) so for
I:GetLuaControlledMissileInfo(luaTransceiverIndex,missileIndex)
whats missle index mean?

There could be tens of missiles alive. The index is which missile you're going to get the info for.
does it count from other launchpads?
dszombiex Jun 11, 2017 @ 9:30pm 
Originally posted by an lol mellow:
Originally posted by dszombiex:

There could be tens of missiles alive. The index is which missile you're going to get the info for.
does it count from other launchpads?

I would assume that it's only missiles from the construct with the Lua block but I don't know. Why don't you try it with some LogToHud and find out?
mellow Jun 11, 2017 @ 10:00pm 
Originally posted by dszombiex:
Originally posted by an lol mellow:
does it count from other launchpads?

I would assume that it's only missiles from the construct with the Lua block but I don't know. Why don't you try it with some LogToHud and find out?
um i think it doesnt, i launched one from diferent transiever, then i launch from the first transiever and i still got the numbers
mellow Jun 11, 2017 @ 10:34pm 
and there isnt a way to see or set the missile's pitch, is there?
< >
Showing 1-15 of 20 comments
Per page: 1530 50

Date Posted: Jun 11, 2017 @ 9:53am
Posts: 20