Psi

Psi

45M Downloads

Entity List Seems to be random

quicktinker opened this issue · 2 comments

commented

Version Information

Forge version:35.1.37
Psi version:1.16-91

Further Information

Link to crash log: (please use a paste site such as gist, do not attach the .txt or paste the log inline)
Steps to reproduce:

  1. First step: Created a spell that adds me and other players nearby to a list
  2. Second step: concatenate the two lists
  3. Third step: reading out the combined list shows the entities in an unexpected or incorrect order

What I expected to happen:
When I used Add to list or Concatenate list I expected it to add entities in the order the lists were in previously
What happened instead:
The entity list positions were randomized or sorted into an alphabetical order of some sort instead of retaining their individual list orders.

I have attached an example image of the readout from a similar code below where [1] is the combined list. Note that the caster is in the middle of that list despite being added to a list of nearby players. this should have added the player to the start or the end of the list, not the middle.

Code being expermented with below;
{modsRequired:[{modVersion:"1.16-91",modName:"psi"}],spellName:"Regeneration",uuidMost:-1089086145862087781L,validSpell:1b,spellList:[{data:{key:"psi:selector_sneak_status"},x:2,y:3},{data:{params:{_number2:2,_number3:0,_number1:1},key:"psi:operator_subtract"},x:2,y:4},{data:{key:"psi:constant_number",constantValue:"1"},x:2,y:5},{data:{params:{_target:2},key:"psi:operator_entity_position"},x:2,y:6},{data:{key:"psi:selector_caster"},x:2,y:7},{data:{key:"psi:constant_number",constantValue:"5"},x:3,y:3},{data:{params:{_target:3},key:"psi:operator_absolute"},x:3,y:4},{data:{key:"psi:selector_caster"},x:3,y:5},{data:{params:{_ray:2,_max:0,_position:3},key:"psi:operator_vector_raycast"},x:3,y:6},{data:{params:{_target:3},key:"psi:operator_entity_look"},x:3,y:7},{data:{params:{_power:4,_time:3,_target:2},key:"psi:trick_regeneration"},x:4,y:3},{data:{params:{_list:2,_number:3},key:"psi:operator_list_index"},x:4,y:4},{data:{params:{_list:2,_target:3},key:"psi:operator_list_add"},x:4,y:5},{data:{params:{_position:3,_radius:2},key:"psi:selector_nearby_players"},x:4,y:6},{data:{key:"psi:constant_number",constantValue:"3"},x:4,y:7},{data:{key:"psi:constant_number",constantValue:"2"},x:5,y:3},{data:{params:{_power:2,_time:1,_target:3},key:"psi:trick_resistance"},x:5,y:4},{data:{key:"psi:constant_number",constantValue:"1"},x:5,y:5}],uuidLeast:-9221320899705922436L}

image

commented

It hasn't been properly documented (sorry about that, it'll happen Soon™), but Entity "List" is a bit of a misnomer.
Lists don't actually stay in order when you merge them; it is only guaranteed that the same list of Entities keeps the same ordering for that list of Entities. When making a new list, all bets are off.

commented

Pinned for now until the behavior gets properly documented