Jump to content

_qor

Member
  • Content Count

    294
  • Joined

  • Last visited

  • Medals

Everything posted by _qor

  1. just define a trigger's condition in the editor and execute a script like the following. Trigger: Condition: attack OnAct: script = [] execVM "alarmScript.sqf" alarmScript.sqf [color="#FF0000"]alarmName1[/color] = createSoundSource ["Sound_Alarm2", [color="#0000FF"]markername[/color], [], 0]; [color="#FF0000"]alarmName2[/color] = createSoundSource ["Sound_Alarm2", [color="#0000FF"]markername[/color], [], 0]; [color="#FF0000"]alarmName3[/color] = createSoundSource ["Sound_Alarm2", [color="#0000FF"]markername[/color], [], 0]; waitUntil {!attack}; deletevehicle [color="#FF0000"]alarmName1[/color]; deletevehicle [color="#FF0000"]alarmName2[/color]; deletevehicle [color="#FF0000"]alarmName3[/color]; You also need to create markers and type their names in the script. Alarms are soudsources, so you will hear where they come from: Marker position = sound position. Cant really understand what you mean with your CODE RED stuff. But I guess you need three trigger's which fire individually for the different situations. Or perhaps you can use the switch command. Give more information and we could help you out ;)
  2. Aaaah for sure! When only MTVRs can fire the trigger, then only the MTVRs are in the trigger's list. ...thinking about it again, I first need to test this ;D And thanks a lot for the entities information ;)
  3. Hey there, I want to add an action to an MTVR when being in triggerlist. This MTVR is created by an respawn script so its name isnt fix or known. Besides, I want to add the action to every MTVR in list. So I am searching for sth like forEach class "MtvrReammo" list triggerABC or forEach type "MtvrReammo" list triggerABC. Or perhaps I can do this in script like _truck = class "MtvrReammo" list triggerABC ... Hope you guys can help me! Thanks in advance!
  4. Hey there, I never really worked with arrays, so I have got a simple question about it. There are 3 ammocrates and I want to fill them up all with the same weapon gear. So I tried to do this: _this = [box1, box2, box3]; _this addWeaponCargo... _this addMagazineCargo... But apparently this is not the way arrays work ;) I just want to avoid to paste _this select 1/2/3 to each ~50 lines. So is there a way to simplify this with an array, or do I have to achieve it with another code? Thanks for help!
  5. Thank you all! But although I will use survivorluz's code, I am still asking myself why this array doesnt work. I already read the array beginner's guide, but it doesnt answer my question. So when using _this = [box1, box2, box3], _this would contain box1, box2 and box3. Cant I pass on all this content to a code with one variable?
  6. Hey there, I have got some problem with my script which should evaluate which side currently occupies a checkpoint. Just like the battlefield checkpoints. __________________________________________________ __________________________________________________ Setup: HOME1trigger: fires when ANYBODY is inside and then executes the script. To have a control about start and stop of the script, I set the variable HOME1counter which the trigger sets to true before executing the script. script: Another two triggers fire, when HOME1ratioW reaches the value 10. Then, HOME1ratioW is reset to 0 and HOME1counter is set to false to stop the script. So there are 4 possible scenarios which are represented by the 4 if-statements: only west present only east present west AND east present AND west > east east AND west present AND east > west __________________________________________________ __________________________________________________ Problem So far, it works perfectly. Unfortunately there is one problem: when one side eliminates the units which occupied the checkpoint, their point counter doesnt act as expected. Sometimes 2 points are added, so the side takes the checkpoint too fast. Cant get out why this happens, I thought the greater while-loop was the reason, but deleting it showed it isnt... Curious is, that this problem only happens in this scenario! I am absolutely despairing of it because the longer I try to get the problem the more I think there is none ._. //at the moment I think the problem is that the script runs twice. but terminating the script stops the countSide check... >got it! I set the HOME1trig to repeatedly. So everytime it fires, another instance of the script is running so that the script may run fivefold... update is coming, improvements for the script are still welcomed :) Any suggestions to improve the script or the setup are still welcomed. Perhaps there is a quite different way to set up this scenario?
  7. Hey folks, I have got some troubles with a trigger which should fire each time ANYBODY is PRESENT. Scenario: enemy units within trigger area activated the trigger once. A group standing outside the trigger area now shoots the enemies and moves inside the trigger area. Unfortunately the trigger doesnt get activated when the group moves inside. I tried this scenario without my OnAct settings of the trigger and it works as it should. What might prevent the trigger from firing when new units move inside? Trigger (HOME1trig) takeover.sqf Trigger to cycle: There is an equivalent trigger for firing when HOME1ratioE == 10
  8. Got it! There are two MG Nests which I not imagined to be "ANYBODY" cause they are "empty" warfare buildings. So next question is how to delete them out of that trigger's calculation...
  9. Right! So when the units within the trigger area die, the trigger should be deactivated. When another unit which is outside the trigger area then enters the trigger area, the trigger should fire again. Anyway, this scenario works when I simply do it with a trigger and 2 units inside/outside. But not with this OnAct: hint "active"; HOME1counter = true; script = [] execVM "CHECKPOINTS\takeover.sqf". Cant see any other reasons. And dont even see this is a reason...
  10. Hey, To adapt the respawn to my conveniences, I created a trigger with conditions which executes this simple script: _x1 = group SBlogic createUnit ["US_Delta_Force_Assault_EP1", getMarkerPos "respawn_SB", [], 0, "NONE"]; _x1 setDir 245; addSwitchableUnit _x1; removeAllWeapons _x1; disableUserInput true; sleep 20; disableUserInput false; playSound "CodeBad"; So via team switch I can switch to that spawned unit. Unfortunately there came up some disadvantages from this method: First of all, I cant set a delay because once the "end" screen pops up, the menu doesnt seem to update. So I cant choose "team switch". Therefore I used disableUserInput but menu points like "restart" and "end" are disabled as well. But biggest problem is: after switching to the spawned unit, there are no actions at all. Cant switch weapons, cant get in vehicles, no open door action... So I guess there must be another respawn method :D Guess there is no way to have a condition for that using the description.ext respawn, is it? I would welcome to write a simple script on my own. How do you guys set this up?
  11. Hey, I want to add an action for each vehicle which is in the list of a trigger. So I would use this code: {_x addAction ["LOAD VEHICLE","Support\constructions.sqf","ConStru",1,false,false,"","((_target distance _this) <6)"]} forEach vehicles thislist Unfortunately this is not possible. But I dont know what might be wrong with "forEach vehicles thislist". In other cases I already noticed that referring to vehicles in triggers is kinda impossible. Hope you can help out! Thanks in advance!
  12. After some modifying it works for me with nearestObjects. There is no oval area but I guess this is satisfying. Perhaps creating more triggers will do this... Gonna try bis_fnc_inTrigger. Guess its helpful for other scenarios! Thanks a lot F2k Sel!
  13. Alright I will try this out!!! nearestObjects may be a solution, but I need to have an ellipse not a radius. And a certain angle of that area. It is really frustrating that I just cant use the trigger area I already created in the editor by using forEach vehicles thislist ! So those are all workarounds which doesnt work the way I want it. Is there really no way to refer to the list of vehicles inside a trigger?
  14. Yah but how would I create this list? It should be a variable list so I cant just add names. And I still dont get how to list every vehicle which is in a trigger ._.
  15. It stopped working? Had this problem with a script yesterday^^ So even if its not working anymore, how did it work? Perhaps it does in ArmA 2 ;D What do "A", "LIST" and "OF" contain?
  16. Unfortunately this also adds the action to all vehicles and units ._. I just want to have a trigger area which adds an action to only all vehicles inside when certain conditions are true. And of course it should delete this action when the conditions are false. So how to choose only vehicles in the list of a trigger? Shouldn't this work with list ?
  17. Hey, I have got a problem with GUARD waypoints. It seems that this waypoint sometimes causes units to act strangely - or at least I dont get the reason. E.g. groups run in any direction through the whole map, perhaps pursuing enemies, but I cant find those. But using GUARD waypoints offers the advantage that groups either have a higher awareness or a connection to other groups under attack. So they will defend their area by getting information about enemies from near friendly groups. After doing so, I would like to have them to stop GUARD. In the editor this works with a SWITCH trigger. But how would I do this with scripted triggers/waypoints? Creating a SWITCH trigger by script requires to sync it with the waypoint. Dont know how to do that. Thanks for your help ;) EDIT: okay sorry I found a code for that. I have been misled by another post saying there is no way to do that... _trigger synchronizeTrigger [_waypoint];
  18. Ya thats it panther! But strangely, this problem doesnt occur every time. And it also occurred when I was not part of the team. So a SWITCH trigger may help in some scenarios...
  19. To make my intentions clear: I want to create a marker at each position a vehicle has been damaged so it !canMove. Even empty vehicles! So the trigger should fire each time any vehicle which is kind of "LAND" cant move. How would I code this? Is there no way to just check vehicle thislist?
  20. Hey, I am not sure if I very miss something but I really cant get out how to manage that! Lets say my condition is _x isKindOf "LAND". I want the trigger to fire each time a vehicle of this kind is in its list. Even if there already is such a vehicle. So I cant use count thislist > 0 and in thislist doesnt work as well. Really, how is this possible? 0o thanks in advance, I really must have missed something
  21. You cannot switch from the guard waypoint to the next waypoint and then back to the guard waypoint. Switching only cancels the guard waypoint and units will move the their next given waypoint if they have. You need to create a new guard waypoint to have them guard again. Your question is how to write the code in a script? triggername synchronizeTrigger [waypointname]; The trigger can be created in the editor or by script, you just have to give it a time. I dont know how to give a waypoint a name by editor, so I only use scripted waypoints. Remember that the trigger you synchronize to a waypoint must be a SWITCH trigger. Besides, you have to set it to a condition that makes it triggering when the GUARD waypoint should get switched.
  22. You are right! My problem was that groups often act strange with GUARD waypoints. Because the GUARD waypoint doesnt end automatically (as MOVE waypoints do when reached), you can use a SWITCH trigger to make the group move to the next waypoint. For example: supporting infantry which have a GUARD waypoint, you can make them cancel that support when enemies are gone. Of course this very depends on your scenario! You can do this in the editor by synchronizing a trigger with the GUARD waypoint, or by script using the code I already posted. The GUARD waypoint is still kinda mystery to me because it seems units do not act always the same. In this case, I only send them to a marker which just didnt exist -.-
  23. Hey, I noticed that AI pursuits enemies for unlimited distance and time. Only if the enemy died, AI will switch back to AWARE and will return to given waypoints. Did somebody notice the same? For my mission this is a really disturbing problem. So I want to disable this by creating a trigger which makes groups to not target anything or anybody. This would work best by fire the trigger when the enemy is in a certain distance. I also tried to make the group doWatch and doTarget objNull. But this doesnt change anything for their behaviour. Thanks for your help ;)
  24. Hey there, this is for a pickup script: I cant find out how to stop the heli on its way. The heli has a MOVE waypoint. To cancel the pickup or to give new coordinates, I want to stop the heli in air. doStop, commandStop or stop true are all useless codes so far. The heli stops with commandStop, but I cant make it go on flying afterwards. I expect the other codes to work if the heli has received a move command, but not with waypoints. Even deleting the waypoint doesnt work. Would be great if you can help me ;)
  25. There are some patrols with a about 6 MOVE waypoints and a Cycle one. When I call a heli which then flies back to base, the AI runs after it through the map. I observed them one time until they almost reached the heli. After some "tweaking" it seems that the AI only stays in COMBAT mode indefinitely without running after the heli. At the moment it seems to be fixed by waypoint modes. But I really dont know what made them pursuing the heli through the whole map 0o
×