Author Topic: Zoom-in Function  (Read 823 times)

0 Members and 1 Guest are viewing this topic.

HokieBT

  • Grandmaster Knight
  • *
  • may the force be with you
    • View Profile
  • Faction: Neutral
Re: Zoom-in Function
« Reply #15 on: July 10, 2009, 05:49:18 PM »

The way I stopped speeder bikes (horses) from moving in my mod when not ridden was to run a trigger to set the animation to an unused one every second... So maybe we have to do something similar when the player zooms in? That same trigger could potentially also change the camera angle to the player look or something...
 

WilliamBerne

  • Sergeant Knight
  • *
    • View Profile
  • Faction: Khergit
Re: Zoom-in Function
« Reply #16 on: July 10, 2009, 06:29:08 PM »
Just tested move the cam without (mission_cam_set_mode,1), it didn't help. the cam was moved to the certain position in 1 secend, then it was draged back to the player very quickly.
maybe try (mission_cam_set_mode,2),  or 3 later. but I doubt if it will work.

I think we can simply tell the player: don't use this function before you fully stop, or you may run into enemies.
Sniperscope won't go well I believe, but a unmovable binoculars is acceptable.

jik

  • Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Zoom-in Function
« Reply #17 on: July 10, 2009, 06:37:03 PM »
Can we override the movement?  Something similar to this:

  (ti_tab_pressed, 0, 0, [],
   [(try_begin),
      (eq, "$g_mt_mode", abm_visit),
      (set_trigger_result, 1),
    (else_try),
      (question_box,"str_give_up_fight"),
    (try_end),
    ]),

HokieBT

  • Grandmaster Knight
  • *
  • may the force be with you
    • View Profile
  • Faction: Neutral
Re: Zoom-in Function
« Reply #18 on: July 14, 2009, 05:30:54 AM »
ok, I played around with the concept of binoculars and am pretty happy with how it is working so far.  If you have itm_binocular in your inventory then the B key changes you view between a 0-4x magnification.  The player and/or horse they are ridding will stop moving while you are zoomed in.  You can also use your mouse to move the binoculars while zoomed.  It could use a presentation overlay (no clue how to add that), and I may have some redundant code so let me know if you guys can improve it any further...

create itm_binocular in module_items.py
Quote
["binocular","Macro Binoculars", [("laser_scope",0)], itp_merchandise|itp_type_goods, 0,5000,weight(5)|abundance(40),imodbits_none],

add this to the top of module_mission_templates.py
Quote
from module_animations import *

copy this into the top part of module_mission_templates.py with the other common_ code
(click to show/hide)

add this to any mission template you want to be able to use them
Quote
      common_use_binocular_1,
      common_use_binocular_2,
« Last Edit: July 14, 2009, 03:09:08 PM by HokieBT »
 

bjorne.

  • Knight at Arms
  • *
  • I'm a nerd... deal with it..
    • View Profile
    • Age of Blackpowder - Realm of Revolution
  • Faction: Swadian
Re: Zoom-in Function
« Reply #19 on: July 14, 2009, 10:08:40 AM »
WoW HokieBT are you going to use this in your mod?

jik

  • Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Zoom-in Function
« Reply #20 on: July 14, 2009, 02:38:11 PM »
can you still do a weapon attack?  Have you tried shooting while in the zoom in mode?  If so, this can easily translate into a scope.

HokieBT

  • Grandmaster Knight
  • *
  • may the force be with you
    • View Profile
  • Faction: Neutral
Re: Zoom-in Function
« Reply #21 on: July 14, 2009, 03:04:27 PM »
yeah, I'm going to use this in my mod.   I was working on this last night, so do remember that I was able to fire, but don't remember if it shot in the center of the screen.  I think the regular crosshairs didn't move (which would be fine for a scope) but my guess would be that the angle of the aim would be off.  I think we'd probably need to move the camera position to start from the players hand, since right now I think its from the player's face, but that may change because of that :height check in there?  We'd probably also have to check if riding a horse made a difference, etc....  Right now the code checks if itm_binocular is in your inventory, but it could easily be modified to check if one of your equipped items is a gun with a scope, etc.   Anyway, this is about the limit on my coding skill, and I don't understand anything with all these camera commands (I just cut-n-pasted what you guys had), but I bet this could be improved to make a decent binoculars and/or scope.

edit:  I also set the animation to anim_defend_fist to stop the player from moving, but if they are mounted then they move to the ground.  So I might want to reverse the code to first check if the player is riding a horse and if they are set it to a different animation, otherwise use the defend_fist one....  might also be cool if we could run a command to sheath your weapon if you are using the binoculars, since right now I hold a sword up to my head when I do the anim_defend_fist.  ;)

I'd also like to eventually add a mesh overlay, something like this would look awesome for my star wars mod.  hehe

« Last Edit: July 14, 2009, 03:10:48 PM by HokieBT »
 

HokieBT

  • Grandmaster Knight
  • *
  • may the force be with you
    • View Profile
  • Faction: Neutral
Re: Zoom-in Function
« Reply #22 on: July 16, 2009, 12:20:45 AM »

figured I bump this if anybody is interested.  People can probably improve my code, but its pretty neat.  The aiming crosshairs are still visible if you have a gun equipped and the sniper scope concept doesn't seem to work great, but binoculars are very cool.    We may be able to get a sniper working with a little work....

       
 

jik

  • Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Zoom-in Function
« Reply #23 on: July 16, 2009, 01:50:56 AM »
Nice!  When's the next release of the mod?

HokieBT

  • Grandmaster Knight
  • *
  • may the force be with you
    • View Profile
  • Faction: Neutral
Re: Zoom-in Function
« Reply #24 on: July 16, 2009, 02:08:26 AM »

I'd guess the next release will hopefully be this week or next one.
 

rorschach82

  • Veteran
  • *
  • yea.. i am bat shit crazy..
    • View Profile
  • Faction: Neutral
Re: Zoom-in Function
« Reply #25 on: August 26, 2009, 03:10:55 PM »
hmm.. did you guys find the script to move the cameras and stuff??
is it possible to zoom out the camera instead of zooming in??

i was planning on using an overlay mesh like those scope designs in order to enhance the player GUI
and i would like to be able to fight in a real 3rd-person POV rather than that over-the-shoulder view..

something like this:


« Last Edit: August 26, 2009, 03:13:58 PM by rorschach82 »

HokieBT

  • Grandmaster Knight
  • *
  • may the force be with you
    • View Profile
  • Faction: Neutral
Re: Zoom-in Function
« Reply #26 on: August 26, 2009, 04:11:54 PM »

yeah, I think that should be possible.   We integrated a death camera when you can watch the battle from above one of your troops perspectives, so you you control the position of the camera and a few other things.   These type of posts might get you started.

http://forums.taleworlds.net/index.php/topic,59637.0.html
http://forums.taleworlds.net/index.php/topic,61929.0.html
 

rorschach82

  • Veteran
  • *
  • yea.. i am bat shit crazy..
    • View Profile
  • Faction: Neutral
Re: Zoom-in Function
« Reply #27 on: August 26, 2009, 04:35:21 PM »

yeah, I think that should be possible.   We integrated a death camera when you can watch the battle from above one of your troops perspectives, so you you control the position of the camera and a few other things.   These type of posts might get you started.

http://forums.taleworlds.net/index.php/topic,59637.0.html
http://forums.taleworlds.net/index.php/topic,61929.0.html

thanks HokieBT. browsing in those threads right now..

btw, your starwars mod is great. i just played it sometime ago.  :)