Aller au contenu

Photo

Help my addin test is not ending


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

#1
yellerlab7876

yellerlab7876
  • Members
  • 7 messages
#include "wrappers_h"

void main()
{


                    object oArea = GetObjectByTag("pre200ar_korcari_wilds");
                    vector vOgreLocation = Vector(921.814f,866.421f,3.8942f);
                   if (IsObjectValid(oArea))
                    CreateObject(
                        OBJECT_TYPE_CREATURE,
                        R"ogre_boss.utc",
                        Location(oArea, vOgreLocation, -30.0f)
                    );
                    
}
this is the only way I have sucessfuly got a creature to apear in game.  But this combo of the PRCSCR_<suffix>(.rim file) and script create an endless amount of creatures athe the spacif point.
Tried to use a plot flag
#include "plt_nb78_plotcreaturetest"
#include "wrappers_h"

void main()
{
     
    if (WR_GetPlotFlag(PLT_NB78_PLOTCREATURETEST, NB78_CREATURETEST_FLAG) == TRUE)
            return;


             event ev = GetCurrentEvent();
             int nEventType = GetEventType(ev);

             switch ( nEventType )
             {

                case EVENT_TYPE_MODULE_LOAD:
                {

                    object oArea = GetObjectByTag("pre200ar_korcari_wilds");
                    vector vOgreLocation = Vector(921.814f,866.421f,3.8942f);

                    CreateObject(
                        OBJECT_TYPE_CREATURE,
                        R"ogre_boss.utc",
                        Location(oArea, vOgreLocation, -30.0f)
                    );

                    WR_SetPlotFlag(PLT_NB78_PLOTCREATURETEST, NB78_CREATURETEST_FLAG, TRUE);
                    break;
                }
                default:
                break;
             }

}
and then i get nothing.  I have read and looked over this but remained stumped
any help would be great
Thanks yellerlab7876

#2
Craig Graff

Craig Graff
  • Members
  • 608 messages
Did you make the default value of your flag Set? Or are you trying to run EVENT_TYPE_MODULE_LOAD in a PRCSCR script or an area script? You shouldn't be running that particular code off the module, if that is what you are doing. Try moving it (minus the event filtering) to a PRCSCR script or use EVENT_TYPE_AREALOAD_PRELOADEXIT in the area script.

Modifié par Craig Graff, 24 janvier 2010 - 12:45 .


#3
yellerlab7876

yellerlab7876
  • Members
  • 7 messages
I only tried the even load as a last resort I didn't thing it would work but as I was stuck I was willing to try and give that a shot. But I left my plot flag defaults value Not Set. Do I need to set it to get the script to run? I will remove the Event module load and try with a set plot flag?

#4
Craig Graff

Craig Graff
  • Members
  • 608 messages
It still sounds like you are using the module script for this. If so, you really don't want to - it will only work some of the time and be extremely inefficient (since your code will be checked every single time a module event fires - which is quite often).
Try using a PRCSCR 2da to trigger your script. For help look here or here.

For the Korcari Wilds your area list name would be "pre02al_korcari_wilds" without the quotes and you would also want to filter for the area tag like so
[dascript]
void main()
{   
    object oPC = GetHero();                                
    object oArea = GetArea(oPC);
    if (!WR_GetPlotFlag(PLT_NB78_PLOTCREATURETEST, NB78_CREATURETEST_FLAG)
        && GetTag(oArea) == "pre200ar_korcari_wilds" )
    {     
        WR_SetPlotFlag(PLT_NB78_PLOTCREATURETEST, NB78_CREATURETEST_FLAG, TRUE);
        //add spawn creature code here       
    }     
}               
[/dascript]

Modifié par Craig Graff, 24 janvier 2010 - 09:54 .