Aller au contenu

Photo

creating followers: scripts


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

#1
bowlie1

bowlie1
  • Members
  • 51 messages
 hi guys. just a quick question. i am following this guide to make a follower

http://social.biowar...llower_tutorial

it is going well apart from the script about 1/6 of the way down. what is the module event script? do i make a new script or add it onto the end of another one. if so wich one? thanks

#2
Qutayba

Qutayba
  • Members
  • 1 295 messages
What you'll actually be making is an intercept script that will only include the changes you'll make and then refer other events to the module core script. You only need to include the cases where you're making changes to the script.

[quote]#include "events_h"
#include "global_objects_h"
#include "utility_h"
#include "wrappers_h"

// # include party member plot file name here

void main()

// EVENT INTERCEPTOR
{
// keep track of whether the event has been handled

int nEventHandled = FALSE;
event ev = GetCurrentEvent();
int nEvent = GetEventType(ev); //extract event type from current event

switch(GetEventType(ev)) //switches between the different possible cases that might apply
{
case EVENT_TYPE_PARTYMEMBER_ADDED:
{
// Set Party Flags here
}
case EVENT_TYPE_PARTYMEMBER_DROPPED:
{
// Set Party flags here
}
}
// ELSE SEND TO CORE SCRIPT

// if this event wasn't handled by this script fall through to the core script
if(!nEventHandled)
{
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
}
}[\\quote]

Modifié par Qutayba, 15 avril 2010 - 11:35 .


#3
Proleric

Proleric
  • Members
  • 2 363 messages
Once you've made the script, you can add it to the module using File > Manage Modules > Properties. In the Script field, click on the elipsis [...] then select your script.

#4
bowlie1

bowlie1
  • Members
  • 51 messages
i already have the charicter generation one there. will it matter? can it select multiple ones or do i need to compile them all into one? thanks

#5
Proleric

Proleric
  • Members
  • 2 363 messages
You will need to include all the cases in one module script. The same script is triggered by many events. The case statements determine which bit of the script runs for a particular event.