Jump to content

number3

Members
  • Posts

    269
  • Joined

  • Last visited

Everything posted by number3

  1. Edit script. Switch to DCS, update the trigger that includes the script, save and run the mission. Once the mission is loaded run through the mission or sequence and see if it blows up. Exit the mission back to the mission editor. Start over again. The steps don't sound so bad but it takes a surprising amount of time. Since not all errors cause a fatal error. I'm not sure if this can be done but if there was a way to just quickly refresh/restart the game to execute from the very beginning again, that would cut down on the times for the mission to start and exit.
  2. I too am working on a mission that requires the knowledge of whether a static object has been destroyed or not. My guess would have been Does this command alone not return anything? How about trying the following below?
  3. Well I am telling you from trying myself min the mission editor, BTRs will get destroyed from armed bunker fire if hit from the sides or rear. I am not saying whether it is realistic or not however. If the BRT-80 is vastly up-armoured in DCS then you will be pleasantly surprised if you ever try it for yourself.
  4. If I remember correctly armed bunkers and outposts have the same caliber of fire. In my mission BTRs can withstand that calibre of fire if taken from the front. But they start to take damage when taken from the side and rear and will dire white quickly.
  5. I've been playing around with activating and deactivating units. After activating a unit I assign it a task and then deactivate it after 5 minutes. But usually by the 1st or 2nd deactivate occurs I get an error message and DCS crashes 00095.320 ALERT WORLDGENERAL: AI::Controller exception: No state creator for task "AttackGroup" and controller "wcColumn" Here is is basically what I have and where I've been able to isolate where the problem might be. However I'm not sure what the problem is exactly. Anyone come across this error before and know what might be the cause? :helpsmilie: function activate_untis(...) ... local defender_group = Group.getByName(defender_group_table[zone_index]) trigger.action.activateGroup(defender_group) local attacker_group = Group.getByName(attack_group_table[zone_index]) trigger.action.activateGroup(attacker_group) -- Set infantry to be immortal local controller = attacker_group:getController() set_immortal = { id = 'SetImmortal', params = { value = true } } Controller.setCommand(controller, set_immortal) -- Set target of attacking group if (nil ~= defender_group or nil ~= defender_group.id) then attack_group_task = { id = 'AttackGroup', params = { groupId = defender_group.id } } Controller.pushTask(controller, attack_group_task) end ..... scheduleaaaspotting = mist.scheduleFunction(deactivate_group, {attacker_group}, timer.getTime() + 300, 300) end function deactivate_group(group_obj) mist.removeFunction(scheduleaaaspotting ); if (nil ~= group_obj) then local controller = group_obj:getController() Controller.resetTask(controller) trigger.action.deactivateGroup(group_obj) end end
  6. Thanks. I remember reading that in one of the scripting engine pages now that you mention it.
  7. I'm not certain as I've never tried it. When I started with lua I steered clear of it because of my lack of knowledge of the syntax. Interesting... I could be wrong. The way I understand mist.scheduleFunction in 3.2 is that it adds the function call to a Tasks table and increments the task id. So repetitive calls, to the same function, to scheduleFunction will add multiple tasks to call the same function. I don't see any code in that function that checks if the Task table already has a duplicate function name scheduled.
  8. That's correct. Basically anyone how joins after the respawn occurs, will see a message saying that they destroyed a building. While the host sees a message that they destroyed the actual unit. I haven't tested this with 1.2.7 however. My workaround was to create a group for every possible zone where units could appear. Set each of those groups to late activation in the ME. Then in my script if the event it triggered I activate the unit using trigger.action.activateGroup(Group group).
  9. That was straight forward. But I don't see any mention of Unit.getName in part 1 or 2 of the scripting engine pages http://wiki.hoggit.us/view/Simulator_Scripting_Engine_Documentation.
  10. You don't want to have mist.scheduledFunction call a function inside of the function it originates from. Stepping through you code, the first call to incrUserFlagFromOneToN will schedule incrUserFlagFromOneToN to be called every second (or whatever the default interval is) because you aren't passing a "number rep" argument. One second goes by and incrUserFlagFromOneToN is called again, but mist.scheduledFunction is called a second time. So now you have two scheduled functions running in your script. Two seconds goes by and incrUserFlagFromOneToN is called again, but you have another mist.scheduledFunction called a 3rd time. So now you have three scheduled functions calling the same function. It will go on and on. In the end your values will increment like crazy and it's not what it seems you want. Also, you have intSecs -- cycle time in seconds, but you have mist.scheduleFunction(incrUserFlagFromOneToN, {...}, timer.getTime() + intSecs), which begin the initial call to the function intSecs from the current time. It will not call the function every intSecs mist.scheduleFunction(incrUserFlagFromOneToN, {...}, <time to start calling the function>, <how many seconds to wait before calling the function again>, <how many seconds after the start time to stop calling the function>) This should work for you local uFlagNum = 30 -- flag number local uFlagMaxVal = 3 -- the maximum value, n local intSecs = 30 -- cycle time in seconds local blnCycle = true -- cycle the flag back to 1 if true local function incrUserFlagFromOneToN(uFlagNum, uFlagMaxVal, blnCycle) local flag_value = trigger.misc.getUserFlag(uFlagNum) flag_value = flag_value + 1 if (flag_value == uFlagMaxVal and bInCycel == true) then flag_value = 1 end trigger.action.setUserFlag(uFlagNum, flag_value) end mist.scheduleFunction(incrUserFlagFromOneToN, {uFlagNum, uFlagMaxVal, blnCycle}, timer.getTime(), intSecs)
  11. I hear ya, it took me quite some time to come to grips with the syntax basics. I too use a different language (PHP) at work. But the end result of making a DCS mission is rewarding of all the pain. Enjoy!
  12. Is there a way to retrieve the names of units within a group? And do unit names have to be unique across groups? Example: if I have 2 groups of 2 units. Can both groups have units with the names 'Unit truck' and 'Unit AAA'?
  13. Because the prototype for scheduleFunction accepts a table of variables to pass as arguments into the function. See http://wiki.hoggit.us/view/ScheduleFunction.
  14. Also consider the fact that you were able to take damage, fly back to base and land. Being able to bring back the plane and yourself in one piece is quite a bit of survivability.
  15. number3

    Mortars...

    Is the resupply instantaneous or takes a few minutes to complete?
  16. number3

    Mortars...

    Or just run the mission as SP and use time compression. If something needs to happen before the mortars start, then add a debug script to your code to initiate it via a radio menu call.
  17. For video Mission 15, the video is set to private. Enjoying the videos by the way. :thumbup:
  18. If you get a chance attach a track so we can see.
  19. Does this still apply to the current version of DCS world? I was looking at mission script and a table is used to keep track of which group had the command menu options added. But it doesn't look like the this use case is handled: What happens when that person leaves and another person joins in their place? I'm guessing you'll need another scheduled function to check if the group exists and if not to remove them from the table of clients.
  20. You could just spawn static aircraft in parking spots where client aircraft won't spawn, to make the airport busy. Instead of replacing/destroying the static aircraft just before the client aircraft spawns. I can't help directly but can point you in some direction http://wiki.hoggit.us/view/Part_1#coalition and http://wiki.hoggit.us/view/Part_2#Object might give you some ideas.
  21. A good thing that you mentioned that. It will save me the headache of finding that out the hard way..
  22. I can't check right now, but I would have sworn I saw the clone group action available for the ME. If not then it would require some scripting I might be able to take a look at what you've got so far.
  23. Realized that you could also set your parent infantry group to invisible so that the AI won't target them (they are still visible during the mission through). Depending on how long you want the fire fight to go on for, you may want to place an ammo truck nearby and set it to invisible as well. And have a condition saying when the A-10s destroy the truck to stop cloning the parent infantry group.
  24. Infantry engagement can be quite annoying to setup right. For me infantry is good if you place them close enough to your ambush site that they engage the target, but not too close so that it looks like they are standing right beside friendlies. The engagement zone displayed in the ME is deceiving because infantry doesn't always engage. However I find that RPG infantry are quite good. Also bare in mind that infantry will only fire at something it can hurt. Not sure what vehicles you are using, but if you want infantry to fire keep it to a lightly armoured vehicles (APC, Jeeps, trucks though trucks will die quickly). I have had some rough times getting ROE advanced tasks to work, especially with infantry. If I were you I spawn the infantry close enough to the vehicles to begin shooting right away. If you make infantry run towards a target, I find they often kneel if they see a target but don't fire or move. To create a lasting fire fight, experiment by creating a parent infantry unit; place them behind a building so that they won't get killed by the vehicles but close to the ambush zone. Setup a trigger to clone the infantry unit into the ambush zones, every 10 seconds (use a continuous trigger and set TIME MORE conditions). The goal here is to create a fire fight that lasts long enough for your players to respond to. Betting that your A-10s cause some collateral damage in the area, setup another trigger that checks if your parent infantry group is at half strength or dead. If either one of those conditions is met, then set a flag to stop the respawning of units and let the reaming cloned units parish.
  25. You could use http://wiki.hoggit.us/view/Units_in_zones to check if a unit/group is in the zone, passing a unit table (see the MIST PDF for creating a unit table). You can get the latest version of http://wiki.hoggit.us/view/Mission_Scripting_Tools_Documentation which had a PDF. Look at the "UnitNameTables" section
×
×
  • Create New...