Skip to content
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

[Feature/Improvement] change "str _unit" to netId #613

Open
blackfisch opened this issue Feb 15, 2020 · 8 comments
Open

[Feature/Improvement] change "str _unit" to netId #613

blackfisch opened this issue Feb 15, 2020 · 8 comments

Comments

@blackfisch
Copy link
Contributor

Requested Change

Currently, when units are involved something like str _unit or str player is added to the listbox. Instead, netId _unit should be used instead (object can be retrieved again via objectFromNetId "netId_here" and would be way better than call compile _str everytime

-> this is more just a reminder for myself than anything else so I don't forget :D Will do the PR when #611 and #612 are merged (to not fuck up everything)

@Azeh
Copy link

Azeh commented Feb 15, 2020

Can do missionNamespace getVariable _str instead of call compile _str.

@blackfisch
Copy link
Contributor Author

blackfisch commented Feb 15, 2020

not really. Doesn't even matter, its not intended to use the string representation of an object to store it and compile it back... That's what netId's are for :)

see here -> variable is not set:
20200215220948_1

@Azeh
Copy link

Azeh commented Feb 15, 2020

You were talking about listboxes and units.
Something like

private _unit = lbData [idc, lbCurSel idc];
missionNamespace getVariable _unit;

works the same way as

private _unit = lbData [idc, lbCurSel idc];
call compile _unit;

@blackfisch
Copy link
Contributor Author

The problem is with the contents. Like here most of the time in the framework the data set is something like str _unit -> that cannot be resolved to an object with missionNamespace getVariable (as shown in the screenshot above) but has to be done with call compile _str which is memory intensive and clutters the memory -> netId is the solution to this "problem"

@Azeh
Copy link

Azeh commented Feb 15, 2020

something like str _unit -> that cannot be resolved to an object with missionNamespace getVariable
It can.

@blackfisch
Copy link
Contributor Author

I tried it (see screenshot) and it didn't work. You can prove me otherwise of course, just add me some working code for proof

still. netId is the way to go. It is not intended use to str and object to refer to it.

@Azeh
Copy link

Azeh commented Feb 15, 2020

@blackfisch
Copy link
Contributor Author

This only works with named units as @DomT602 pointed out on the discord. This does not work with vehicles and such. Thats it :D
Problem is, this "method" is also used in vehicles lists (keychain etc) -> that would not work and cause problems. thats why I say netId :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants