I guess it must return a value for swaping mobs and 0 for doing nothing right??
|
Mar 9 2017, 11:23 am
|
|
Bump() is only called when trying to move into a dense atom. It returns the obstacle, aka whatever you're bumping into. From the DM reference:
|
Bump() doesn't return anything. The Obstacle is provided as an argument when called by the built-in movement behavior, but the proc returns null by default.
|
Bump() doesn't return anything, and by default, does nothing. If you want it to swap positions, then src must be a part of obstacle.group (as the reference says).
Edit: Too slow. |
Thank you all guys, hmmm so there isn't any way I can override the swapping behavior like turning it on and off??
EDIT: I mean besides the group list because I have like 800 mobs and sometimes I want the mobs at battle phase to not swap positions and on walk mode to swap but adding 800 mobs takes time... |
In response to Victorqr
|
|
Victorqr wrote:
Thank you all guys, hmmm so there isn't any way I can override the swapping behavior like turning it on and off?? Avoid the default behavior in those cases where you don't want swaps to happen. |
In response to Victorqr
|
|
Victorqr wrote:
Thank you all guys, hmmm so there isn't any way I can override the swapping behavior like turning it on and off?? mob Edit: Alternatively: mob |
In response to Victorqr
|
|
I suppose you could temporarily add the obstacle to the group before calling the default behavior, if you want them to swap.
For more control, you could override the mob's Cross() and/or Crossed() procs. If Cross returns true, whether it's by you returning true or the default behavior returning true, then the mobs overlap regardless of density, and Crossed() is called. If it returns false, then collision with Bump() occurs and the movement fails. |
Thanks again guys, I'll try the temporary add method
unfortunately the swap behavior does not occur in Bump :'( And also about the Cross idea I think Cross is not called at all because of byond pathfinding... I mean to test it mob/Soldier So I expected that my mob would pass through dense objects but pathfinding prevented it... Damn if only I could influence pathfinding with Cross... |
unfortunately the swap behavior does not occur in Bump :'( It does, but I may have found a bug that may explain what you are seeing. The swap only occurs in tile movement; when using pixel movement, the swap does not occur. The test code: mob |
Yeah you're right my bad I had step_size=16, but noticed that when I have step_size=16 and mobs are in same group a mob allows the other to pass through is that expected behavior??
|
In response to Victorqr
|
|
Victorqr wrote:
Yeah you're right my bad I had step_size=16, but noticed that when I have step_size=16 and mobs are in same group a mob allows the other to pass through is that expected behavior?? That doesn't work for me. Not sure what's going on here but it's all bad. |
Damn I just noticed my code was really messed up in some points that messed with my Cross proc thanks for your help guys :)
EDIT:Yeah its really bad :) |
In response to Victorqr
|
|
Actually, is your tile size 16? That's the only thing that comes to mind as to why we're seeing different results.
|