Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

RPG in a Box

Bring your stories and ideas to life! · By Justin Arnold

[0.3.7.5] Rotate Entity Towards error

A topic by lectronice created Jan 11, 2017 Views: 117 Replies: 2
Viewing posts 1 to 3

Hi!

I'm currently setting up a scene in rather unusal way where the player is inside a chest with a NPC. The map is the chest itself, with a closed lid. The NPC is on one tile and the player is on the other one. The starting script of the map plays a one-frame animation (more a pose, actually) for the NPC to set her up as kneeled. Everything works fine, but I'd like to rotate the NPC a bit, because she's facing the player in a logical yet frontal, not very "readable" way. So I created a dummy tile out of the chest, gave it an ID, and scripted the NPC to rotate forward this dummy tile. The scripts looks like this:

play_animation(entity["c_qunobe"], "kneeled");
rotate_entity_towards(entity["c_qunobe"], entity["dummy_01"], false)

And this is where I get an ever looping error I believe I had already reported (though the ending was a bit different, if I remember well):

    At: res://npc.gd:17
    SCRIPT ERROR: process: Invalid type in function 'slerp' in base 'Quat'. Cannot convert argument 1 from Nil to Quat.

In the other case, it happened randomly from time to time during my complex introduction dialogue, without major issues. But here, it happens all the time, and the NPC doesn't rotate at all. I used the same trick for A Road to Awe's starting screen except it was with Look At Target Over Time, aiming at a hidden tile behind the title, and it worked fine. Here, it seems Rotate Entity Towards has an issue (unless my trick is a bit too dirty to work as intended lol).

(1 edit)

Hello! Thanks so much for this information. I was able to write a similar script in my example game and recreate the exact looping error. That should definitely help in tracking down the issue. I'll let you know once I have a fix!

UPDATE: Good news, I have a fix for this now! When determining the entity's rotation, I was incorrectly assuming that the target entity was a character, as opposed to a tile or object. I'll include this in my next release, which should be in the next day or two. :)

Excellent, thanks for looking into this :)