Jump to content

CptBBQ

Member
  • Content Count

    93
  • Joined

  • Last visited

  • Medals

Posts posted by CptBBQ


  1. Actions are local to the machine you add them on. Thus, the condition of an action is run on the client(s).

    yeah I know...

    I was wondering what the impact on client performance (ignore my gibberish about server performance above^^) would be...
    I guess it's same as having a trigger or waituntil.
    That would make sense. So, I guess you would remove and re-add the actions instead of hiding them?

  2. Thanks for the reply!

    I should clarify some things:

    about 1.: I was referring to the actions themselves, not the scripts they´re calling. Those actions regularly have to check whether their condition statements are true or false. As I can tell from their ingame-behavior, this happens very often, because actions hide and show very quickly when the condition changes. The cpu usage should be depending on the complexity and number of condition statements. In my case there will be some booleans for each action that have to return 'true' for the action to show up.

    I was wondering what the impact on client performance (ignore my gibberish about server performance above^^) would be, if you had 30-something actions checking for their condition to become true (or false) at any time during the game.

    about 2.: sadly, my observations aren´t very scientific, so I´m not even sure I´ve got the problem pinpointed here. I figured I wouldn´t be the first one to experience this if such a limit really exists...


  3. Hi folks!

    Sorry for the topic, but I don´t think either of these questions deserves it´s own thread^^

    .. so here we go..

    1.) What´s the performance impact of actions added with 'addAction'?

    I usually do not remove actions that are used more than once. Instead I use a variable in the condition and change it to 'true' whenever the action should show up.

    Now I´m facing a situation where I´d have to create a whole lot of actions (30+, within sub-menus and sub-sub-menus) in a few-players mp environment.

    It would be quite a pain to delete and re-add the actions, but I fear this could tear down our already wavering server performance.

    Probably only a dev can know this for sure, but I´d be happy with some educated guesses from someone more experienced with the game engine.

    Of course, just stating 'how you would do it' would already be of great help :)

    ... and now for something completely different...

    2.) Is there some kind of limit to the number of markers the game can handle?

    In another context, I created a bunch of markers (within the editor) as a basis for an AI-waypoint/spawnpoint grid. I got a little carried away there, and ended up with quite a lot of markers. Later, while testing several scripts within this mission, I received a number of errors all related to a few markers which seemed to be inexplicably missing. I couldn´t find them in the editor either so I replaced them. But the same errors occurred later with other markers, and other scripts using markers also behaved strangely.

    My solution was to delete a bunch of markers from my grid and now everything is back to normal.

    But that whole thing got me curious. Is there a known fixed limit for markers? If so, is there a way to get around this limit?

    Thanks for reading all this. Any ideas are appreciated.

    Cheers,

    CptBBQ


  4. Using setPosASL actually reduces the offset for most objects. That´s already a great help. Thank you, shk.

    Well, what I´m trying to do (or already did) is not actually ruined by this 'bug' but it was a medium annoyance (now degraded to minor annoyance^^)

    I made a script that allows players to build a small outpost with sandbags and static weapons (like in warfare but much simpler). I recently expanded the script to be able to 'copyToClipboard' the type, position and direction for each fortification, static weapon and so on.

    The information is stored as executable code which can be pasted and called again in a later mission.

    It actually works pretty fine but I noticed that some objects (especially static weapons) aren´t placed correctly.

    I think I can live with it as it is now. But still, if anyone knows how to place objects really really precisely, I´d be more than interested.


  5. Hi all!

    I guess this should be already a known issue but I couldn´t find anything about it in the forum. So just to be sure...

    After experiencing some strange behavior in one of my scripts I did some debugging. Amongst a lot of other things I ran this line on a number of different objects:

    _target setPos getPos _target;

    As I understand it this line should not produce any observable results, but actually all of the tested objects changed their positions. The particular offset seems to depend on on the object type.

    E.g. an AA Pod moves backwards a few meters with each iteration while 'Fort_Barracks_USMC' sink into the ground and others are lifted into the air.

    Then, I wanted to know if the position is read incorrectly or set incorrectly.

    _target = cursorTarget;
    _pos = getPos _target;
    _target setPos _pos;
    hintSilent format ["%1 ### %2", _pos, getPos _target];
    

    The two positions returned differ from each other. That means 'getPos' determines the precise position and then the object is 'setPos'ed to a proximate position with a constant offset to the actual position.

    This raises a few questions for me..

    First of all: are my conclusions correct? ^^

    But also: am I the only one who´s bugged by this? Has anyone found a workaround? Is this regarded a bug? And if so, is it already reported?

    Yes, there are probably very few situations in which this issue should become problematic - but I´m currently in one of those situations so any feedback is appreciated.

    Thanks for reading, even more for answering ;)

    Cheers,

    bbq


  6. Hi all,

    cool thread. I read up on the issue recently and found this very informative wiki page: http://community.bistudio.com/wiki/showCommandingMenu

    But there are still some questions left. For example this argument..

    // isActive - Boolean 1 or 0 for yes or no - if item is not active, it appears gray.

    ...sets the menu item to inactive from the beginning.

    I´d guess then there should be some way to activate it later on, but that´s not mentioned anywhere...

    Is there any way at all to change/delete/manipulate menu items during the game?

    Any ideas?

    Thanks in advance,

    bbq

    ------------------------------

    edit

    @ Clayman and SNKMAN:

    I did this with something like

    if (player == player1) then {add player specific menu options};

    of course I´ve named all playable units accordingly. Tested on dedicated server without problems so far.


  7. Uh sorry, I probably should´ve explained a bit more...

    I want to rearm any static weapon within a certain radius, so I need do determine what magazine the given weapon uses, even if the weapon is currently empty.

    I guess I´ll have to get the classname from the vehicle config but I dunno how...

    ---------------------------

    edit: got it working now. thank you W0lle.


  8. Hi there!

    I need to be able to attach any two objects to each other, without changing their actual positions. For example, vehicle A is standing in front of static weapon B. B is attached to A, but doesn´t change position. Only if A moves, B moves along.

    First thing I tried was this:

    _obj attachTo [_target, _target worldToModel (getPos _obj)];

    ... seemed obvious to me, but didn´t work as expected. The attached objects z-axis-position changes. Most of the time the object disappears underground, but some objects hover above the ground.

    I guessed there´s some arbitrary offset build into the worldToModel command. So I tried using the objects original z-position as the vertical offset, but still, most objects are attached above or below their actual z-position.

    Has anyone experienced similar problems? Any chance there´s a workaround?

    Any help is appreciated!

    Cheers,

    CptBBQ

    PS: I know my example can be solved with different techniques, but for the actual purpose it´s very important that the object remains at it´s exact position when attached.

    I never had such problems with attachTo before


  9. Hi all,

    with =L2D=Curry´s permission I made a few changes to the script, so it can handle additional arguments passed to the code.

    Like this..

    this addAction ["Say Hello World!","gen_action.sqf",["player sideChat format ['Hello %1', _this select 3];", "World"]];

    It´s still compatible to actions made for the original version of the script and, of course, you can use the extended syntax, too.

    For some reason I cannot attach a file to this post... :confused: so here´s the code.

    /*	---Generic Action Script---
    Author: [EVO] Curry
    Slightly edited by: CptBBQ
    Function: Enables you to run any code directly from the addAction command
    Installation: Copy into your missions folder and call this file through addAction
    Example usage:  
    	In init of something
    	this addAction ["Say Hello World!","gen_action.sqf","player sideChat 'Hello World!';"];
    
    	Alternative Syntax with additional arugment passed
    	this addAction ["Say Hello World!","gen_action.sqf",["player sideChat format ['Hello %1', _this select 3];", "World"]];
    	Multiple arguments can be passed in an array and accessed with e.g. (_this select 3) select 1
    
    Notes: Recommended only for simple code or for testing scripts/functions designed for inits and triggers
    */
    
    //Parameter one: String or Code - Whatever commands you want to issue, remember to check the syntax ;)
    
    private ["_target","_caller","_ID","_code","_arguments"];
    _target = _this select 0;
    _caller = _this select 1;
    _ID = _this select 2;
    
    if (typeName (_this select 3) == "ARRAY") then
    {	
    _code = (_this select 3) select 0;	
    _arguments 	= (_this select 3) select 1;
    } else 
    {
    _code = _this select 3;
    _arguments = "";
    };
    
    switch (typeName _code) do {
    case "STRING": 	
    {
    	nul = [_target,_caller,_ID,_arguments] spawn (compile _code);
    };
    case "CODE":	
    {
    	nul = [_target,_caller,_ID,_arguments] spawn _code;
    };
    default			
    {
    	diag_log text "Error in gen_action.sqf: Invalid type passed to function.";
    };
    };

    Have fun!

    Cheers,

    bbq.


  10. Hey there!

    I´ve got a confession to make... ^^

    I came along with actually trying this just now :o

    And it totally doesn´t work like I hoped it would...

    Somehow the bombs always appear with enough of a delay to prevent them from colliding. I already tried creating the bombs in the sky and setPos-ing them to an 'invisible H' at the desired position. I even setPos´ed the second bomb to the position of the first one. But nothing worked...

    Maybe my computer is too slow for this approach... :(

    Could someone of a somewhat 'cleaner' way to do this?

    Thanks in advance!

    Cheers,

    CptBbq

×