Home   Help Search Login Register  

Author Topic: Setviewdistance and setterrain  (Read 2537 times)

0 Members and 1 Guest are viewing this topic.

Offline CAS_Daniel

  • Members
  • *
  • Rifleman
Setviewdistance and setterrain
« on: 21 Apr 2008, 21:11:47 »
Hi,
Evolution has an action menu option at the start that allows the player an option to change some settings while they're in the hanger.
I'd like something similar for my training island.
I've found the script that sets the options but I can't find anything to do with making the option appear in the hanger.

Anyone else looked at this or know a good way of letting players set their own terrain/viewdistance in MP?

Cheers,

Daniel
Romeo 2.5 UK-based Light Infantry Platoon
forums.romeo25.com/

Offline Rommel92

  • Members
  • *
Re: Setviewdistance and setterrain
« Reply #1 on: 22 Apr 2008, 01:09:16 »
I can't see why you couldn't do it via an action menu, or a dialog. Just play around with execution parameters of the script you found. And or wait till I get home and I'll make a funky little dialog (I need it too  :yes:) with some options... question is.

What other options should there be?

SetViewDistance - SetTerrain

Any others....???

Offline Shadow.D. ^BOB^

  • Members
  • *
Re: Setviewdistance and setterrain
« Reply #2 on: 22 Apr 2008, 11:57:10 »
If need be take a look at the latest BAS_f mission templates, one of the scripts included is the viewdistance.

http://www.ofpec.com/forum/index.php?topic=31182.0
« Last Edit: 22 Apr 2008, 12:04:54 by Shadow.D. ^BOB^ »

Offline CAS_Daniel

  • Members
  • *
  • Rifleman
Re: Setviewdistance and setterrain
« Reply #3 on: 22 Apr 2008, 19:15:42 »
At the moment i'm just thinking a simple action menu option at the starting point of the mission with setterrain for people that can't handle the grass, and setviewdistance for pilots. Can't really think of any others off the top of my head.
Cheers Shadow, i'll look into that, and Rommel, an example mission would be awesome.  :D

Cheers guys.
Romeo 2.5 UK-based Light Infantry Platoon
forums.romeo25.com/

Offline Rommel92

  • Members
  • *
Re: Setviewdistance and setterrain
« Reply #4 on: 27 Apr 2008, 20:49:30 »
Sorry for the delay mate, wasn't sure if you still wanted it, but as requested.
The dialog is from the dialog framework by Dr Eyeball, but its been modified specifically for a mission of mine, and with a small amount of editing it suited the basic functions of yours. A simple copy paste of everything in that folder to your mission should work. (You may have to edit in if it overrides files)

Regards,
Romm.
« Last Edit: 27 Apr 2008, 20:54:06 by Rommel92 »

Offline CAS_Daniel

  • Members
  • *
  • Rifleman
Re: Setviewdistance and setterrain
« Reply #5 on: 28 Apr 2008, 00:31:44 »
Awesome mate, much appreciated! I'll give it a spin now.  :)

EDIT: Works perfectly, can't seem to get it to remove the action after a set time though. Just want the action menu to be available at the start of the mission.

Cheers,
Dan
« Last Edit: 28 Apr 2008, 16:13:46 by CAS_Daniel »
Romeo 2.5 UK-based Light Infantry Platoon
forums.romeo25.com/

Offline Rommel92

  • Members
  • *
Re: Setviewdistance and setterrain
« Reply #6 on: 28 Apr 2008, 21:00:26 »
Change the "scripts\init.sqf"
Code: [Select]
/* If (isServer) exitwith {}; Change when uploading to a Dedicated server. */
waitUntil {!(isNull player)};

_action = player addAction ["My Status", "Scripts\PopupMenu\ActivatePopupMenuViaAction.sqf", [], 0, false, false, "teamSwitchPrev"];
sleep 60.0;
player removeAction _action;

 ;)
« Last Edit: 28 Apr 2008, 21:47:35 by Rommel92 »

Offline CAS_Daniel

  • Members
  • *
  • Rifleman
Re: Setviewdistance and setterrain
« Reply #7 on: 29 Apr 2008, 18:08:15 »
Ah, nice one Romm! All sorted now.  :)
Romeo 2.5 UK-based Light Infantry Platoon
forums.romeo25.com/

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Setviewdistance and setterrain
« Reply #8 on: 29 Apr 2008, 18:30:40 »
You can tell whether you are on a dedicated server, so you don't have to do:
Code: [Select]
/* If (isServer) exitwith {}; Change when uploading to a Dedicated server. */

Instead, try:
Code: [Select]
// Exit on a dedicated server, but not on an SP or hosted server.
if (isServer and (isNull player)) exitwith {};

In SP or hosted games, the value of player on the server is set correctly at the very start of the mission, but on an MP server it is always null. Remember that this method is only valid at time == 0, since after that, the server-player could be dead (so player may, or may not, be null after this time).

On an MP client, player is initially null, but is set correctly when the player syncs.

[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)