New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add custom entries to interaction menu #244
Comments
I think the best way is to let the missionmaker define their actions inside |
I agree. |
Very nice! But, commy, does it work? I though CfgVehicles was outright ignored in description.ext |
Your custom actions are not inside CfgVehicles. They are in an own class inside descriptions.ext. |
The code is looking for custom actions as: _config = missionConfigFile >> "CfgVehicles" >> typeOf _object >> "AGM_Actions"; So inside CfgVehicles! I haven't test it yet, but as I think it shouldn't work. |
Oh sorry, you are right. I am going to test it later. |
Please test it. The path can be changed if it doesn't work, but I don't know why it would fail. It's not that I'm actually updating the "CfgVehicles" config file but rather the mission config file, which is why adding this was necessary in the first place. |
Ok, I'll try to test it latter today. I've tried to introduce new config entries under cfgvehicles in description.ext before without sucess, but I've never tried reading them the way you did it, so maybe it behaves differently. |
Obviously normal config entries won't work since the mission config != addon config, but these are accessed via missionConfigFile, which is completely different. |
I hope you are right! I'll test it in a couple of hours and report back. |
Just using If you would want to make that possible, you'd have to go through all parents of a vehicle class, checking them all individually. |
Aren't you confusing this with 'isKindOf' ? 'typeOf' returns a String and config entries are strings in sqf. |
Yes, but look at robin's example:
Nothing you add to "Car" would ever get used. A Hunter for example would return "B_MRAP_01_F" for |
So you would have to recreate the whole inheritance tree for every unit. Thats stupid. I might have to rewrite this, so it checks in the missionConfig file for all the base classes,,, |
Commy, if you have to refactor the code one more time (and I think you will!), I'll add another related use case for you to consider. Would it be difficult to allow the mission maker to specify certain interaction with a particular object instead of a class of objects? E.g. interact with a certain computer to "Extract Criptography" or something. But... Thinking about it now I realize that maybe it could be done without changing anything in AGM by applying the interaction to the class but restricting the activation condition to a particular object; could a better way be coded in AGM? |
Restricting the condition to a specific vehicle should be sufficient. |
Done. Still needs testing. class CfgVehicles { // Another option to toggle earbuds //Opfor can't use earbuds for some reason *Note: The mission config file doesn't need class inheritance for this. |
Another way instead of looping through all parents is to loop through all entries in AGM_Actions and check configName with isKindOf. |
Oh this looks totally interesting for my mission :) |
This could maybe even more interesting to you: #360 |
It would be a nice feature to be able to add entries to the AGM interaction menu as a missionmaker.
Unfortunately we cannot edit the CfgVehicles class in the description.ext file.
The text was updated successfully, but these errors were encountered: