Author Topic: Turret control script  (Read 7667 times)

0 Members and 1 Guest are viewing this topic.

Offline m!m

  • 211
Turret control script
Here is another script I've been working on that gives you control about a turret :D
I attached a zip file containing the mod. I comes with a test mission and it depends on Blue Planet 2 (because their turrets are perfect for this :nod:).
If you tried it, please tell me what you think and what could be better :)

A random screenshot:


Download the new version here: http://www.mediafire.com/?jzqmoe2882kvv52

Regards,
m!m
« Last Edit: September 09, 2012, 07:07:52 am by m!m »

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Turret control script
Holy ****.  :eek2:

 

Offline MatthTheGeek

  • Captain Obvious
  • 212
  • Frenchie McFrenchface
Re: Turret control script
This things throws lua errors about screen width, and none of the HUD elements you have on that screenshot are to be found.

Code: [Select]
LUA ERROR: [string "bankInfo.lua"]:5: attempt to perform arithmetic on global 'screenWidth' (a nil value)

------------------------------------------------------------------
ADE Debug:
------------------------------------------------------------------
Name: ?
Name of: field
Function type: Lua
Defined on: 70
Upvalues: 0

Source: misc-sct.tbm - On Game Init
Short source: [string "misc-sct.tbm - On Game Init"]
Current line: 75
- Function line: 6
------------------------------------------------------------------


------------------------------------------------------------------
LUA Stack:
?
loadGauges
?
execute_lua_file
------------------------------------------------------------------

------------------------------------------------------------------

Also, the vertical camera control is inverted, which is quite problematic.
People are stupid, therefore anything popular is at best suspicious.

Mod management tools     -     Wiki stuff!     -     Help us help you

666maslo666: Releasing a finished product is not a good thing! It is a modern fad.

SpardaSon21: it seems like you exist in a permanent state of half-joking misanthropy

Axem: when you put it like that, i sound like an insane person

bigchunk1: it's not retarded it's american!
bigchunk1: ...

batwota: steele's maneuvering for the coup de gras
MatthTheGeek: you mispelled grâce
Awaesaar: grace
batwota: oh right :P
Darius: ah!
Darius: yes, i like that
MatthTheGeek: the way you just spelled it it means fat
Awaesaar: +accent I forgot how to keyboard
MatthTheGeek: or grease
Darius: the killing fat!
Axem: jabba does the coup de gras
MatthTheGeek: XD
Axem: bring me solo and a cookie

 

Offline m!m

  • 211
Re: Turret control script
Ok that could be an issue with the loading order although I can't reproduce it on my side but I uploaded a new version that shouldn't rely on a specific load order.
Also the vertical control isn't an issue on my side. What input system do you use, maybe that is the cause.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Turret control script
does this just slave the joystick to the turret control, or ar you using some other method?
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline m!m

  • 211
Re: Turret control script
Yes it uses the joystick (or whatever you use) to move the turret.

 

Offline m!m

  • 211
Re: Turret control script
I have an update that adds some minor functionality.
List of changes:
  • Script now checks for collisions when a weapon is fired
  • Indicator that points to bombs in the current mission
  • Visual indicator for subsystem position and facing on the minimap
Be sure to test it using a recent build for correct firing points :p

Regards,
m!m

[attachment deleted by ninja]

 

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
Re: Turret control script
I haven't got access to FS2 to test this at the moment, but I do have one question - can it be turned on/off by sexp? I could really, really use this if that ws the case.
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Turret control script
Any script can be written in such a way as to make that possible.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline m!m

  • 211
Re: Turret control script
The script is written with something like that in mind. It can even be modified to only draw the HUD or only control the turret.

 

Offline Commander Zane

  • 212
  • Spoot Knight of Anvils
Re: Turret control script
Would this lead to missions where you're forced to operate a turret because an ambush splashes your carrier ship's fighterbay? :D

 

Offline Sushi

  • Art Critic
  • 211
Re: Turret control script
Looks cool, but...

What are the controls?

I can move around, and (sometimes) shoot, but the shots always just go straight up. Enemies are on the radar, but they all seem to be well behind my ship and out of my turret's field of fire...

  

Offline m!m

  • 211
Re: Turret control script
You can control the turret using the "standard" input method FS uses (mouse, keyboard, joystick, ...) and press F5 to get a list of possible hotkeys.
Concerning your second problem, are you using a recent build of FSO?

 

Offline Sushi

  • Art Critic
  • 211
Re: Turret control script
You can control the turret using the "standard" input method FS uses (mouse, keyboard, joystick, ...) and press F5 to get a list of possible hotkeys.
Concerning your second problem, are you using a recent build of FSO?

Did an SVN update and a fresh build just to test this out. :)

I'll try it again when I get the chance.

 

Offline Sushi

  • Art Critic
  • 211
Re: Turret control script
Same problem: turret definitely isn't shooting where I (or the barrel) is pointing.

 

Offline Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
Re: Turret control script
Has the problem mentioned by Sushi been solved? Also, I've just noticed that m!m's screenshot (see link at the beginning of this thread) may have been removed.
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito
My interviews: [ 1 ] - [ 2 ] - [ 3 ]

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
has this script been mirrored anywhere? i need to update my cockpit script to use the new meathod of turret control and needed a reference implementation to dissect. seems my turret system was broken with newer builds, and instead of trying to fix it i figured id just do things the right way and re-write it to use the new features.
« Last Edit: January 08, 2012, 08:25:02 am by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline m!m

  • 211
Here it is http://www.mediafire.com/?7ez65jn0warzf0f but I'm not sure if it even works :nervous:

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
this should help, thanks.

thats the funny thing about scripting, stuff that works on one build seldom works on another build. its not as bad as when wmc was trying to hammer out a paradigm for the scripting system, where he renamed functions and variables at random. but its enough to break things that i spent weeks developing. since they fixed my rtt issue been trying to bring old epic scripts up to date with the engine. your features will replace many a dirty hack in my scripts.
« Last Edit: January 08, 2012, 08:59:39 am by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline m!m

  • 211
Well, I wasn't active in those days but I rather meant that I'm not sure if I changed something inside the script which broke it.
Also you're welcome for the RTT fix :p