Magic Casting Interrupted

Forum rules
NO LONGER BEING MAINTAINED!
User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Magic Casting Interrupted

Post by kjLotus » Thu Jan 24, 2013 5:29 pm

azafaraht wrote:Tried to recreate my issue. This works:
1. Create new character
2. Learn cure as WHM
3. Cast

This doesn't:
1. Create new character and logout.
2. Through SQL, unlock all jobs.
3. Through SQL, set magic skill for healing and summoning.
4. Log in, and cast as WHM or SMN.
when you say "this works" are you referring to the spells working or the act of recreating the issue working?

azafaraht
Posts: 74
Joined: Thu Nov 22, 2012 11:04 am

Re: Magic Casting Interrupted

Post by azafaraht » Fri Jan 25, 2013 10:42 am

The spells worked for a small amount of time when creating a new character, leaning the cure spell and casting on myself.
Server running on Ubuntu 12.04 Server 64-bit on VirtualBox
Client running on Windows 7 64-bit iMac

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Magic Casting Interrupted

Post by kjLotus » Fri Jan 25, 2013 11:06 am

azafaraht wrote:The spells worked for a small amount of time when creating a new character, leaning the cure spell and casting on myself.
i'll try to remember to attempt to duplicate this tonight

is it on your own private server?

azafaraht
Posts: 74
Joined: Thu Nov 22, 2012 11:04 am

Re: Magic Casting Interrupted

Post by azafaraht » Fri Jan 25, 2013 10:10 pm

Yeah, private server... My guess has always been that I made a mistake somewhere, like mass learning spells through a lua script.
Server running on Ubuntu 12.04 Server 64-bit on VirtualBox
Client running on Windows 7 64-bit iMac

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Magic Casting Interrupted

Post by kjLotus » Fri Jan 25, 2013 10:35 pm

azafaraht wrote:Yeah, private server... My guess has always been that I made a mistake somewhere, like mass learning spells through a lua script.
GM command @addallspells doesn't really mess anything up and it adds every single spell at once

my advice, if you really want to find out easily and not make me spend forever trying to replicate it, it to put some breakpoints in the code and step through to see what it's doing

ai_char_normal.cpp, ActionMagicCasting (line 1185) is probably the best spot

if you don't know how, that's ok, i'll try to replicate it ; ;

azafaraht
Posts: 74
Joined: Thu Nov 22, 2012 11:04 am

Re: Magic Casting Interrupted

Post by azafaraht » Sat Jan 26, 2013 4:13 pm

I used the player:addSpell function, inside a NPC trigger event. That's how I learned all spells.

Thanks for advice and the location of the ActionMagicCasting. Well try now.
Server running on Ubuntu 12.04 Server 64-bit on VirtualBox
Client running on Windows 7 64-bit iMac

azafaraht
Posts: 74
Joined: Thu Nov 22, 2012 11:04 am

Re: Magic Casting Interrupted

Post by azafaraht » Sat Jan 26, 2013 4:34 pm

Funny, created another character, taru, in sandoria, as black mage. Learned Stone. Went outside with the cute little taru, couldn't finish the casting... Ok, I'll be trying the breakpoint around ActionMagicCasting and will let you know my results. Thanks kjLotus.
Server running on Ubuntu 12.04 Server 64-bit on VirtualBox
Client running on Windows 7 64-bit iMac

azafaraht
Posts: 74
Joined: Thu Nov 22, 2012 11:04 am

Re: Magic Casting Interrupted

Post by azafaraht » Sat Jan 26, 2013 5:08 pm

I want to printf from the cpp to the dsgame log. How can I achieve this so I can trace my error while casting?
Server running on Ubuntu 12.04 Server 64-bit on VirtualBox
Client running on Windows 7 64-bit iMac

azafaraht
Posts: 74
Joined: Thu Nov 22, 2012 11:04 am

Re: Magic Casting Interrupted

Post by azafaraht » Sat Jan 26, 2013 5:55 pm

I used a ShowDebug statement after each ActionMagicInterrupt call in ai_char_normal.cpp, ActionMagicCasting to find where it is determining that the cast should be interrupted.

Casting is being interrupted here:

Code: Select all

//the check for player position only occurs AFTER the cast time is up, you can move so long as x/z is the same on finish.
//furthermore, it's actually quite lenient, hence the rounding to 1 dp
if (floorf(m_PChar->m_StartActionPos.x * 10 + 0.5) / 10 != floorf(m_PChar->loc.p.x * 10 + 0.5) / 10 ||
                floorf(m_PChar->m_StartActionPos.z * 10 + 0.5) / 10 != floorf(m_PChar->loc.p.z * 10 + 0.5) / 10)
                {
                        m_PChar->pushPacket(new CMessageBasicPacket(m_PChar, m_PChar, 0, 0, 16));

                        m_ActionType = ACTION_MAGIC_INTERRUPT;
                        ActionMagicInterrupt();
                        ShowDebug("Location: %u",7);
                        return;
                }
From what I can understand, in my private server, even though I'm standing and casting, the result of the calculate states otherwise. Hence, why I can never cast.
Server running on Ubuntu 12.04 Server 64-bit on VirtualBox
Client running on Windows 7 64-bit iMac

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Magic Casting Interrupted

Post by kjLotus » Sat Jan 26, 2013 6:35 pm

print those numbers. printf will go straight to the DSGame console

printf("startpos x: %f startpos z: %f endpos x: %f endpos z: %f\n", floorf(m_PChar->m_StartActionPos.x * 10 + 0.5) / 10, floorf(m_PChar->loc.p.x * 10 + 0.5) / 10, floorf(m_PChar->m_StartActionPos.z * 10 + 0.5) / 10, floorf(m_PChar->loc.p.z * 10 + 0.5) / 10);

can't really think of any causes for something like this off the top of my head

Post Reply