Author Topic: Zoom script  (Read 13380 times)

0 Members and 1 Guest are viewing this topic.

Offline m!m

  • 211
Modifying the current script for this purpose would be more complicated than just writing a new script as the functionality you propose can be easily done using the existing scripting-API. I'll take a look at it tomorrow.

 

Offline Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
I haven't followed this for a while - may I know what its status is? Is there anything I should know except what I can find on this thread?
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 m!m

  • 211
No sadly no new developments.

 

Offline MetalDestroyer

  • Starwars reborn!
  • 210
I can't reproduce that but the warning indicates that something is corrupt in your script. Could you try to paste the script from the wiki into the file and try again?
I also updated the wiki page with a new version that is now able to enable zooming based on the weapon end (just set the "Weapon End" option to the post-fix you want).

Could you explain the setup with the weapon end ? I don't understand where or what to do with this ? I don't find any sample on the wiki.

 

Offline m!m

  • 211
I can't reproduce that but the warning indicates that something is corrupt in your script. Could you try to paste the script from the wiki into the file and try again?
I also updated the wiki page with a new version that is now able to enable zooming based on the weapon end (just set the "Weapon End" option to the post-fix you want).

Could you explain the setup with the weapon end ? I don't understand where or what to do with this ? I don't find any sample on the wiki.
It works using  by specifying a value let's say "zoom". After this the script will allow every weapon where the name ends with "#zoom" to use the zoom feature. That means that if you have the weapon "Subach HL-7" it will not be able to zoom but if you create a new weapon named "Subach HL-7#zoom" it will be able to zoom. This allows a quick setup if you do not want to got through all the more complicated configuration setup.

 

Offline Nyctaeus

  • The Slavic Engineer
  • 212
  • People use my models as avatars.
    • Minecraft
    • Exile
Sorry for the necro, but I have problem with the script. I want to use it in Shadow Genesis, but I have an error.
Code: [Select]
LUA ERROR: [string "zoom_KeyDn.lua"]:2: attempt to index global 'zoomLockKey' (a nil value)

------------------------------------------------------------------
ADE Debug:
------------------------------------------------------------------
Name: (null)
Name of: (null)
Function type: (null)
Defined on: 0
Upvalues: 0

Source: (null)
Short source:
Current line: 0
- Function line: 0
------------------------------------------------------------------


------------------------------------------------------------------
LUA Stack:
------------------------------------------------------------------

------------------------------------------------------------------
I've added version of the weapons with '#zoom" in the name. This error occuring during the putting any key. I'm not scripter and even experianced sctipt user. I have only basic knowledge of using it.
Exile | Shadow Genesis | Inferno | Series Resurrecta  | DA Profile | P3D Profile

Proud owner of NyctiShipyards. Remember - Nyx will fix it!

All of my assets including models, textures, skyboxes, effects may be used under standard CC BY-NC 4.0 license.

 

Offline m!m

  • 211
That is very weird... That piece of code should not be reached, are you sure that you have the latest version?
Try pasting the following code into your zoom_KeyDn.lua inside the scripts directory:
Code: (zoom_KeyDn.lua) [Select]
if runZoomScript and not fredOverride then
if zoomLockKey and hv.Key:lower() == zoomLockKey:lower() then
if lockedZoom then
zoomOut()
lockedZoom = false
return
else
zoomIn()
lockedZoom = true
return
end
end
if hv.Key:lower() == zoomKey:lower() then
zoomIn()
end
end
I hope that helps...

 

Offline Nyctaeus

  • The Slavic Engineer
  • 212
  • People use my models as avatars.
    • Minecraft
    • Exile
Now it's working, thanks. I copied the version from Wiki last time, I think it's buggy.
Great script :yes:.
Exile | Shadow Genesis | Inferno | Series Resurrecta  | DA Profile | P3D Profile

Proud owner of NyctiShipyards. Remember - Nyx will fix it!

All of my assets including models, textures, skyboxes, effects may be used under standard CC BY-NC 4.0 license.

 

Offline m!m

  • 211
I updated the wiki with my local version, sorry for the inconvenience :nervous:

 

Offline Nighteyes

  • 211
I was thinking, would it be possible to tell this script(or a similar one) to tilt and zoom the camera(especially good with cockpit model) just a bit in the direction of big events? such as a capship going down? this can look pretty cool if done right... it should trigger only if the event if happening more or less in the field of view

 

Offline m!m

  • 211
That kind of effect would be very difficult to "feel" right. Most times it will simply interrupt the game, for example when you're just following an enemy on the upper-left side of your screen but a capship goes down at the lower-right and the camera focuses on this then the enemy will be gone when everything is back to normal.
Of course it would be possible to have a script that would enable the FREDer to manipulate the camera so it turns to an event he would like to focus.

 

Offline Nighteyes

  • 211
well thats the idea, have it work only for major events, like completing an objective or failing it, this is much more important than losing an enemy fighter, as it means you already won/lost the battle...
I'm also sure a real pilot would also turn his head towards a friendly/hostile destroyer going down...

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
And I don't think so. Following an enemy is a matter of life and death, exploding capship is less so. A real pilot would pay attention to dogfight and focus on it.

 

Offline Talon 1024

  • 29
  • How do you turn this on?
    • Mods, Games, and Stuff
This script apparently doesn't work correctly with the latest FSO builds, since the player's ship's turn rate isn't affected when you zoom in.

Nevermind, I was able to solve the problem.  I think it had something to do with the mouse script, which I was also using at the same time.

However, if the config file has the Weapon End field, you won't be able to zoom in with any weapons other than those that have #zoom at the end.  Is this behaviour intentional?
« Last Edit: February 12, 2012, 10:55:15 pm by Talon 1024 »
To understand religion, you need to understand morality first. | WCSaga website | WCSaga Forum | 158th website | 158th forum | Project Leader: WC: Hostile Frontier | WCHF Thread at CIC | Wing Blender | Twist of Fate | Multipart turrets on angled surfaces, tutorial included. | My Google Drive stuff | To convert speeds from WC to WCS, multiply both the cruise speed and the Afterburner speed by 0.15625 (5/32)

FS2 Mods I'm waiting on: Inferno 10th Anniversary
Current Project: Contestant Android app, Learn4Life iOS app, Blender Commander (importer).
The FreeSpace Font Foundry is back in action!

 

Offline m!m

  • 211
The functions which the script use to alter the turn rate didn't get modified and worked when I last tried it. Maybe you have a wrong value for your "Sensitivity" setting. Can you post your configuration file?

 

Offline Talon 1024

  • 29
  • How do you turn this on?
    • Mods, Games, and Stuff
Posting here again because I'm having another problem with the script.  The script only works once I start up a mission for the first time after I start up FSO, but if I quit the mission I'm playing and start up another mission, the script will not work.

I suspect there's a bug that's causing the On Mission Start and On Mission End hooks to run only once per game.

EDIT: Reported in Mantis
« Last Edit: June 02, 2012, 11:12:51 pm by Talon 1024 »
To understand religion, you need to understand morality first. | WCSaga website | WCSaga Forum | 158th website | 158th forum | Project Leader: WC: Hostile Frontier | WCHF Thread at CIC | Wing Blender | Twist of Fate | Multipart turrets on angled surfaces, tutorial included. | My Google Drive stuff | To convert speeds from WC to WCS, multiply both the cruise speed and the Afterburner speed by 0.15625 (5/32)

FS2 Mods I'm waiting on: Inferno 10th Anniversary
Current Project: Contestant Android app, Learn4Life iOS app, Blender Commander (importer).
The FreeSpace Font Foundry is back in action!

 

Offline m!m

  • 211
I fixed the bug, a changed version is available in the FS wiki.
The bug was indeed caused by the On Mission Start-hook but instead of only running once it didn't get run completely. That was caused by the absence of a hook option for it so I added a meaningless $Application: FS2_Open to it and that fixed the issue.