Trooper Dan, on 30 September 2018 - 03:18 PM, said:
I think some people get caught up on the convenience of the vending machine and never learn how to cook. If you are making a mod that has non-trivial coded features, you should learn how to cook.
Hey, you talking to me? I'm a professional chef and glasses of water are my speciality.
Trooper Dan, on 29 September 2018 - 06:59 AM, said:
As for why it's not working when you set posx and posy, it could be because you aren't setting the sector but I think it's more likely something else which is blocking your attempt. The first thing I would check is make sure that Lezing's bike code is not setting the player's coords at that point, since it could be overriding your attempt. Also, you should verify 100% that you have calculated the new coordinates correctly. You can do a visual confirmation by espawning a sprite there and setting it to those coordinates; do so in F7 view mode so that you can see it in game and verify it is in the right place.
Thank you for your help. You were right, I was changing the player's position and sector correctly, but below there were some lines interfering with the operation. However, I found a problem when changing
posx and
posy: the player can be moved through invisible blocking walls.
But I found another way to do it: spawning two invisible sprites when the player exits the car and moving one to the left and the other to the right. If one of them hits a wall, I delete it, and then I set the player position to one of those sprites, preferably to the left unless the sprite was deleted.