|
Development Forum |
 |
| Valid Map Positions for Moving Agents? | |
| 
Malkin
     Manager

|
5/31/2014 | |
When running some balloon bugs in my DS standalone world, I get the error:
Runtime error in agent 2 13 9 script 2 13 9 9 unique id 4564180
ATTR/PERM change caused invalid map position (0.000000)
... ov91 0 setv ov00 1 {@}perm 100 accg 3 doif ov12 lt 0 ...
The portion of the code that seems to be bugging is this portion:
**if flying
doif ov00 eq 0
addv ov91 1
* go to on ground mode
doif ov91 ge rand 30 50
setv ov91 0
setv ov00 1
perm 100
accg 3
doif ov12 lt 0
pose 0
else
pose 4
endi
stop
endi |
So the bug becomes denser and falls to the ground, but the ground doesn't exist???? Is that the meaning of this error? I know how to check a future location with TMVT, but how do you make gravity safe?
My TCR Norns |
 Code Monkey
evolnemesis
    
|
5/31/2014 | |
hmm that's odd... what looks like is really happening is that it's moving through some semi-permeable floor/wall, like a wood platform, or an elevator shaft floor (something that would allow it to move through or past it when it's flying), but then it becomes solid inside of it, like a creature is, and so it suddenly should not be able to pass through it.
It looks like the actual density/acceleration due to gravity change isn't doing it, it's the change to that permeability property which was letting them move through whatever room edge/floor/wall they are passing through, which seems to suddenly become illegal for them to be inside of. So they are still inside the room system, just inside something that's supposed to be solid. I wonder if adding a MVSF POSX POSY before that line might help.
"For small creatures such as we, the vastness is bearable only through love."
"We are a way for the cosmos to know itself." - Carl Sagan |
 Peppery One
Papriko
    
|
5/31/2014 | |
Not quite sure if that would work. When I recall right, MVSF searches "safe" locations based on the PERM of an agent. So the new PERM already had to be applied to make this work.
Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis... |
 Code Monkey
evolnemesis
    
|
5/31/2014 | |
Hmm
OK, so then looks like you'd need a
INST before that line.
then a MVSF POSX POSY after that line.
* go to on ground mode
doif ov91 ge rand 30 50
setv ov91 0
setv ov00 1
* do not allow interruption, state may be unsafe
inst
perm 100
* permeabiity changed, move to closest safe position
mvsf posx posy
accg 3
doif ov12 lt 0
pose 0
else
pose 4
endi
stop
|
This *should* work, since the CAOS documentation says about INST: "This can be important for certain tasks which might leave an agent in an undefined (and dangerous) state if interrupted.", and once the new permeability is set, MVSF should be able to find it a safe spot.
"For small creatures such as we, the vastness is bearable only through love."
"We are a way for the cosmos to know itself." - Carl Sagan |

Malkin
     Manager

|
5/31/2014 | |
Where would we put the SLOW to undo the INST, just after the accg 3? Do we have to perform this function instantaneously, or can we use LOCK instead?
My TCR Norns |
 Code Monkey
evolnemesis
    
|
5/31/2014 | |
The STOP right there would undo it pretty promptly afterwards, because the script ends there right after their new pose is set. Really the instant bit of code would just be the part that changes their properties... Most install scripts are instant while setting those properties in the first place, probably for similar reasons, but if you are worried about it, you should be able to put a SLOW right after the MVSF.
I think in this case INST is better than LOCK, since we want to get them to a safe spot before their position gets checked by anything else, and preferably have things trying to interact with the agent as little as possible during the time when they are in an unsafe spot. LOCK may stop things from interrupting that script, and stop other scripts in that agent from being called, but could still potentially leave the agent in an unsafe position for much longer while other agents run things like their collision detection scripts, giving them a chance to check the position and see that it is bad, potentially throwing errors.
"For small creatures such as we, the vastness is bearable only through love."
"We are a way for the cosmos to know itself." - Carl Sagan |

Malkin
     Manager

|
1/24/2015 | |
Trying MVSF seems to result in another error:
Runtime error in agent 2 13 9 (Balloon bug) script 2 13 9 9 unique id 304369
MVSF only works on autonomous agents
... v00 1 inst perm 100 {@}mvsf posx posy slow accg 3 doi ...
My TCR Norns |
|