Aller au contenu

Photo

Add Follower to existing campaign: where do I put these script lines (solved)


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

#1
LukaCrosszeria

LukaCrosszeria
  • Members
  • 1 304 messages
Hello everyone,

I've used the follower tutorial to add a follower. The tutorial is very nice but it doesn't clarify some points though on what you have to do if you want to add a follower to the existing main campaign.

1) My module properties are set to Extended Module: Single Player and in Hierarchy I checked Single Player.

2) I created a creature file (utc) and set the Module to Single Player and the Owner to my module.
Exported without dependant resources and put it in my module/override folder.

3) I created a new char stage area, both Module and Owner set to my module, adding a waypoint for my player.
Exported without dependant resources and put it in my module/override folder.

4) Then the tut says: "Add the following to your module event script:"

case EVENT_TYPE_MODULE_GETCHARSTAGE:
{
SetPartyPickerStage("my_char_stage", "partypicker");
break;
}

But how will adding this to the module script help? That only loads the char stage I made when I select my module from Other Campaigns, right? I need this stage to overlap the main char stage in the Origins campaign.

Same for this: Capture the EVENT_TYPE_PARTYMEMBER_ADDED Event

#include "utility_h"
 
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
switch(nEventType)
{
case EVENT_TYPE_PARTYMEMBER_ADDED:
{
object oFollower = GetEventObject(ev, 0);
SetLocalInt(oFollower, CREATURE_REWARD_FLAGS, 0)]
AddCommand(oFollower, CommandJumpToLocation(GetLocation(GetHero())))]
SetFollowerState(oFollower, FOLLOWER_STATE_ACTIVE)]
break;
}
}
}
I don't want to go messing with the game scripts for fear of breaking the game and also making my mod incompatible with other mods. Thanks for any help.

Modifié par LukaCrosszeria, 14 janvier 2011 - 09:59 .


#2
Proleric

Proleric
  • Members
  • 2 361 messages
If you set up your module as an add-in to another campaign, the good news is that your module event script is run in addition to the main campaign's script.

This only applies to module events, not to any other kind of script.

Just ensure that your module event script does not pass the event to the core script on completion - the main campaign already does that, so you don't want things to happen twice.

#3
LukaCrosszeria

LukaCrosszeria
  • Members
  • 1 304 messages
I did not know that :) It worked, thanks! He's spawned properly in the module.