Jump to content
Sergadra

Getting the unique ID for a unit from mission.sqm(EDEN entity id) in a Mission

Recommended Posts

Hello at all who will read this at first,

 

I am currently working on something called DCFDB a Dynamic campaign Framework for Arma 3.

To keep things clear i will write some things about it.

First of all there is no released Version right now so it is not avialble yet.

The Target of it is to have a Dynamic Zeus Campaign with a saving function and other little extras for administrating the campaign. To achive this i am writting an Database in combination with extDB3. This Database should store the most if not all placable and doable things aswell as states.

I started at some point to play Milsim Missions with Zeus and thought that it is somewhat sad that there is nothing really to safe the progress. Better said i am targeting a normal Arma 3 campaign as Zeus Campaign with the use of the Creativity from Community of Arma 3.

 

Well with that said now i get to my problem:

I am working right now to make it possible to use the Editor for the campaign that you aren't Limited to only Zeus. So i wanted to use the ID of the Mission.sqm to check if it is a Editor Object and later maybe call it by that or assign paralell a Id from the Database.

 

ArpQL.jpg

The id of Item 59 ("I_Truck_02_box_F") would be the 409.

 

Right now with the Knowledge i have i can get this variable by using:

https://community.bistudio.com/wiki/get3DENEntityID

But this is limited to the Eden Editor right now. I ask myself is there a way to get this exact Value in the mission while the Object "I_Truck_02_box_F" is selected with as an example: cursorobject.

 

I already thought of another sollution of this by first calling all placed objects and extracting the ID in the middle of following:

13b57c080# 1675124: truck_02_box_f.p3d

by using

_editorID = str _vehicle splitstring ": " select 1;

this gives me the 1675124 of the whole thing.

I thought this number would be my solution but then i got informed that those numbers can change because of terrain modification like one tree more or less. So i can't use that.

 

Now is the Question is there any other solution to get this ID or something which is also unique and won't change?

Just as information NetID changes.

 

Another thing i tried is to include the MissionSQM in the description.ext and work the parts out:

 

class MissionSQM
{
    #include "mission.sqm"
};

 

and call it through:


getNumber (missionConfigFile >> "MissionSQM" >> "version");  [this is not the path just as information this is just an example]

 

but there is another problem i can't order the ITEM Class to the object if there is variable itself which it does not need everytime.

 

class Attributes
                    {
                        name="beta_4";

                    }

 

Without the name Attribut i can't order it corectly to the unit. Position is a bad option since those can change.

 

The funny thing is i can call the object mentioned before with this script so this is why i tried the splitstring Part:

[0,0,0] nearestObject 1675124;

 

So i am with my knowledge at the End and wanted to ask if someone knows a command for declaring an unique ID which won't change and are passed on from the Editor.

I searched the Internet up and down asked question in the Arma 3 scripting Discord channel.

I think also you were able once to read out the 1675124 id with a command but this was discontinued due to the terrain change problems. Now the editor objects get their own ids which was once wanted but this can't be used in the Mission.

 

I am at the point where i don't know what to do now. Maybe some of you has some answers. Would be glad.

Share this post


Link to post
Share on other sites
7 hours ago, Sergadra said:

Position is a bad option since those can change

Maybe not if you do it immediately in a postInit script behind a loading screen. Mission sqm position will always be where it was placed in the editor (unless of course someone changes entities within the editor after the mission has already been played and the database saved, although you could check EditorData nextID and Camera position and void the database save if different).

Include mission.sqm into class in description.ext as you mention above. Strip out [ name, ID, positon ] of each object. If it does not have a name find the closest to the position (remember its ASL in [ x, z, y ] from sqm and that getPosASL will be not be exact but should be good enough if within a centimetre or so). Then give each object a variable of its ID ( _object setVariable [ "EntityID" , ID ]; ). Once this script has finished then if needed update the entities status from your database by querying their ID variable.

Should be pretty quick at postInit behind a loading screen but would need experimenting with.

 

That's about the only way I can think of without providing an addon that saves each entities ID as a code attribute when placed in Eden, that would automatically set the entities variable on mission initialisation. Depends on what your frame work is? script only based or does it have an addon component to it.

Share this post


Link to post
Share on other sites
43 minutes ago, Larrow said:

 (unless of course someone changes entities within the editor after the mission has already been played and the database saved, although you could check EditorData nextID and Camera position and void the database save if different).


This is sadly something that i expect. I can relate to the position but the DB will keep the old one if the editor one is changed.

 

43 minutes ago, Larrow said:

That's about the only way I can think of without providing an addon that saves each entities ID as a code attribute when placed in Eden, that would automatically set the entities variable on mission initialisation. Depends on what your frame work is? script only based or does it have an addon component to it.

 

The Gamemode in this case was planned to only be script based with the need of extDB3 which is an add-on. Since i momentarly can't write my own add-ons i mostly planned it script based. The sad part about it i have to do it alone at the moment i hope this will change at some point. I started with nothing but i now have already most of the inserts and gets so i learn and search. It seems be inevatable to learn C++ so i started it today. It will take time but it would be able to help in the future and was also a Target for me.

I would have nothing against a Add-On with some tasks that else would not be doable so yeah i am open for that.

Share this post


Link to post
Share on other sites

I don't understand why you need to bother with the Eden IDs at all. Do you not care about ingame/Zeus spawned entities?

 

Seems like you just want save/load functionality? Either you are:

 

- Starting fresh mission: On mission start synchronize (assign) ids with all mission objects

- Loading mission: Delete everything present in the mission (that you would normally assign IDs) and recreate from database info instead. Minor things that have to be handled differently is for instance playable units which you do not delete.

 

Then regardless of above, synchronize any future ingame changes, either continually, or some custom save action/button (if you trust the server won't crash) for potential future load.

Share this post


Link to post
Share on other sites
19 minutes ago, Muzzleflash said:

Then regardless of above, synchronize any future ingame changes, either continually, or some custom save action/button (if you trust the server won't crash) for potential future load.


I already have a save button so yeah i thought of that :D

 

19 minutes ago, Muzzleflash said:

I don't understand why you need to bother with the Eden IDs at all. Do you not care about ingame/Zeus spawned entities?

 

Seems like you just want save/load functionality?

 

Well i want to use some editing / scripting in the editor for special events. I know that Ares / Achilles are capabel of doing that too but for reasons i would like to do it in eden itself.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×