Aller au contenu

Photo

camp fire script -edited: need help fixing this one I wrote


1 réponse à ce sujet

#1
Sonmeister

Sonmeister
  • Members
  • 167 messages
I need to light my camp fire.  Does anyone have a little placeable script for this?

EDIT:  OK, I took the time to write this and it compiles but doesn't work.  Any tips?

//:://////////////////////////////////////////////
//    Placeable events
//:://////////////////////////////////////////////

#include "placeable_h"

const string CAMPFIRE = "camp_fire";
const int LIGHT_CAMPFIRE = 4050; //References the VFX_Base 2DA

void main()
{
    event ev     = GetCurrentEvent();
    int   nEvent = GetEventType(ev);
    int nEventHandled = FALSE; //keep track of whether the event has been handled
    switch (nEvent)
    {
        //---------------------------------------------------------------------
        //  Sent by engine when creature clicks on the placeable.
        //---------------------------------------------------------------------
        case EVENT_TYPE_APPLY_EFFECT: // or EVENT_TYPE_PLACEABLE_ONCLICK

        object oCampfire = GetObjectByTag(CAMPFIRE);
        ApplyEffectOnObject (EFFECT_DURATION_TYPE_PERMANENT, EffectVisualEffect(LIGHT_CAMPFIRE),oCampfire);

        nEventHandled = TRUE;
            break;
    }
    if (!nEventHandled) //If this event wasn't handled by this script, let the core script try
    {
        HandleEvent(ev, RESOURCE_SCRIPT_PLACEABLE_CORE);
    }
}

Modifié par Sonmeister, 10 juin 2010 - 10:52 .


#2
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages
To avoid the area load, you could also use the spawn event.