Midnighters
-
Content Count
894 -
Joined
-
Last visited
-
Medals
Posts posted by Midnighters
-
-
[_var1,_var2] spawn { params["_var1","_var2"]; hintSilent format["This is VAR1: %1, This is VAR2: %2",_var1,_var2]; sleep 0.5; };
q note:
whenever using spawn you'll need to pass any variables to spawn before you can use them in that scope.
-
just to clarify:
"this" (without underscore) , is an editor only thing. So inside triggers, init boxes, etc it exists / is defined.
whenever you're making an SQF script you may see: _this , which will either be the parameters passed to the script, or depending on what you're using it may be a special variable for something.
- 1
-
-
-
Errors? Did the debug console return the event handler index properly? Did you execute locally?
-
player addEventHandler["FiredMan", { params["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_vehicle"]; _sphere = "Sign_Sphere10cm_F" createVehicle (getPosATL _projecitle); _sphere attachTo[_projectile,[0,0,0]]; }];
-
Yes, there is no confusion. Thanks for your feedback pierre
-
Just now, pierremgi said:better than what???
{ } forEach playableUnits; //etc
-
Just now, pierremgi said:Yes. Saying what you intend to obtain, "grabbing a player". allPlayers and isPlayer work fine on dedicated, but not player. Difficult?
Not in the slightest, I was just hoping for something better than that. It's already written so.
-
On 1/30/2018 at 1:24 AM, MKD3-FHI said:No, player is local to the client. You have to select them just like any other object.
Was curious if there was a more streamlined process.
-
On 1/30/2018 at 8:15 AM, pierremgi said:Really?
If you are using allPlayers , I can't imagine you're picking some AIs by the way. isPlayer is useless here.
Player will return the local player on client or hosted server (once game started locally, more exactly).
Remark: playableUnits is a false friend.
For MP usage, it returns the same as switchableUnits in SP, i.e. the red circled, checked as playable, units in 3den... IF you don't disable AIs in lobby. If AIs are disabled, playableUnits is just the same as allPlayers and should be named "playedUnits" in this case. This is important because in such case, variable name (and code in init field) of the unit is nil before JIP. If bob is a disabled AI in lobby, bob simply doesn't exist before JIP and any attempt to script with bob variable will return an error.
No I was never using allPlayers, just throwing an example. Thanks for your feedback though
-
10 hours ago, ZeD.oz said:I can't afford to jump on probalilities with this project, it's also a way to promote this game. I make it work properly or not at all... thank you for your input.
Great contribution, thank you. I can see clearly now, the rain is gone.
you're welcome,
I'm used to hearing Eric go on and on about this. That's particularly why I posted.
But, I do hope you end up with a solution indeed.
-
8 hours ago, -XFIRE- said:i am use for singleplayer mission
doesn't matter MP or SP. I'm not sure if they reset on respawn, but they definitely don't need to be updated in a loop. They stay the same after set.
-
6 hours ago, davidoss said:{ if(isPlayer _x) then { /*etc*/ }; } forEach allPlayers;
I guess I didn't put much thought into my example, but is there really not a cleaner way of doing so?
-
here we go again
-
1 minute ago, rekkless said:I don't want to be rude, but how can you call yourself a Milsim group and play with no Stamina??
Anyway an easy way is through MCC, you can turn Stamina off in MCC.
But I would advise to AT LEAST run a modified version of ACE Stamina even if it is set to the easiest, bambi setting.
They're more like casual milsim if even.
However, I don't think it's wise to recommend MCC for everything as it's kind of a mess after a while.
-
Hello all, I'm curious as to grab a player / unit's object from the server.
I want to refrain from doing:
{ if(_x == player) then { //etc }; } forEach allPlayers;
any good solutions to this?
-
54 minutes ago, -XFIRE- said:I put in init.sqf
[] spawn { while {true} do { player enableStamina false; player forceWalk false; player setCustomAimCoef 0.35; player setUnitRecoilCoefficient 0.75; uiSleep 6; }; };
why is this a loop? These are all setter commands and don't need to be updated more than once.
-
don't forget snakes and dogs.
-
On 1/23/2018 at 12:01 AM, fn_Quiksilver said:BIS has not had AI programmer in 5+ years. helis like ghosthawk and planes like armed blackfish have same 2011 vintage AI of forward-facing weapons
(in a few weeks we'll be able to say they havent had AI programmer in 6 years)
"Legacy Feature"
- 1
-
Just now, Schatten said:@Midnighters, you are right. But if _targetArray doesn't contain 3, nil is returned.
correct, just a hypothetical. I don't necessarily agree that just because it "works" means it should be used.
your example would be fine if something like an event handler is added and the same variable needs to be used within. Like "get/set" variable on player / server to retrieve the same info inside the event handler.
-
exitwith would exit the current scope with the value last returned correct?
so something like this:
{ if(_x == 3) exitWith { "target" }; } forEach _targetArray;
should return "target" right?
-
switch _location do { };
is just fine unless you are doing something like : _var * 2
in that case:
switch (_location * 2) do { };
-
Interesting solution, however I personally hate using the module init field, or any init field for that matter. Very hard to edit existing lines.
New Arma 3 server Looking for Devs and Editors
in ARMA 3 - MISSION EDITING & SCRIPTING
Posted
Wrong topic.