Aller au contenu

Photo

spawning a book *on* a table, not below it (solved)


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
LukaCrosszeria

LukaCrosszeria
  • Members
  • 1 304 messages
Hello everyone,

yet again I've got a question here that I couldn't find an immediate answer to :)

I've used a PRCSCR.gda to fire a script that spawns a creature and two placeables in a preexisting area, a table with a book on it. I opened a local copy of the .are file of the area and placed the book in, on a table, to get the position coordinates;

Orientation: 89.4871,0,0
Position: -39.9032,11.8223,0.815728

So in my script I use this to spawn the book: 

vector vLocation3 = Vector(-39.9032f, 11.8223f, 0.815728f);
CreateObject(OBJECT_TYPE_PLACEABLE, R"chantry_book.utp", Location(oArea, vLocation3, 89.4871f));

And the book spawns very nicely, *below* the table on the ground. It's like the z coordinate isn't being taken into account.

I fear the solution is going to be yet another bit of toolset arcana I'm unfamiliar with. :unsure:

Modifié par LukaCrosszeria, 12 janvier 2011 - 03:01 .


#2
Proleric

Proleric
  • Members
  • 2 352 messages
This seems to be a general issue with CreateObject.

Try this:

[dascript]
vector vLocation3 = Vector(-39.9032f, 11.8223f, 0.815728f);
location lLocation3 = Location(oArea, vLocation3, 89.4871f);
object oBook = CreateObject(OBJECT_TYPE_PLACEABLE, R"chantry_book.utp", lLocation3);

SetLocation(oBook, lLocation3);
[/dascript]

This works in a standalone module. I haven't tested it with PRCSCR, though.

#3
Proleric

Proleric
  • Members
  • 2 352 messages
I see this advice is already in the wiki (where SetPosition is recommended).

Modifié par Proleric1, 12 janvier 2011 - 09:06 .


#4
LukaCrosszeria

LukaCrosszeria
  • Members
  • 1 304 messages
Thanks for the reply. I used your code and it worked, the book is on the table, yay :P



I did check the wiki page on vector to see if there was anything about this problem but I didn't see that advice on SetPosition O_o. Thanks again for your help.

#5
Proleric

Proleric
  • Members
  • 2 352 messages
np. The wiki info was on the CreateObject page, as it turned out.

#6
LukaCrosszeria

LukaCrosszeria
  • Members
  • 1 304 messages
Sigh. The toolset is going to make a vein pop in my forehead one day. Soon.