Development Forum |
|
|
the1whoscreams
|
10/3/2017 | |
So, I'm trying to do some more coding with my agent. Same one as the last topic I posted. I learned that TMVB exists and decided to use that. I think I know what's going on with this error I'm getting. TMVB is checking for a safe location for the "seed" form, not the "ungodly bio-machine that takes up way too much space" form. The seed detects a safe location, moves to that location, which is likely not a safe location for the machine, and then turns into said machine, putting itself in an invalid position and throwing an error. What should I do? The only fix I can think of is giving the seed the same bounding box as the machine, which defeats the purpose of it being easily portable. |
GimmeCat
|
10/3/2017 | |
Add a check to the seed's turning-into-machine function that does TMVB using the current coordinates. If the check fails, skip execution and delete the seed.
I'm assuming that if the user has clicked the seed in a bad place, the situation is already unsalvagable. Unless you want the seed to be pick-uppable after it's been clicked on? |
Zzzzoot
|
10/3/2017 | |
That is an interesting problem.
Perhaps create a huge dummy agent in a known-safe location and use the dummy agent to do the TMVTs.
So like, make an invisible (to players and creatures) agent in the meso or norn terrarium. Test if that agent can be moved to your desired location. Then move/transform your actual seed.
You'd have to use TMVT and also do more math. But I think it should work. |
GimmeCat
|
10/3/2017 | |
Another idea- check the seed's Move status with MOVS. If the seed isn't currently being carried or in vehicle (one of those must count for the inventory, surely?) then it can be clicked. Otherwise, no.
Edit: Piggybacking off Zzzzoot's idea, you could spawn the machine in an off-screen location and then do the TMVT test. If it fails, delete the machine and reset the seed's clicked state. |
the1whoscreams
|
10/3/2017 | |
I'll try that, Zzzzoot.
EDIT: It worked. |
|