Jump to content

VictorFarbau

Member
  • Content Count

    557
  • Joined

  • Last visited

  • Medals

Posts posted by VictorFarbau


  1. To stop your vehicle quickly I would use (SQS syntax):

    _oldfuel = fuel _mycar
    _mycar setFuel 0
    #holdit
    ~1
    ?(speed _mycar > 5): goto "holdit"
    [your code to eject people and do more]
    _mycar setFuel _oldfuel
    

    When your condition is true (damage > 0.4) it will stop the car, wait until it is slow enough (<= 5kmh), people can jump out, then the old fuel level is restored (if that is important).

    Hints: 0.4 damage might be too low to give up a vehicle. I started using "canMove" for example to assess relevant damage. 0.1 seconds is too aggressive for your damage loop. 0.5 should be more than enough and won't slow down your computer.

    VictorFarbau

    EDIT: removed some garbage from this post.


  2. @Thunderbird, thanks, nice idea! Very handy to know. Is this "startUpscript" a new line item in Arma 2? Never noticed that consciously. Maybe because I am a strong believer in XEH :)

    So I had put aside my current work to wait for Arma 2 XEH. While the waiting continues for VFAI (hit and init handlers for class man required) this VFFPSS would be a perfect candidate for your method. I'll pick my latest rev and try your advice. If successful I'd be happy to make it available to everyone interested (via DeveloperHeaven, that is).

    EDIT: doh, I think I just got it. So "startUpscript" is unique to bin.pbo? Apparently I can't use it in my custom config. Then I need to look for another smart way to start the script automatically w/o updating the base class again...

    Thanks,

    VictorFarbau


  3. Sure thing. Here it comes. I just dump the complete config since it may be easier to see the whole thing than to request bits and pieces...

    Edit: sad thing is, as mentioned, that my edit fields display perfectly fine and are fully useable. Just this stupid error galore and the inability to access the fields gives me a headache. Can't seem to be able to resolve this.

    Thanks for your time,

    VictorFarbau

    // FPSS Control Panel Dialog
    
    // The default template provided by BIS
    // Control types
    #define CT_STATIC           0
    #define CT_BUTTON           1
    #define CT_EDIT             2
    #define CT_SLIDER           3
    #define CT_COMBO            4
    #define CT_LISTBOX          5
    #define CT_TOOLBOX          6
    #define CT_CHECKBOXES       7
    #define CT_PROGRESS         8
    #define CT_HTML             9
    #define CT_STATIC_SKEW      10
    #define CT_ACTIVETEXT       11
    #define CT_TREE             12
    #define CT_STRUCTURED_TEXT  13
    #define CT_CONTEXT_MENU     14
    #define CT_CONTROLS_GROUP   15
    #define CT_XKEYDESC         40
    #define CT_XBUTTON          41
    #define CT_XLISTBOX         42
    #define CT_XSLIDER          43
    #define CT_XCOMBO           44
    #define CT_ANIMATED_TEXTURE 45
    #define CT_OBJECT           80
    #define CT_OBJECT_ZOOM      81
    #define CT_OBJECT_CONTAINER 82
    #define CT_OBJECT_CONT_ANIM 83
    #define CT_LINEBREAK        98
    #define CT_USER             99
    #define CT_MAP              100
    #define CT_MAP_MAIN         101
    // Static styles
    #define ST_POS            0x0F
    #define ST_HPOS           0x03
    #define ST_VPOS           0x0C
    #define ST_LEFT           0x00
    #define ST_RIGHT          0x01
    #define ST_CENTER         0x02
    #define ST_DOWN           0x04
    #define ST_UP             0x08
    #define ST_VCENTER        0x0c
    #define ST_TYPE           0xF0
    #define ST_SINGLE         0
    #define ST_MULTI          16
    #define ST_TITLE_BAR      32
    #define ST_PICTURE        48
    #define ST_FRAME          64
    #define ST_BACKGROUND     80
    #define ST_GROUP_BOX      96
    #define ST_GROUP_BOX2     112
    #define ST_HUD_BACKGROUND 128
    #define ST_TILE_PICTURE   144
    #define ST_WITH_RECT      160
    #define ST_LINE           176
    #define ST_KEEP_ASPECT_RATIO	0x800
    
    #define FontM		"TahomaB"
    #define amber		{1, 1, 0, 0.7}
    #define white		{1,1,1,0.7}
    #define dspx		0.05
    #define dspy		0.2
    #define dspw		0.6
    #define dsph		0.5
    #define theight		0.045
    #define	minfps		31421
    #define	maxfps		31422
    #define	mindist		31423
    #define	maxdist		31424
    #define	dbon		31425
    #define cprevt		"Rev 1.0 Arma II"
    
    class fpssdialog {
    idd = -1;
    movingEnable = true;
    
    // Simulation enables manipluation of text properties by scripts
    enableSimulation = 1;
    enableDisplay = 1;
    objects[] = {};
    controls[] = {cp,cptitle,cprev,line1,loFPS,loFPSval,hiFPS,hiFPSval,loDist,loDistval,hiDist,hiDistval,debugON,debugONb,line2,closeD};
    controlsBackground[] = {};
    
    
    class common1 {
    	font = FontM;
    	sizeEx = 0.04;
    	colorText[] = white;
    	colorBackground[] = { 0, 0, 0, 0 };
    };
    class commonE {
    	type = CT_EDIT;
    	font = FontM;
    	size = 0.1;
    	sizeEx = 0.04;
    	style = 0x00 + 0x40;
    	colorText[] = white;
    	colorBackground[] = {0,0,0,0};
    	colorSelection[] = {0,1,0,0.7};
    	autocomplete = false;
    	text = "";
    };
    class commonButton {
    	type = CT_BUTTON;
    	style = ST_CENTER;
    	font = FontM;
    	sizeEx = 0.04;
    	colorText[] = white;
    	colorFocused[] = {0,0,0,0};
    		colorDisabled[] = {1, 1, 1, 0.2};
    	colorBackground[] = {0, 0, 0, 0};
    	colorBackgroundDisabled[] = {0,0,0,0};
    	colorBackgroundActive[] = {0.5, 1, 0, 0.7};
    	offsetX = 0.003;
    	offsetY = 0.003;
    	offsetPressedX = 0.002;
    	offsetPressedY = 0.002;
    	colorShadow[] = {0, 0, 0, 0};
    	colorBorder[] = {0, 0, 0, 0};
    	borderSize = 0;
    	soundEnter[] = {"", 0, 1 };
    	soundPush[] = {"", 0, 1 };
    	soundClick[] = {"", 0, 1 };
    	soundEscape[] = {"", 0, 1 };
    	text = "Undefined";
    };
    
    class cp {
    	idc = -1;
    	moving = 1;
    	type = CT_STATIC;
    	style = ST_BACKGROUND;
    	x = dspx; y = dspy;
    w = dspw; h = dsph;
    	font = FontM;
    	sizeEx = 0;
    	colorText[] = white;
    	colorBackground[] = { 0, 0, 0, 1 };
    	text = "";
    };
    
    class cptitle: common1 {
    	idc = -1;
    	type = CT_STATIC;
    	style = ST_LEFT;
    	x = dspx + 0.01; y = dspy + 0.01;
    w = dspw - 0.02; h = theight;
    	text = "VF FPS Saver";
    };
    
    class cprev: common1 {
    	idc = -1;
    	type = CT_STATIC;
    	style = ST_RIGHT;
    	x = dspx + 0.01; y = dspy + 0.01;
    w = dspw - 0.02; h = theight;
    	text = cprevt;
    };
    
    class line1 {
    	idc = -1;
    	font = FontM;
    	colorText[] = white;
    	colorBackground[] = { 0, 0, 0, 0 };
    	type = CT_STATIC;
    	style = ST_LINE;
    	x = dspx + 0.01; y = dspy + theight + (theight / 5);
    w = dspw - 0.02; h = 0;
    	sizeEx = 0;
    	text = "";
    };
    
    class loFPS: common1 {
    	idc = -1;
    	type = CT_STATIC;
    	style = ST_LEFT;
    	x = dspx + 0.01; y = dspy + (theight * 1.5);
    w = 0.35; h = theight;
    	text = "Low FPS (Quality --)";
    };
    class loFPSval: commonE {
    	idc = minFPS;
    	x = dspx + 0.4; y = dspy + (theight * 1.5);
    w = 0.1; h = theight;
    };
    
    class hiFPS: common1 {
    	idc = -1;
    	type = CT_STATIC;
    	style = ST_LEFT;
    	x = dspx + 0.01; y = dspy + (theight * 3);
    w = 0.35; h = theight;
    	text = "High FPS (Quality ++)";
    };
    class hiFPSval: commonE {
    	idc = maxFPS;
    	x = dspx + 0.4; y = dspy + (theight * 3);
    w = 0.1; h = theight;
    };
    
    class loDist: common1 {
    	idc = -1;
    	type = CT_STATIC;
    	style = ST_LEFT;
    	x = dspx + 0.01; y = dspy + (theight * 4.5);
    w = 0.35; h = theight;
    	text = "Minimum Viewdistance (m)";
    };
    class loDistval: commonE {
    	idc = minDist;
    	x = dspx + 0.4; y = dspy + (theight * 4.5);
    w = 0.1; h = theight;
    };
    
    class hiDist: common1 {
    	idc = -1;
    	type = CT_STATIC;
    	style = ST_LEFT;
    	x = dspx + 0.01; y = dspy + (theight * 6);
    w = 0.35; h = theight;
    	text = "Maximum Viewdistance (m)";
    };
    class hiDistval: commonE {
    	idc = maxDist;
    	x = dspx + 0.4; y = dspy + (theight * 6);
    w = 0.1; h = theight;
    };
    
    class debugON: common1 {
    	idc = -1;
    	type = CT_STATIC;
    	style = ST_LEFT;
    	x = dspx + 0.01; y = dspy + (theight * 7.5);
    w = 0.34; h = theight;
    	text = "Debug Messages";
    };
    class debugONb: commonButton {
    	idc = dbon;
    	x = dspx + 0.4; y = dspy + (theight * 7.5);
    w = 0.1; h = theight;
    	action =  "dummy = [0] execVM ""debugswitch.sqf"";";
    };
    
    class line2: common1 {
    	idc = -1;
    	type = CT_STATIC;
    	style = ST_LINE;
    	x = dspx + 0.01; y = dspy + (theight * 9);
    w = dspw - 0.02; h = 0;
    	text = "";
    };
    
    class closeD: common1 {
    	idc = -1;
    	type = CT_BUTTON;
    	style = ST_CENTER;
    	x = dspx + ((dspw / 2) - 0.05); y = dspy + (theight * 10) - 0.03; w = 0.1; h = theight;
    	font = FontM;
    	colorText[] = white;
    	colorFocused[] = {0,0,0,0};
    		colorDisabled[] = {0,0,0,0};
    	colorBackground[] = {0, 0, 0, 0};
    	colorBackgroundDisabled[] = {0, 0, 0, 0};
    	colorBackgroundActive[] = {0.5, 1, 0, 0.7};
    	offsetX = 0.003;
    	offsetY = 0.003;
    	offsetPressedX = 0.002;
    	offsetPressedY = 0.002;
    	colorShadow[] = {0, 0, 0, 0};
    	colorBorder[] = {0, 0, 0, 0};
    	borderSize = 0;
    	soundEnter[] = {"", 0, 1 };
    	soundPush[] = {"", 0, 1 };
    	soundClick[] = {"", 0, 1 };
    	soundEscape[] = {"", 0, 1 };
    	action = "closeDialog 0";
    	text = "CLOSE";
    };
    
    };


  4. Weird thing while creating some quick configuration dialog for my current VFFPSS project. I need some text edit fields in there as well.

    Problem is, they seem to work correctly; the dialog displays ok and I can edit, select, delete and do all the fancy stuff with them.

    However, the RPT file contains errors; furthermore they can't be addressed by "ctrlSetText" or "ctrlText" which is likely due to the same error.

    The rpt file contains this:

    Error loading control <long path>\ArmA 2\missions\VFFPSS.Chernarus\description.ext/fpssdialog/loFPSval/

    Error loading control <long path>\ArmA 2\missions\VFFPSS.Chernarus\description.ext/fpssdialog/hiFPSval/

    Error loading control <long path>\ArmA 2\missions\VFFPSS.Chernarus\description.ext/fpssdialog/loDistval/

    Error loading control <long path>\ArmA 2\missions\VFFPSS.Chernarus\description.ext/fpssdialog/hiDistval/

    All of these fields are edit controls. All the rest of the dialog works fine. This is what the base class of my edit field looks like:

    class commonE {

    type = CT_EDIT;

    font = FontM;

    sizeEx = 0.04;

    style = ST_MULTI;

    colorText[] = white;

    colorBackground[] = {0,0,0,0};

    colorSelection[] = {0,1,0,0.7};

    autocomplete = false;

    text = "";

    };

    And here's one of the the inheriting controls (they all look the same):

    class loFPSval: commonE {

    idc = minFPS;

    x = dspx + 0.4; y = dspy + (theight * 1.5);

    w = 0.1; h = theight;

    };

    All names are defined properly, all fields seem to be there. I can't see what's wrong. Maybe you can? :)

    Cheers,

    VictorFarbau


  5. lowering complexity and raise the VD when up in the skies

    This is already part of build 032. But there's room for more improvement. Next thing on my agenda is to add a control panel to allow setting of some custom values. Oddly enough I am having trouble with adding a user action through the config.cpp. What worked fine in Arma 1 doesn't seem to work in Arma 2 for some reason.

    And I don't see much point in posting this in the editing forum in its current state. I see some more trial and error coding ahead :rolleyes:

    VictorFarbau


  6. Looking good, will observe for a couple of more days. Seems extremly fast now on my end.

    EDIT: just read about the monday migration date :) Funny, looks like the biggest community (must be Germany) is giving this server a break these days. Could be due to the bank holiday this Thursday where lots of folks take off the Friday as well (and not necessarily to study the comref :) ).

    Thanks,

    VictorFarbau


  7. Funny that you came to mention that. I just happened to upload a new version that includes a viewdistance fix when airborne.

    Don't argue about the values :) As mentioned it's all experimental now and I will implement a way for players to set their own prefs. A learning mode would be nice, too.

    Cheers,

    VictorFarbau


  8. @Rommel, I agree with the terraingrid switches, those cause a ~1sec lag which is annoying. I was refining the code to be less agressive there and only switch between 2 (lo-hi) levels and not incremental anymore.

    The viewdistance didn't cause much trouble here so far. But as said, refining the code now. Since I need this myself I am not yet letting go of the concept :) Just need to implement some smart ideas here.

    VictorFarbau


  9. A2 runs beautifully on my machine

    Yeah, that's what I thought, too :) And then I played a mission with lots of people and vehicles in Elektrozavodsk and it started raining and I looked through my scope... there went my fps (down to 12 at times).

    My machines is a 4gb Q6600@2.6ghz + ATI 4850 all running under Win7rc. Not exactly a killer machine. But hey, why run to the store when I can write my own script to adapt quality :D More money left for the family.

    Edit: Also, what doesn't add to performance is my 24" Full HD panel; playing in 1920x1080 is a bit more demanding compared to the many 17" and 19" out there still.

    BTW - I read about this "Dynamic Viewdistance" addon the other day which made me look at the options in Arma 2. Looks like the author pulled it from all sites and disappeared. Shame, I really wanted to check out his fps measurement.

    Anyway, I think it's awesome that BIS added this function to the script commands. Based on this your missions could decide to send / not send more units into the battle while maintaining performance and much more.

    Back to playing now; since I got my copy I am somehow stuck in the Editor. Haven't touched the campaign yet.

    Cheers,

    VictorFarbau


  10. Download link: http://dev-heaven.net/projects/list_files/vffpss

    Victor Farbau's FPS Saver

    == Revision History ==

    Build 64 (Bugfix release)

    - Removed L2 debug message in non-debug mode

    - Corrected L2 handling and execution

    Build 60

    - Introduced usage of parameter file \Userconfig\VF\VFFPSS.hpp to pre-set some values

    - Introduced Level 2 measures (default OFF, only activated through VFFPSS.hpp)

    Build 48

    - New config as suggested by Armatech -> Control Panel now can be called from the ESC menu screen instead of action menu

    - Control Panel will show up quicker now

    Build 46

    - Lowered TerrainGrid Value @ low settings

    - Added more latency to increasing TerrainGrid

    - Added exit option to control panel - will terminate VFFPSS until control panel is called again

    - Added error handling in user control panel

    Build 043

    - Increased reaction time, addon version

    - Addon version

    - Built in control panel to set custom values

    Build 032

    - Added airborne detection; when in airborne (plane, chopper, chute) script is paused and viewdistance is fixed

    - Changed terraindetail to just LO and HI setting. Gradual stepping caused too much stuttering

    - Added vehicle function; when in vehicle and engine is running LO terraindetail will be assumed

    WHAT IS IT?

    VFFPSS is an addon that automatically reduces the visual quality during gameplay to gain more FPS. The adjustment happens dynamically and will be reversed once sufficient FPS are being detected. It is yourself who sets the appropriate threshholds for these adjustments. Press ESC during the game and call the VFPSS Dialog by pressing the related button top left.

    Also, you need to place the provided "VFFPSS.hpp" configuation file into a "Userconfig\VF" directory structure in your Arma II root directory.

    It should look like this (example path):

    +---Games

    |..... \Armed Assault II (This is your game "root" folder, the name may vary)

    |.......... \Userconfig

    |............... \VF

    |.................... VFFPSS.hpp

    The file contains the default settings used by VFFPSS. If the addon does not find the file for any reason you will see an error message; however you can continue to play. VFFPSS will configure itself with some default values which you can still change in the control panel. But using the config file method is a hell lot more convenient obviously.

    There are two levels of quality:

    Level 1: Decrease viewdistance and terrain quality

    Level 2: Decrease terrain quality further so that all grass will disappear; delete all nearby dead bodies

    Level 2 is disabled by default. You can only enable it through the config file. The options in that file are documented and should be self-explanatory.

    TRY YOUR OWN SETTINGS.

    You can try your own settings through the control panel and later add the desired values to the VFFPSS.hpp file for automatic use. Advice: don't set minFPS and maxFPS too close; if you do you will witness constant switching of viewdistance and terrain quality. That can get very annoying. So make sure you really only decrease when FPS reach an unacceptable limit and increase when you don't really need this rate to play.

    Have fun,

    VictorFarbau

×