(edit)well usind the demo module script I got my area transition to maps working. I used it as my main module script here is the script:
#include "events_h"
#include "global_objects_h"
#include "wrappers_h"
#include "log_h"
#include "utility_h"
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev); //extract event type from current event
int nEventHandled = FALSE; //keep track of whether the event has been handled
switch(nEventType)
{
case EVENT_TYPE_MODULE_START:
{
//This sets a particular world map as being the current "primary" map.
//We only have one map in this module so we can set it once here and not
//need to worry about keeping track of it later.
object oMapId = GetObjectByTag("aod_map");// aod_map is your map name
WR_SetWorldMapPrimary(oMapId);
//start character generation.
PreloadCharGen();
StartCharGen(GetHero(),0);
break;
}
////////////////////////////////////////////////////////////////////////
// Sent by: The engine
// When: The module loads from a save game. This event can fire more than
// once for a single module or game instance.
////////////////////////////////////////////////////////////////////////
case EVENT_TYPE_MODULE_LOAD:
{
break;
}
////////////////////////////////////////////////////////////////////////
// Sent by: The engine
// When: A player enters the module
////////////////////////////////////////////////////////////////////////
case EVENT_TYPE_ENTER:
{
object oCreature = GetEventCreator(ev);
break;
}
////////////////////////////////////////////////////////////////////////
// Sent by: The engine
// When: the player clicks on a destination in the world map
////////////////////////////////////////////////////////////////////////
case EVENT_TYPE_WORLD_MAP_USED:
{
int nFrom = GetEventInteger(ev, 0); // travel start location
int nTo = GetEventInteger(ev, 1); // travel target location
break;
}
////////////////////////////////////////////////////////////////////////
// Sent by: The engine
// When: the player clicks on a destination in the world map
////////////////////////////////////////////////////////////////////////
case EVENT_TYPE_BEGIN_TRAVEL:
{
string sSource = GetEventString(ev, 0); //area tag source location
string sTarget = GetEventString(ev, 1); // area tag target location
string sWPOverride = GetEventString(ev, 2); // waypoint tag override
//if you want to do any special-case code or random encounter handling, insert it here
if (sSource != sTarget)
{
//store target area's tag to a local module variable
SetLocalString(GetModule(), "WM_STORED_AREA", sTarget);
//store target waypoint tag
SetLocalString(GetModule(), "WM_STORED_WP", sWPOverride);
//initiate the map's travelling animation. The engine will
//send EVENT_TYPE_WORLDMAP_PRETRANSITION once it's started.
WorldMapStartTravelling();
}
}
////////////////////////////////////////////////////////////////////////
// Sent by: The engine
// When: the world map has begun its "travelling" animation
////////////////////////////////////////////////////////////////////////
case EVENT_TYPE_WORLDMAP_PRETRANSITION:
{
//retrieve the target area tag we stored in EVENT_TYPE_BEGIN_TRAVEL
string sArea = GetLocalString(GetModule(), "WM_STORED_AREA");
//retrieve the target waypoint tag
string sWP = GetLocalString(GetModule(), "WM_STORED_WP");
//execute the area transition to that target.
UT_DoAreaTransition(sArea, sWP);
break;
}
////////////////////////////////////////////////////////////////////////
// Sent by: The engine
// When: the world map has been called for, either via an area transition
// or via the player's GUI button
////////////////////////////////////////////////////////////////////////
case EVENT_TYPE_TRANSITION_TO_WORLD_MAP:
{
//The world map's GUI status determines whether the player can use
//it for travel by clicking on destination map pins, or whether it
//only displays as an informational image.
SetWorldMapGuiStatus(WM_GUI_STATUS_USE);
//Opens the map currently set as the primary map. See EVENT_TYPE_MODULE_START
//for the code where we set which map this is.
OpenPrimaryWorldMap();
break;
}
}
if (!nEventHandled) //If this event wasn't handled by this script, let the core script try
{
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
}
}
Now I just need to get the map to come up when you push "n" I'm guessing that it has to do with my 2da files but hopefully this will help a few people.
Modifié par 777lewis777, 09 mars 2010 - 06:08 .





Retour en haut






