customize jitter

This commit is contained in:
gnembon committed 2020-11-18 16:16:09 -04:00
1 parent 8c29db6c5d
commit f40e797e3e
1 file changed
+8 -3
@@ -532,6 +532,8 @@ global_entity_anchors = {
'player' -> 'xyz' 'player' -> 'xyz'
}; };
global_jitter = {'experience_orb'};
__handle_entity(e) -> __handle_entity(e) ->
( (
entity_type = e ~ 'type'; entity_type = e ~ 'type';
@@ -551,11 +553,14 @@ __handle_entity(e) ->
if (labels_to_add, if (labels_to_add,
base_height = 0; base_height = 0;
snap = global_entity_anchors:(e~'type') || 'dxydz'; etype = e~'type';
eid = e~'id'; eid = e~'id';
offset = ([(eid % 7)/7,(eid % 13)/13, (eid % 23)/23]-0.5)/2; snap = global_entity_anchors:etype || 'dxydz';
base_pos = if(snap == 'xyz', [0, e~'height'+0.3, 0], [0.5, e~'height'+0.3, 0.5]); base_pos = if(snap == 'xyz', [0, e~'height'+0.3, 0], [0.5, e~'height'+0.3, 0.5]);
//base_pos = base_pos+offset; if (has(global_jitter:etype),
offset = ([(eid % 7)/7,(eid % 13)/13, (eid % 23)/23]-0.5)/2;
base_pos = base_pos+offset;
);
for (labels_to_add, for (labels_to_add,
if (length(_) == 2, if (length(_) == 2,
[label, text] = _; [label, text] = _;