Author Topic: Script  (Read 1606 times)

0 Members and 1 Guest are viewing this topic.

Offline Johny_Nawalony

  • First Lieutenant
  • *
  • Posts: 762
    • View Profile
  • Side: Confederacy
Script
« on: March 23, 2016, 09:42:03 pm »
Is it possible (or maybe have done it actually) a script that will lock player in first person?
I can do paid skin comissions so yeah msg if ya want one

Offline Pio

  • Sergeant
  • *
  • Posts: 47
    • View Profile
    • my steam profile
  • Side: Neutral
Re: Script
« Reply #1 on: March 24, 2016, 05:21:46 am »
It is possible client side. It would be easy to disable switching camera modes by executing this every second:
Code
(omit_key_once, key_r),

The problem is that it would lock player in the default view wich is third person view. I don't know if there is a way to switch camera views in a script, but you can fake it changing the camera position. Unfortunately when you do that player won't be able to rotate the camera up and down. It would probably be possible to add some code that would allow doing it though. Also because of the fact that you need to change camera position in the code it can take some trial and error to align it the way you want it, but because you would have a complete control of it's position you could create more camera views that are available in the game.

Here is the code that needs to be executed all the time:
Code
  
(try_begin),
  (game_in_multiplayer_mode),

  (multiplayer_get_my_player, ":my_player_no"),
  (player_is_active, ":my_player_no"),
  (player_get_agent_id, ":agent_id", ":my_player_no"),
  (gt, ":agent_id", -1),

  (mission_cam_set_mode, 1, 9999),
  (agent_get_position, pos20, ":agent_id"),
  (position_move_y, pos20, 50, 0),
  (position_move_z, pos20, 170, 1),
  (mission_cam_set_position, pos20),
(try_end),

Screenshot:

Offline cihan

  • Volunteer
  • *
  • Posts: 3
    • View Profile
Re: Script
« Reply #2 on: March 29, 2016, 05:26:44 pm »
Is it possible (or maybe have done it actually) a script that will lock player in first person?

why on gods green earth would you want to lock into first person

also, client side you can do anything like set visibility to 0 if you really want it


ie.........



multiplayer_client_walking666 = (
  0, 0, 0, [
  (neg|multiplayer_is_dedicated_server),
  (neg|is_presentation_active, "prsnt_multiplayer_admin_chat"),
  (neg|is_presentation_active, "prsnt_game_multiplayer_admin_panel"),
  (key_clicked,key_numpad_1),
  ],
  [

 (call_script,"script_client_get_my_agent"),
          (assign,":agent_id",reg0),
          (agent_is_active,":agent_id"),
          (agent_is_alive,":agent_id"),
          (agent_set_visibility, ":agent_id", 0),
   

  ])


so when ever you press the key, you are in first mode locked

but still, its not really a game designed as fps