Aller au contenu

Photo

[SOLVED] Codex Plot issues with killed Creatures


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

#1
yokmp

yokmp
  • Members
  • 58 messages
Hi,
i play around with the Toolset and now im a bit confused. I replayced the plot_core file with my own to display some message. This works with Books an History but not with creatures. I dont know what else i can do here.

#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "plot_h"

#include "plt_cod_mgc_spirits"
#include "plt_cod_crt_wisp"

int StartingConditional()
{
    event evEvent = GetCurrentEvent();
    int nType = GetEventType(evEvent);
    string strPlot = GetEventString(evEvent, 0);
    int nPlot = GetEventInteger(evEvent, 1);
    int nResult = FALSE; // return value for DEFINED GET events (see bottom)
    object oHero = GetHero(); 


    if (nType == EVENT_TYPE_SET_PLOT)
    {
    DisplayStatusMessage ("EVENT_TYPE_SET_PLOT", 0xFF62FF);
    
        if (strPlot == PLT_COD_CRT_WISP)
        { // SetPlot [cod_crt_wisp] [COD_CRT_WISP_UNLOCKED] -> [1]

            DisplayStatusMessage ("CODEX WISP Get!", 0xFF62FF);
        }
                
        if (strPlot == PLT_COD_MGC_SPIRITS)
        {   
            DisplayStatusMessage ("CODEX SPIRITS Get!", 0xFF62FF );
        }
    }
    
    if (nType == EVENT_TYPE_GET_PLOT)
    { 
        DisplayStatusMessage ("EVENT_TYPE_GET_PLOT", 0xFF62FF); 
    }
    
    plot_OutputDefinedFlag(evEvent, nResult);
    return nResult;
}

What is wrong here?

EDIT:
Start a new Game while using this plot_core.ncs and chose a mage. When you are in the Fade then look at the Statue to see that this works and then kill a Wisp. Here goes something wrong i think ...
And sorry for my english (=

SOLTION:
#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "events_h"
#include "2da_constants_h"

#include "bhm_constants_h"
#include "plt_bhm600pt_harrowing"

// -------------------------------------------------
// Plot to check if Creature already slain
// -------------------------------------------------
#include "plt_test_plot"
// -------------------------------------------------
// Name Strings of Creatures to check
// -------------------------------------------------
string strWisp = "bhm600cr_wispwraith";

void main()
{
    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev);
    string sDebug;
    object oPC = GetHero();
    object oParty = GetParty(oPC);    
    int nEventHandled = FALSE;
    
string strCreature = ToString(OBJECT_SELF);  // make OBJECT_SELF a string
int intCreature = StringToInt (strCreature); // convert int to string

    switch(nEventType)
    {
        case EVENT_TYPE_DEATH:
        {
            if (strCreature == strWisp)
            {   
                int intWispFlag = WR_GetPlotFlag(PLT_TEST_PLOT, WISP_TEST);
                if (intWispFlag == 1) {
                    DisplayStatusMessage ("Killed Again!", 0xFF62FF); // hard-to-overlook-color
                }
                else {
                    DisplayStatusMessage ("First Kill!", 0xFF62FF);
                    WR_SetPlotFlag(PLT_TEST_PLOT, WISP_TEST, 1, TRUE);
                }
            }
            break;
        }
    }
    if (!nEventHandled)
    {
        HandleEvent(ev, RESOURCE_SCRIPT_CREATURE_CORE);
    }
}
Here and there some Code that is not needed.

Modifié par yokmp, 18 février 2011 - 01:48 .


#2
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
For EVENT_TYPE_DEATH, creature_core.nss calls WR_SetPlotFlag(sCodexGUID, nCodexFlag, TRUE), the function being defined as "void WR_SetPlotFlag(string strPlot, int nFlag, int nValue, int nCallScript = FALSE)".

So nCallScript is FALSE, and the plot script isn't called because that FALSE value gets passed on to SetPartyPlotFlag. I'm assuming anyway.

Modifié par FollowTheGourd, 17 février 2011 - 02:51 .


#3
yokmp

yokmp
  • Members
  • 58 messages
But if i say

#include "utility_h"
#include "wrappers_h" 
#include "events_h"
 
void main()
{
    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev);
    string sDebug;     
    object oPC = GetHero();
    object oParty = GetParty(oPC);   
    int nEventHandled = FALSE;
 
    switch(nEventType)
    {
         case EVENT_TYPE_DEATH:
         {

             DisplayStatusMessage ("CREATURE DEATH!", 0xFF62FF);

             nEventHandled = TRUE;
             break;
         }
    }
    if (!nEventHandled)
    {
        HandleEvent(ev, RESOURCE_SCRIPT_CREATURE_CORE);
    }
}
Wouldn't that mean that it fires all the time a creature dies?
I thought in something like GetCreature???. Name doesn't exist.
Maybe something like
int GetCreatureTypeclassification ( nAppearanceType )
if (nAppearanceType == CREATURE_TYPE_AIP_WISP )
or
if (CREATURE_TYPE_AIP_WISP == 10126)
???