Player Resource Consortium


Author Topic: Psionic Power: Astral Seed not working  (Read 2785 times)

0 Members and 1 Guest are viewing this topic.

November 21, 2012, 12:48:14 AM
  • Jr. Associate
  • **
  • Posts: 60
  • Karma: +5/-0
  • New Member
    • View Profile

While testing the Slayer class I was playing around with high level powers and I could not get the Astral Seed power to work. I'm not good on the event hooking, but I'm guessing that its just not triggering upon death - the casting looks good.

As a separate item:
While poking around in the code and reading up online about the hooks into various spells/powers I saw that the name of the script to be executed is actually 17 characters long instead of 16. I *think* that means, since you can't create a script name longer than 16 characters, that the hook isn't going to work, but I haven't tested it myself.


    // Persistant World death hooks
    ExecuteScript("prc_pw_astralseed", oPC);
    if(GetPRCSwitch(PRC_PW_DEATH_TRACKING) && GetIsPC(oPC))
        SetPersistantLocalInt(oPC, "persist_dead", FALSE);

Assuming that it won't work, the simple fix for this would be to revise the hook to "prc_pw_astralsed" or the like.

November 21, 2012, 05:12:23 PM
Reply #1
  • Jr. Associate
  • **
  • Posts: 60
  • Karma: +5/-0
  • New Member
    • View Profile

Ok, I'm pretty sure that the reason its not working on my PC is because the script is looking for NPC death not PC death.

From Astral Seed code:

    // Add a hook to OnDeath event for the manifester
    AddEventScript(oManifester, EVENT_NPC_ONDEATH, "psi_astseed_resp", FALSE, FALSE);

Event is for NPC death. The prc_ondeath script doesn't trigger EVENT_NPC_ONDEATH it triggers EVENT_ONPLAYERDEATH:

From prc_ondeath code:
    // Execute scripts hooked to this event for the player triggering it
    ExecuteAllScriptsHookedToEvent(oDead, EVENT_ONPLAYERDEATH);

Therefor the fix seems like it would be to trade out the EVENT_NPC_ONDEATH in Astral Seed for EVENT_ONPLAYERDEATH. I don't think any NPC will actually ever use this power...

I'll make this change locally and test it out tonight to confirm it works. If it does, I assume its Ok to submit this fix along with the Slayer files when its all done? Or I can send this file separately.


December 19, 2012, 11:17:52 PM
Reply #2
  • Jr. Associate
  • **
  • Posts: 60
  • Karma: +5/-0
  • New Member
    • View Profile

Found the issue was two-fold, plus.
First, as above the event type needed to be EVENT_ONPLAYERDEATH.
Second, the respawn script incorrectly assumed OBJECT_SELF was the Manifestor; fixed by getting the last player that died instead.
In testing, also noticed that the JumpTo command was being impeded by the effects placed on the PC to freeze and protect them, so modified the delays to account for that.

While I was in there, I added some new switches; Xwarren will have to approve those in any case. :)

Xwarren, I have sent the changed files to your e-mail. Let me know if you don't get them!


December 21, 2012, 05:32:51 PM
Reply #3
  • Developer
  • *****
  • Posts: 1439
  • Karma: +27/-0
  • Gender: Male
    • View Profile

Neat modifications Atalsen! Very well documented. Thank you!

I'll merge them with my PRC, and after some testing update the SVN repository.

If you had any further improvements do not hasitate to share ;)