UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

GetEntArray ordering [updated]

broken avatar :(
Created 9 years ago
by Centric
0 Members and 1 Guest are viewing this topic.
2,574 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 2 April 2014
Last active: 2 years ago
Posts
481
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
If it's not perfect, you'll never see it.
Signature
Learn by doing, not copy and pasting.

Enjoy my 2015 contest map, a simple map with bo1-bo2 features
http://ugx-mods.com/forum/index.php?topic=14968.msg149200#
×
Centric's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Centric's Contact & Social Linkscentricccentric_
How does GetEntArray decide the order the items are put into the array? I need it to be a specific order and id rather not do it all manually.
Last Edit: October 22, 2015, 02:58:34 am by Centric
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Pretty sure the order in your map file - typically from the first entity that you added with that targetname to the last unless you delete one.

But in what scenario would you need to know the order?

Edit: if you delete one then it just moves down the array's index.

First enttiy in an array is always index 0, unless of course the array doesn't have anything in it.
Last Edit: October 21, 2015, 10:16:11 pm by daedra descent
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 2 April 2014
Last active: 2 years ago
Posts
481
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
If it's not perfect, you'll never see it.
×
Centric's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Centric's Contact & Social Linkscentricccentric_
Pretty sure the order in your map file - typically from the first entity that you added with that targetname to the last unless you delete one.

But in what scenario would you need to know the order?

Edit: if you delete one then it just moves down the array's index.

First enttiy in an array is always index 0, unless of course the array doesn't have anything in it.

It's for my Easter egg, there's probably a better way to do it but this works too. Thanks.

Double Post Merge: October 22, 2015, 02:57:58 am
Update: Redid trigs in the order I wanted by recreating them all, did not work In the order they were placed.
Last Edit: October 22, 2015, 02:58:15 am by Centric
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
My preferred name is "xSanchez78".
Check me out here: www.steamcommunity.com/id/xSanchez78
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
It's for my Easter egg, there's probably a better way to do it but this works too. Thanks.

Double Post Merge: October 22, 2015, 02:57:58 am
Update: Redid trigs in the order I wanted by recreating them all, did not work In the order they were placed.

Making it work this way is what I call 'lucky' if you can make it work. I just suggest not to do it this way and use a better way. I am pretty sure there would be a better way to do this. Like if you need and order, just define a script noteworthy on each one that will set the order and order them like that in script. If u need help, I guess pm me.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 1 year ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Signature
Hey if you had tons of fun on playing my maps please DONATE :)

play ESTATE now, and claim your mansion back from the undead!
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
jei9363's Contact & Social Linksjei9363jei9363jayingardia
when order mattered I did something like this.. this was to collect origins in order.




Code Snippet
Plaintext
 
        stop = false;
current_node = ziplines[0]; //first entity
level.zipline_origins_1[level.zipline_origins_1.size] = ziplines[0].origin; //first info from entity
while(!stop)
{
next_node = getEnt(current_node.target,"targetname"); //get the next target
if(isDefined(next_node))
{
     level.zipline_origins_1[level.zipline_origins_1.size] = next_node.origin + (0,0,-70);
     current_node = next_node;
     level.cleanup[level.cleanup.size] = current_node; //to delete enititys after
}
else
stop = true;
}
Last Edit: October 22, 2015, 09:59:06 pm by jei9363
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
How does GetEntArray decide the order the items are put into the array? I need it to be a specific order and id rather not do it all manually.
GetEntArray doesn't control the order.
g_entities and numGEntities (a global variable) do so. Though I can't tell their ordering method since they go through intricate proccesses.
Best option is to grab the entity and check their script_noteworthy though.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
If you can make them the target of each other, then you can start with the first one and just keep adding to the array. This requires two kvps.

Code Snippet
Plaintext
myarray = [];
ent = getent("startent","targetname");//or other kvp
myarray[myarray.size] = ent;
while(isDefined(ent.target)){//or other kvp
ent = getent(ent.target,"targetname");//or other kvp
myarray[myarray.size] = ent;
}
Make your first targetname and then make each one in order the target of the previous one. You could use script_string, noteworthy, or whatever you would like if you can't use targetname, to depict the order they are added to the array.


You could make the kvps in order, targetname = 0, or any kvp you chose, maybe, and then in script get the string(i), meaning turn 0 into a string, and then continue the loop


There also seems to be an alphabetize function in utility, I've never tried, if you fill your array, and you define some kvp in the alphabetical order that you would like them to be in maybe, but would take some modification to the script, to get the kvp.
Last Edit: October 23, 2015, 01:50:15 am by MakeCents
Marked as best answer by Centric 9 years ago
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 2 April 2014
Last active: 2 years ago
Posts
481
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
If it's not perfect, you'll never see it.
×
Centric's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Centric's Contact & Social Linkscentricccentric_
Thanks for all the help, I just took a video of activating all of them and moved them around to be correct. (That was before I noticed the replies) thanks though, this might come in handy later.


Who's answer should I mark as Best though I don't really think I should just mark mine :P
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Thanks for all the help, I just took a video of activating all of them and moved them around to be correct. (That was before I noticed the replies) thanks though, this might come in handy later.


Who's answer should I mark as Best though I don't really think I should just mark mine :P
problem with that is, if you change something later itll all go out of order again

 
Loading ...