Jump to content

Ramsen II

Member
  • Content Count

    17
  • Joined

  • Last visited

  • Medals

Everything posted by Ramsen II

  1. an addaction with a custom keymap perhaps? 1. goto controls and custom controls and select 'User 1', and add a spare key (I use '?' for example) 2. create below script named whatever.sqf and activate it in init (execvm whatever.sqf) 3. in game you press '?' button. is this what you need?
  2. i need a high command group icon color to change permanently when in combat? the below script does it but only for the duration of the 'foreach' script (i.e 0.5 seconds) so the color flashes on then off but i need it to be permanent? p.s the a = 1 bit is for a simple trigger switch that plays a bleep every time a group is under attack, that is also the reason for the two 0.5 sleeps that allow time for the bleep to play. any help appreciated.
  3. Firstly I do not understand the need for the "unchanged" and "no change" when scripting waypoints? What are they for? whats the difference between: and.... whats the difference? 2nd question: How do i cycle the next element in an array each time i use, for example, add action "click"? _array [one,two,three]; player addaction ["click" { ????}]; So when i activate action "click" first time it hints "one", then when i activate it a second time it says "two" and so on. ForEach does not seem to be the answer as it does all three at once every time i activate "click". I need the array to cycle every time i select click? The "click" is an example what i want is to cycle camera channels on one TV, see code below the "camera select" part, at the moment i have to set each camera using a variable as a switch... Any help appreciated. thx ;)
  4. Nice 1 larrow, especially the static effect didn't even know you could do that + never heard of procedural textures!? looks like a proper script now + strange actually, how its evolved compared to my early version! cheers everyone.
  5. yeah i worked out it was for debugging when i accidentally used case 0, case 1, etc for the units!! so i changed it to case unit1, case unit2. anyhow thx again for your help! has been just one long scripting lesson for me tonight! lol cheers.
  6. Hi all. This is a simple version of my sector update script. This version uses markers as sectors, another version changes (hides / un-hides) flags based on ownership. AT moment I would need to copy the code for EVERY sector... pointless, so i want to add all sectors (markers or flags for the flag version) to an array and then update them via the below script. The script works fine with single referenced sectors and updates every 5 seconds or so if aaf are only in the sector it changes green, blue for nato and red lines for contested. Also notifies me of sector updates. So onto the script please i need help with the highlighted text. Type Array expected string. I cannot find way of using for each reference each sector (Marker) in the array with distance to the marker referenced in the unit count code. Please help, so close but cannot complete.
  7. of course! i was looking under foreachindex page but never saw that one under foreach. cheers ;)
  8. o.k thx to rebel suggestion - here is my final final camera switching script for you all to enjoy!! ;D
  9. thx for suggestion. I cannot seem to get the addaction working with the switch code in there? where do i put the switch code and how does it know which mode / unit im on (sorry im unfamiliar with 'switch' and 'case') cheers. p.s Also you put the wrong bracket end of format text! ;-) should be a ] p.p.s what is the default and hint bit for also?? No worries got it working. ;) missed a bracket.
  10. success. thx too all for helping, but grumpy + larrow script works perfectly i knew it had something to do with PushBack but i couldn't figure it out. Anyway here's the finished working script: works a treat. ;)
  11. haha lots of discussion over my below par scripting!! ;D I should have been clearer. I made the mistake putting team1, team2 ect in quotations they are each referring to the leader of the group, confusing i know i should have named them unit1, unit2 etc because i am referring to units. What i am doing is creating a shoulder cam on the first unit (and it shows up on a screen named tv5) when i select the addaction - 'Change Camera' command. But i want to cycle between teams, going unit1, unit2, unit3 then back to unit1 every-time i select 'Change Camera'. (In my case they are named team1, team2, team3 so the array will be named: _units = [team1,team2,team3]; The long explanation: At the moment i have it working where i create the script three times using a makeshift switch using variable (b = 0 to begin with) So when i select the first cam - {if b = 0 then (code creates cam on first unit) ... end the code with b = b + 1. (so now b = 1) so next time i change camera (if b = 1 then it destroys the old camera and creates new cam on the second unit. Same for third but here i reset the switch ( if b = 2 then b = 0 again so next time i change camera im back on team 1 bla bla bla bla.... ) this works fine but i don't learn anything i know there's an advanced but more efficient way of doing this. p.s also i do same for vision mode (therm = 0) i have 'Cam Mode' where i can switch between night vis, thermal and normal visions of the units camera that i am watching. Works well and is actually really fun when playing as High Command and you can watch your teams on screen. Also i add a custom 'static' texture to tv5 if the unit in question dies. Anyhow I will test out all ur suggestions later on. I did look up pushBack and Select + more on arrays but it's still a little advanced for me. but i will get there. Thx again for all you help ;)
  12. thx for helping again rebel. I think you have got it but i am not sure how to implement it in my script. ive highlighted in bold the areas so you get an idea what i'm looking for. I get a type 'string expected object error' at the moment, but i think we are close! any advice how to fix ? cheers again.
  13. Thx guys, for now i used rebels method which practically still requires me to type in all sector names, but i learned from it + it will also be useful for other scripts. i couldn't get HazJ method to work, not sure how to use the _foreachindex, properly always get 'undefined variable' when using it. i need an example of how to use it properly, using my sector script as an example
  14. thx rebel. That was exactly the problem and that is exactly the solution i was looking for. ;) i have 35 odd sectors i had to put into the array, is there someway i can cheat without typing all of them in and by doing something like: thx for the help;) p.s for the eagle eyes - yes i do know "a1_29" and "a_34" are missing ;-)
  15. I need help with the below script. Problem: I read a post as far back as 2007 where units that enter combat mode and then get stuck in 'Aware' mode for the rest of mission (apart from combat / stealth of course). This issue is still present on A3. Once 'All Clear' is declared and my group goes back to safe mode, it actualy remains in AWARE mode, guns raised, looking for enemys.... i hate this when not leading a group and ai leads my group. Aware never ends. I tried expriements with three simple radio triggers setting my group to 'COMBAT' 'SAFE' or 'CARELESS' Selecting combat, safe, combat, safe still made the group stay in aware while safe mode was active, so switching on / off did not work. However, forcing mode to CARELESS allowed my units to start walking normally, patrol style, guns down etc. Objective: I am trying to create a script that creates the illusion of safe mode, but is actually CARELESS untill either: a) enemys are in eye sight b) knowsabout value is above zero (unreliable but a back up check) c) my ai led group is surpressed by enemy gunfire d) a bullet is detected close to the player. e) enemy count is also above zero within _radius. But without giving away to the player ai led group. The below script actually works o.k to a degree, no major performance lag despite it checking 8 times a second (for bullets). but i need help, you will only need to browse the script to see why. bascially i need: All members of my group to check eyepos with all enemy units. _enemies = allUnits select {_x distance player < _radius AND side _x in _enemySides}; then testing count = count UNITS _enemies; flags up an array error, but _enemies = allunits (of the side east) so why this error? or should i say HOW do i select each unit of this unit and check its eyepos with all units in my group. Also I want the script run less times a second but of course to 'catch a passing bullet' check i need it running often, but any better ideas welcome. cheers. guys. p.s thx to several members of this forum for bits of the above script, as its very cut and paste.... some of its mine honestly! lol.
  16. Nice one, had to be another way round, will try this. thx. ;)
×