Heading

Discussions on development of both the EQ2Emulator LUA Script Engine and Script specifications

Moderator: Team Members

Post Reply
User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Heading

Post by Gangrenous » Wed May 25, 2016 8:23 pm

We do not currently have a way of changing a players location or heading do we?
Resident Dirty Hippy

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Heading

Post by Jabantiz » Wed May 25, 2016 8:36 pm

SetPosition() will work on a player for location, there currently is no way to change heading though. I will modify both SetPosition() and SetHeading() to allow changing of the players heading though.

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Heading

Post by Gangrenous » Thu May 26, 2016 4:31 am

Thank you!!

I will move on to other spells and just notate these are not done.
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Heading

Post by Gangrenous » Tue May 31, 2016 5:15 pm

I merged the official source with my changes today and noticed the SetPosition is actually putting you at 180 no matter what value you feed it. Could this be the cause?

Code: Select all

if(client){
				EQ2Packet* packet = client->GetPlayer()->Move(x, y, z, client->GetVersion());
				client->QueuePacket(packet);
			}
This check is further down the LuaFunctions.cpp
Resident Dirty Hippy

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Heading

Post by Jabantiz » Tue May 31, 2016 5:52 pm

That code should actually be

Code: Select all

if(client){
				EQ2Packet* packet = client->GetPlayer()->Move(x, y, z, client->GetVersion(), (heading == 0 ? -1.0f : (heading + 180.0f)));
				client->QueuePacket(packet);
			}
BTW no clue why but just putting in the normal heading and sending the packet it was always off by 180, so if you passed a heading of 190 it would end up putting you at 10, that is why there is the +180.0f in there, just another random weird behavior SoE/Daybreak coded...

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests