I have an idea for a mod, it requires to store a double variable for each metal planet, and then add an new UI element in a unit. Is that possible by now? and where should I start if I want to do that?
You can only store data on each individual client, or on your own server. UI elements are possible, small ones might be added to the existing UI, a new panel would be required for anything involved.
But would it be possible to make a mod where at the start of the game, it loop through the planets, and store their names/id as the array key, and the variable inside the array is the number. Then the unit that stands on the planet could with the UI element display that number. Ofc I'm thinking of a mod that needs to be on the server, since it will effect game play.
That's kind of where I thought it was going - having the same variable across players is a might bit difficult just now. I haven't dealt with planets much, so I don't know how well informed the UI is about which planet a unit is on.
If that's the case, I could probably take the x, y, and z coordinates of the selected unit, and calculate which planets it is nearest. The only problem with that is if there is two planets very close to each other. But I haven't seen that in a game yet. Another problem is that I have no idea where to begin, or what language it's coded in. I have been programming for 7 years, but mostly in php and java, since those two languages is the ones I find easiest.
It's Javascript with the Knockout library. Totally unlike PHP or anything you have ever done in Java. Weak typed language, event oriented call structure. UI ist HTML with all the benefits from CSS3, bound as a model to Knockout.
That's good news, I have worked with javascript. Mostly with manipulating html dom objects, and ajax calls/request.
No need to advise, it's impossible. But I think the UI knows what planet the player currently looks at. Though via hotkeys it is possible to select units on other planets as well.
Depends on what exactly you want to do. Sometimes there are funny workaround. That's what modding is all about
When a location is reported, it's usually in a format suitable for passing to the camera api to look at, which includes the planet. What I'm unsure about is whether such a location can be had for any unit of interest, or only for alerts.
Only alerts. At least last time I checked there was no way to record all unit positions at all times. ... that possibility will put me in a hard position, having PA Stats record that all would be fun, but ... lots of data xD