So, that one is for triggering a cutscene - very easy stuff, you just add this script to your trigger. If you want to make sure only the Player triggers it (the code would trigger from any creature entering it, including monsters), you may look around in the wiki, it's in there.
-----
#include "events_h"
#include "wrappers_h"
#include "utility_h"
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
switch(nEventType)
{
case EVENT_TYPE_ENTER:
{
CS_LoadCutscene(R"gis_rf_dscamp.cut"); //the name in " " is the name of the cutscene file.
DestroyObject(OBJECT_SELF); //makes sure the trigger only fires once, it deletes itself after firing
}
}
HandleEvent(ev, RESOURCE_SCRIPT_AREA_CORE);
}
-----
This one is to make something visible - activating a door/monster/area transition/whatever. Again, it will trigger from anything entering, so if you have creatures wandering around, you have to check who fired the event, and only execute your code if it was the player.
-----
#include "wrappers_h"
#include "events_h"
#include "utility_h"
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
switch(nEventType)
{
case EVENT_TYPE_ENTER:
{
SetObjectActive(GetObjectByTag("dis_cth_spawn0"), TRUE);
DestroyObject(OBJECT_SELF);
}
}
HandleEvent(ev, RESOURCE_SCRIPT_AREA_CORE);
}
-------
Modifié par Erenz, 20 novembre 2009 - 03:32 .