[SOLVED] model rotation in object definition

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
Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

[SOLVED] model rotation in object definition

Post by Granamir »

Hi everyone,
trying to make an object with an alcove, but unfortunatelly my model is turned 180° around Y (vertical) axis respect "surface" and "clickable" components.
So i tried to rotate the whole model in blender, to rotate whole model but node, to rotate node with GMT with no results (except occluder is fucked up and game crash if i use it...i'll fix it later).
So i'm wondering if there is a way to rotate model in object definition.
Anyone can help?
TY
Last edited by Granamir on Mon May 25, 2015 7:40 pm, edited 1 time in total.
User avatar
AdrTru
Posts: 223
Joined: Sat Jan 19, 2013 10:10 pm
Location: Trutnov, Czech Republic

Re: model rotation in object definition

Post by AdrTru »

Try to take object with socket instead of surface.
Socket component have rotation vector.
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: model rotation in object definition

Post by minmay »

every component you mentioned supports the "rotation" field (you can also rotate them dynamically with Component:setRotationAngles())
AdrTru wrote:Try to take object with socket instead of surface.
Socket component have rotation vector.
that's pointless; SurfaceComponent supports rotation too!
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

Re: model rotation in object definition

Post by Granamir »

TY, btw i don't know how to rotate them in object definition, i just do know how to rotate via in game script but i prefer to make a good object and after rotate it if i need.

Till now i solved partially my problem using altar surface (with "maxDistance") instead alcove, but i stil have problems with surface in lower elevation than object ( offset = vec(0, -x, 0) ); everything seems fine (copied definition from the one with surface above object elevation) except it doesn't take items.
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: model rotation in object definition

Post by minmay »

rotation = vec(x,y,z)

Code: Select all

{
  class = "Surface",
  rotation = vec(7,90,-6),
}
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

Re: model rotation in object definition

Post by Granamir »

lol, so easy...don't know why i didn't try...
TY
Post Reply