AMIA ARCHIVE
https://amiaworld.net/phpBB3/

About PLC Group Spawners
https://amiaworld.net/phpBB3/viewtopic.php?f=2&t=76399
Page 1 of 1

Author:  Terra_777 [ Mon, Mar 31 2014, 7:10 AM ]
Post subject:  About PLC Group Spawners

I'm not sure if it was intentional or not but as many of you know the PLC spawners has always been locked into one angle. Decided that was lame so next time you spawn your group you'll notice the angle between you and the point which you targeted with the spawner is now applied as rotation. As in the group will face you with the same angle as which they where recorded in.

So now you might be thinking; oh boy, now I can't get my stuff to look right at all, this sucks.

Fear not, made it possible to apply your own rotation. You do this by speaking a number into your whisper or talk-channel, this number can be 0-360 as it represents degrees. Then use the item on yourself, next time you spawn your group that offset will be applied. Its persistent so it'll stick between resets.

Additionally for DMs:

The PLC spawner no longer cares how many PLCs you stick into it, you can also override the radius of which you wish it to capture PLCs by speaking the radius into talk or whisper before using the plc spawner. Default radius is still 5.0 which it'll use incase no number was spoken. Using the widget on yourself resets it so if you wish to apply custom rotation as mentioned above, use the item on the item itself whilst its in the inventory (<insert yo heard you like meme here>).

Additionally, additionally:

PLC spawners created now saves the Z axis, however as we all know, spawning stuff from the creator with a modified Z axis is a pain so it might still not be possible to create more advanced groups anyway. Unless they're made in the toolset. Policy, DC price, etc doesnt change unless a DM says it has. This is only mechanical.

If your PLC group is now broken then let me know.

Author:  Gobbledygook [ Mon, Mar 31 2014, 10:47 AM ]
Post subject:  Re: About PLC Group Spawners

Fantastic innovation Terra! This is really useful for those more tricky PLC's. :)

Author:  Yossarin [ Mon, Mar 31 2014, 10:49 AM ]
Post subject:  Re: About PLC Group Spawners

Nice work.

Author:  Hudson [ Mon, Mar 31 2014, 11:09 AM ]
Post subject:  Re: About PLC Group Spawners

Huzzah!

Author:  linlan [ Mon, Mar 31 2014, 11:24 AM ]
Post subject:  Re: About PLC Group Spawners

More flexibility! Thanks Terra!

Now the 1000 Monty question: any chance we could use multiple PLC spawners at the same time in the future ?
There are instances when some PLCs are needed, others not etc...

Author:  Terra_777 [ Mon, Mar 31 2014, 11:39 AM ]
Post subject:  Re: About PLC Group Spawners

Ok, done.

Author:  linlan [ Mon, Mar 31 2014, 12:05 PM ]
Post subject:  Re: About PLC Group Spawners

:shock: :o :P :D

Author:  Glim [ Mon, Mar 31 2014, 16:29 PM ]
Post subject:  Re: About PLC Group Spawners

It warrants noting that not all PLCs rotate on a central axis, some of them their axis is skewed to one side or another, so they won't rotate cleanly with this setup. While this is fine if they're by themselves, a single PLC in the spawner, it could "break" the look of a group of PLCs spawning together.

Author:  Terra_777 [ Mon, Mar 31 2014, 16:39 PM ]
Post subject:  Re: About PLC Group Spawners

Glim wrote:
It warrants noting that not all PLCs rotate on a central axis, some of them their axis is skewed to one side or another, so they won't rotate cleanly with this setup. While this is fine if they're by themselves, a single PLC in the spawner, it could "break" the look of a group of PLCs spawning together.


Could you give me an example on one that would break? Because I apply rotation to all axises not just facing. Its vector transformation, if you think the positions as points on a grid, its the grid that rotates, the points/plcs follows.

Author:  Mahtan [ Mon, Mar 31 2014, 16:54 PM ]
Post subject:  Re: About PLC Group Spawners

This works amazing, even with my rather complex ones like Tree houses and what not that require special placing of all 10 PLCs. I also love I can place all of them at once now.

Author:  Yossarin [ Mon, Mar 31 2014, 17:07 PM ]
Post subject:  Re: About PLC Group Spawners

Terra_777 wrote:
Glim wrote:
It warrants noting that not all PLCs rotate on a central axis, some of them their axis is skewed to one side or another, so they won't rotate cleanly with this setup. While this is fine if they're by themselves, a single PLC in the spawner, it could "break" the look of a group of PLCs spawning together.


Could you give me an example on one that would break? Because I apply rotation to all axises not just facing. Its vector transformation, if you think the positions as points on a grid, its the grid that rotates, the points/plcs follows.


So tell us, just how much math was involved in this? :)

Author:  Glim [ Mon, Mar 31 2014, 17:08 PM ]
Post subject:  Re: About PLC Group Spawners

Off hand I can recall that the single sheet of paper is a PLC model whose axis is not at the model's center. When rotating Iit in the toolset you often have to reposition it on whatever its resting on top of after rotating because it will suddenly be hanging 3/4 over he edge for example or even completely off the surface in mid air.

Author:  Terra_777 [ Mon, Mar 31 2014, 17:55 PM ]
Post subject:  Re: About PLC Group Spawners

Glim wrote:
Off hand I can recall that the single sheet of paper is a PLC model whose axis is not at the model's center. When rotating Iit in the toolset you often have to reposition it on whatever its resting on top of after rotating because it will suddenly be hanging 3/4 over he edge for example or even completely off the surface in mid air.


What you do in the toolset is just rotating the facing, there is no transformation on the actual position of the object. The entire PLC group rotates like that piece of paper, so if you zoom in on the piece of paper and its textures, points, etc the PLC in the group rotates like them. So a single PLC is going to have the same relation towards the rest of the PLC in the group.

Yossarin wrote:
So tell us, just how much math was involved in this? :)


Getting the distance and angle between the two vectors are the most mathematically complex. But I'll explain it if anyone else wanna have fun paint figures or spawn garbage:

So if we got vector A and B:

Distance between them: sqrt( ( A - B )^2 ) ie Pythagoras.

Angle between them: theta = A * B / (|A| * |B|) 3d angle = acos( ( theta * 180 ) / PI );

|A| = magnitude of A = sqrt( (A.X*A.X) + (A.Y*A.Y) + (A.Z*A.Z) )

However: its not relevant in nwn and this is why I think rotation wasn't applied before, because people assumed it was (as seen in bioware library: x0_i0_position). But nwn is a 2d space with height but without pitch on the Z axis.

So: 2d angle = atan2( (A.X-B.X), (A.Y-B.Y) ); nwscript function for atan2 is VectorToAngle.

The two above is done in the game engine so its not actually math I touched but had to explore.

The transformation looks like this:

A = where you targeted the item
B = where your character currently is
C = new vector

Dist = saved distance
Angle = saved angle
Rotation = custom saved rotation + angle between A and B
Objectfacing = savedfacing + Rotation

C.X = A.X + ( Dist * cos( Angle+Rotation ) )
C.Y = A.Y + ( Dist * sin( Angle+Rotation ) )
C.Z = A.Z + Saved Z. There is no pitch, its a 2d space with height.

final = Location( oArea, C, Objectfacing );


Thats how much math it was.

Author:  Liz [ Thu, Apr 03 2014, 0:27 AM ]
Post subject:  Re: About PLC Group Spawners

A question: before I use the /whisper function to alter Kaithan's widget's facing, can someone (Terra!) tell me if that function is a one-shot thing, or if I can rotate it as many times as I like?

Author:  DireCorbie [ Thu, Apr 03 2014, 3:41 AM ]
Post subject:  Re: About PLC Group Spawners

I think it's the /shout function, and I've been able to rotate mine multiple times so far.

Author:  Liz [ Thu, Apr 03 2014, 4:09 AM ]
Post subject:  Re: About PLC Group Spawners

/shout function, right, that's what I meant. :)

And, yay! It seems to be working awesomely! Not sure why 95 degrees should be the magic number, but that's apparently the proper rotation to get Kaithan's shrine to face her as she summons it.

(Edited out my pointless question. Never mind! Nothing to see here!)

Thanks for doing this, Terra! I've always been kind of a bit irked that Kaithan's shrine could only ever face due south. :)

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/