setRotationAngles : no vector accepted ?

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

setRotationAngles : no vector accepted ?

Post by Doridion »

Hi all,

I'm trying to implement rotationAngles in the socket class ... but ... seems needing (x,y,z). I tried some tricks, but always crashing the editor.

rotationAngles = (1,1,1), -------------- NOK
rotationAngles = vec(1,1,1), ---------- NOK
rotationAngles = math.deg(1,1,1), --- NOK
rotationAngles = rot(1,1,1), ----------- NOK
rotationAngles = rad(1,1,1), ----------- Ah ... NOK ....

Antti, petri ? Some trick ? Thanks in advance ;)
User avatar
Prozail
Posts: 158
Joined: Mon Oct 27, 2014 3:36 pm

Re: setRotationAngles : no vector accepted ?

Post by Prozail »

ScriptReference is wrong...

try
rotation = vec(15,15,15),
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: setRotationAngles : no vector accepted ?

Post by NutJob »

Hey Doridion, open up the original campaign and take a look how the developers did this, plus a whole lot more. First thing I looked up, in the beach area, was how they got those three daggers to appear to be stuck into the tree trunk (just in front of the broken hull).
User avatar
Prozail
Posts: 158
Joined: Mon Oct 27, 2014 3:36 pm

Re: setRotationAngles : no vector accepted ?

Post by Prozail »

mm but setWorldRotationAnglesWithOrder is for GameObjects not components.
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: setRotationAngles : no vector accepted ?

Post by Doridion »

Prozail wrote:ScriptReference is wrong...

try rotation = vec(15,15,15),
Excellent, works fine ! Thanks Prozail ^^ Didn't thought to just use "rotation" as property ;)
NutJob wrote:Hey Doridion, open up the original campaign and take a look how the developers did this, plus a whole lot more. First thing I looked up, in the beach area, was how they got those three daggers to appear to be stuck into the tree trunk (just in front of the broken hull).
Thanks NutJob, already done and as Prozail answered, WorldRotation is for GameObjects scripting, here i'm defining my object ( hardcoding), and my problem was to add x,y,z vectors.

Thanks to both of you ;)
Post Reply