I would need a script to make a npc occasionally stop walking, look left and right and walking again every x frames, like the shyguys in Yoshi Island. Maybe even make the npc change direction after the stop. Is that possible?
| ||
You can use the variable NPC(id).facing to set the direction this NPC is facing, and NPC(id).Xsp and NPC(id).Ysp to set its horizontal and vertical speed.
You can try the following : letting him walk a few steps, set its horizontal and vertical speed to 0, toggle its facing direction between left and right a few times, then send him in the direction he's facing, and repeat this process. (I can't make the script for the moment because I'm transferring my SMBX data to my new hard drive, I'll try to script that asap) | ||
Thanks. I appreciate your help.
| ||
I'm currently running into an issue :/
I've tried the following code: Code: Select all with npc(sysval(param1))I'm setting the value of variables via events. I've put call sleep(1) statements where they are needed but the game still freezes ![]() | ||
Can you share your test level, just for looking at the script and testing it myself if freeze or not?
| ||
| ||
Umm, yes, the shyguy just don't walk when attaching the script and the editor freeze. I guess the problem is the fact he's not even walking to begin but I really don't know enough about scripting to know what is making the npc act like this.
| ||
| ||
Who is online (over the past 5 minutes)Users browsing this forum: 1 guest | ||