Jump to content

NecorB

Member
  • Content Count

    6
  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

About NecorB

  • Rank
    Rookie
  1. I want to (be able) to add the "TALK" waypoint(type) in a function. But how do i reach the 'effects'(voice for example) tab in the way point through a script? Do I have to figure out the syntax my self from? https://community.bistudio.com/wiki/Eden_Editor:_Waypoint Have done my best to search for a solution but all 'hits' so far I have already seen and read. [_group, 1] setWaypointType "TALK"; This setWaypointType "TALK" requires by definition on: https://community.bistudio.com/wiki/Waypoint_types to be "[is] used in combination with the Effects button". But how do I script the Effects button? Many thx
  2. Problem found (since a while back): In ArmaEdit I (since I have had a break from scripting and forgot) created "new script" from button, not drop down list. This (by my? default setting) created a .sqs, which I happily (and unknowingly to consequences) renamed to .sqf. And so yeah...BAD move! Strange behavior on executed code. Now scripting works as intended because I create a .sqf. (I did notice there was a problem since comment syntax // did not work but ; did. But the 'Aha' moment happened when going through https://forums.bistudio.com/topic/145056-arma-3-scripting-tutorial-for-noobs/):) (very good) Thx all.
  3. Yes. I must have looked at that example page 50 times by now (plus many other, inc your (if it really is you) array tutorials. Examples takes time for a noob to interpret though. I knew the nearestLocations returned Array of Locations, just took until just now for the penny to drop as to what that meant and how to use it. I also found this working. _nearbyLocations = (nearestLocations [position player, ["NameMarine"], 500]) select 0; // Nearest location of type to position (player). RETURN: (Class?)Array of location(s) _locName = text _nearbyLocations; // Not mine, just don't remember where I found it _locPos = position _nearbyLocations; // Not mine, just don't remember where I found it _locType = type _nearbyLocations; // Not mine, just don't remember where I found it Which does the exact same your code does, only yours look better. For now I will go with my example because it's somewhat easier to follow (for the untrained eye) but later I will clean it up. Now I have what I need though (for now :) ). Next is learning the switch i guess. Many thanks.
  4. From what code of the above did you get coords [x,y]? _pos = getArray (configfile >> "CfgWorlds" >> "Altis" >> "Names" >> "TonosBay" >> "position"); // Manual test. Not very useful... Outputs: [x,y] (that I can use for setPos for example) _nearbyLocations = nearestLocations [position player, ["NameMarine"], 500]; Outputs (for me at least): [Location NameMarine At 11988, 22986] (but I can't figure out how to use it. I can see the numbers of the location but not access them. Any attempts of select element either gives me the same output or gives error Config entry expected.) _loc = (nearestLocations [ position player, ["Airport","NameLocal","NameVillage","NameCity","NameCityCapital","NameMarine"],20000]) select 0; Outputs: [Location NameMarine At 11988, 22986] (Same as above (because their is only one element?)). First example is not very dynamic...would have liked to be able to use the position in [x,y] and type from nearestLocation (that I can hint on screen but not use) for scripting but don't see what I'm missing. Edit; Sometimes the easy obstacles are the hardest. A simple getPos on _nearbyLocations (or _loc) did the trick. I guess I never tried it before because the output from nearestLocations looked so weird. But all is now good.
  5. Great stuff *****(stars). I had a blast reading and follow it through. And I learned that I really am a noob :). I eventually found my way to this guide because I had some stupid behavior from scripting in Arma3, things that I normally did not have problems or errors with. And I could not for the world understand what/ where the fault was. And since I have had a break I figured - back to basics. Turns out - if you use ArmaEdit and create a new file from button (not list) that default file in my case was .sqs ,which I happily renamed to .sqf (->BAD!<-). So parts of the syntax and code worked, and parts did not (I had some weird results and errors). Imagine now when code works again :). Just can't believe how thorough this guide really is that the author (gonna call you Dave) even managed to cover that part (indirectly even). Last thing. I can't download 2nd chapter (1st and 3rd link worked). Anyone?
  6. I can confirm the frustration from author. Following code exec both statements nBuilding = nearestBuilding position player; listRoadObjects = (position nBuilding) nearRoads 50; ; This line is abundant countRoadObjects = count listRoadobjects; if (countRoadObjects == 0) then { hint "No roads!"; } else { [] spawn {sleep 5; hint format ["%1", countRoadObjects]}; }; OUTPUT IS: (hint) No roads! 5 sec (hint) 7 Original "if then else" is (with my changes) a copy paste from https://community.bistudio.com/wiki/Control_Structures Is this outdated as to Arma3? Also, this code ls simplified from what I originally did for debug purposes (that's why the above looks a bit weird). I have tried everything I can think of. Still no alternative execution of code. Can't the condition check for Boolean value? !alive works. But (variable < x) does not. Why? Are both not Boolean?
×