Aller au contenu

Photo

Ambient_Start problems


2 réponses à ce sujet

#1
Kilrogg_

Kilrogg_
  • Members
  • 296 messages
I'm trying to make a team of creatures change their ambient behavior when the player walks into a trigger. This is my script, but it won't actually compile. I get an 'unknown state in compiler' on the line with Ambient_StartTag.

I am still very new to scripting so I'm probably forgetting something very obvious.


#include "sys_ambient_h"
#include "utility_h"
#include "wrappers_h"
#include "events_h"

void main()
{
    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev);
    object oPC = GetHero();
    int nEventHandled = FALSE;

    switch(nEventType)
    {

        ////////////////////////////////////////////////////////////////////////
        // Sent by: The engine
        // When: A creature enters the trigger
        ////////////////////////////////////////////////////////////////////////
        case EVENT_TYPE_ENTER:
        {

            Ambient_StartTag(forest_group1, 0, 109, am_grp01_, 0, 0.0f);

            break;
        }


    }
    if (!nEventHandled)
    {
        HandleEvent(ev, RESOURCE_SCRIPT_TRIGGER_CORE);
    }
}

Modifié par Kilrogg_, 29 mai 2010 - 06:57 .


#2
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages
One thing to be careful of is this trigger doesn't check who is entering, and it doesn't have a do once on it. Any creature, including all party members, neutrals and hostiles, that passes through it is going to reset the ambient behavior of that creature every time they pass through it.

#3
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages
You may have to script the waypoint movement. I think the ambient system is designed to shut off during combat. There may be an override for that to apply to individual creatures, but I'm not certain.