-
Posts
9666 -
Joined
-
Last visited
-
Days Won
11
Content Type
Profiles
Forums
Events
Everything posted by Grimes
-
No. The env.X tables are just a copy of a few files located within the miz file. You could edit the copy by adding triggers, units, or whatever and the serialize the files and re-insert into the miz so that on the next load the changes are reflected. I've done that a few times to fix or change entries outside of the editor in bulk.
-
I think it is the unique situation that a dead object is being spawned. It has a spawning event, but it can't get data about the object because it is dead, therefore an error. It is a little weird because the mist DB will populate the DB entries for statics set as dead in the mission file, but everything it knows about that is from the miz and not derived from other functions at runtime.
-
I will have to check it out. That error is from the database update scripts. Simply put the mist.DBs.X won't be updated with that object. You can get me the table that you passed to coalition.addStaticObject that generated the error would be most helpful. Assuming you have lfs and io commented out in missionScripting.lua, this line will write a table to a file in your dcs/logs folder. mist.debug.writeData (mist.utils.serialize,{'static', whateverTablePassedToAddStaticObject}, 'dbUpdateERror.lua') Or if you have other means of getting a serialized version of the table passed to the function.
-
Mist runs in the mission scripting env, not the export env. There are individual functions or functionality that you could probably cut and paste, or at least lightly modify, to work in the export env. But natively it would not run because it relies heavily upon functions from the mission env.
-
I'd just want it so I can remove anti-ship missiles from ships because the ROE settings are inadequate and AI will waste the things.
-
Nope. Gist of it is to use https://wiki.hoggitworld.com/view/DCS_event_shooting_start event to start calling https://wiki.hoggitworld.com/view/DCS_func_searchObjects on a point around the aircraft and every few milliseconds searching for weapons. You add any missing shells to a table. Use https://wiki.hoggitworld.com/view/DCS_event_shooting_end to stop the check for world.searchObjects. Meanwhile you have another function that runs however often you want checking, updating the position, and removing shells as they cease to exist.
-
How does the editor deal with short life objects (missiles, bombs etc)
Grimes replied to Squiggs's topic in Mission Editor
There are some samples on the wiki, but they are typically pretty short and limited to the specific scope of that function. Can always search this forum, there are plenty of questions that have been asked and answered here. Or make a new thread asking specifics. -
How does the editor deal with short life objects (missiles, bombs etc)
Grimes replied to Squiggs's topic in Mission Editor
Scripting is the primary way of interacting with weapons. Most often via the shot event to get the weapon object, then its up to you to decide what you want to do with that object. A few training scripts check the distance of the missile to its target and then remove the missile by calling an Object.destroy on it. On the Grayflag servers I use land.getIP on information from weapons to determine where a bomb or missile precisely impacted a runway section. Unfortunately you can't create a weapon in air. The AI or a player has to launch the weapon from something. Then its up to whatever the guidance of that weapon to hit whatever it is targeting. -
Getting the object from its ID
Grimes replied to Pizzicato's topic in Scripting Tips, Tricks & Issues
Fixed the example page I copied that from on the wiki. -
The problem with explosions is it isn't confined to the object you want to destroy. There are more options for units than you do scenery objects. You can use Unit.getbyName():destroy() to remove specific units. If you want you can spawn in dead statics at the same time. You can also go about it backwards where the group is set to probability 0% and then use a script to spawn in the group as needed. You check the saveState, see which units are alive, populate the group with those units while ignoring the ones that are dead, and spawn in the group via scripting.
-
Getting the object from its ID
Grimes replied to Pizzicato's topic in Scripting Tips, Tricks & Issues
It doesn't get updated. The association with the trigger zone and the object ends the moment the zone gets created. I've seen a few instances where the object that I created trigger zones over has been moved slightly or outright deleted. -
Getting the object from its ID
Grimes replied to Pizzicato's topic in Scripting Tips, Tricks & Issues
If you know the object id and it is a valid object, then you can access it directly by mimicking the object table. For instance: local obj = { ["_id"] = 13777728,} if Object.isExist(obj) then env.info(Object.getTypeName(obj)) end If I recall it isn't treated 100% the same as if you got the object from an event. It hasn't actually inherited any of the functions, so obj:getTypeName() would error while Object.getTypeName(obj) is fine. If its a unit you could use getName and then pass that value to Unit.getByName() to make it a full on object. A word of warning about map object ids. The id will change if the map gets updated and will now represent some other object or nothing at all. It would be wise to rely on checking the coordinate and object type to verify it is indeed the object you want. Obviously varies a bit on whether or not a map will likely get updates. You'd probably be fine to rely on the id number on older maps like NTTR while steering clear of that method on Kola. -
That is some coordinate system that was used in a campaign and isn't an option to display it on the map view.
-
Warehouse - getInventory is not getting all items
Grimes replied to DJK's topic in Scripting Tips, Tricks & Issues
Known bug with gun pods and maybe a few other weird object types. -
Nope. Once AI get into "airbase mode" they will rely solely on built in game logic to determine their formation and flight behavior. In the case of departures if the AI are set as take-off from runway they will take-off in pairs. If they ramp start they will taxi to the runway in flight order and take off in singles. For landings they will arrive at the base in whichever formation is set then enter a landing pattern. They will land in pairs as long as the runway is wide enough, though there are circumstances where then 2nd unit in formation might fail at getting into formation, at which point they will break off and land on their own.
-
Most of the entries can exist within assorted lua name spaces. For example coalition.side and coalition.service are just two tables within coalition that contain the enums that identify red and blue, and enums for ATC, tankers, etc. In this specific instance the enum values can literally be found in the AI.Option.Air.val.REACTION_ON_THREAT table. As you made note that the names aren't the same and AAA fire evade is missing. The former is mostly a localization thing. The name doesn't matter because the number value is what is used by the AI. ED have decided to reword/rephrase assorted parts of the mission editor, but the functionality remains the same. Also note it is "reaction on threat" in the enum but is named "reaction to threat" in the editor, the same thing is happening there. As for why AAA fire evade is missing from the table, the sad fact is that not everything gets added to the AI or other tables when it exists in the game. Thus someone has to realize that the options exist and document it.
-
https://www.khanacademy.org/math/linear-algebra/vectors-and-spaces might help. Its been 20 years since I've done any math related to this stuff. I just find code that seems to work and constantly re-use it.
-
No action or event. It just checks every second if a specific bomb type is in that specific zone. If the zone is to small it might not get detected due to timing.
-
mist.respawnGroup scripts not working on ground units?
Grimes replied to Arktos's topic in Scripting Tips, Tricks & Issues
Yes that is me. -
mist.respawnGroup scripts not working on ground units?
Grimes replied to Arktos's topic in Scripting Tips, Tricks & Issues
The old bug of Group.getByName returning dead groups is back in addition to isExist() also returning true on the dead group. I updated mist to adjust for this bug. -
Unable to Reuse Parking Space for Second Aircraft
Grimes replied to edwardsjethro's topic in Mission Editor
It is limitation programmed into the mission editor that doesn't reflect how the game actually handles things. There is no great way around it. You can use the scripting engine to spawn an infinite number of aircraft throughout the mission runtime, but that is a little complex for some. However it gives you control of specifying to re-use a specific parking spot or to rely on the automatic assignment. If it is a multiplayer mission you can use "takeoff from runway" which, when the mission is run in MP, will place the units at the nearest parking spot to the runway. -
Lua Pattern for Lua Gurrus...
Grimes replied to CougarFFW04's topic in Scripting Tips, Tricks & Issues
Patterns are not something I find to be all that fun. I assume you are wanting to use it as a command of sorts where a player enters it via chat or F10 mark and it uses the inputs to call a function? I use this to get each word added to a table, then I use the table itself to manipulate or check the data. commands[1] is the command being issued and commands[2] could be an optional value, if it doesn't exist then use some default value. local commands = {} for w in string.gmatch(event.text, "%w+") do table.insert(commands, w) end I suppose you could make a pattern for each of the 3 cases and use if string.match(obj, pattern1) or string.match(obj, pattern2) or string.match(obj, pattern3) then print("good") end