Aller au contenu

Photo

Can't get Module to Load!!


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

#1
Dansharp1

Dansharp1
  • Members
  • 103 messages
I cannot get my module to load up in "Other Campaigns". I have used this script for my weapon:

// ---- SCRIPT STARTS HERE ----

// Later on in this script, we will use the UT_AddItemToInventory()
// function to add an item to the player's inventory.
// But before we could use it, we have to tell the toolset where
// to look for it. The function is in the "utility_h" script file
// under _Core Includes, we will include this file at the top of
// our script file, above the main function.

#include "utility_h"
#include "plt_my_custom_plot"

void main()
{
    // If our plot flag is set to TRUE, that means we have already
    // given the items to the player, there is no need to continue
    // running this script.
    if ( WR_GetPlotFlag( PLT_MY_CUSTOM_PLOT, MY_ITEM_CHECK_FLAG ) == TRUE )
        return;

    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev);

    // We will watch for every event type and if the one we need
    // appears we will handle it as a special case. We will ignore the rest
    // of the events
    switch ( nEventType )
    {
        // This event happenes every time the module loads
        // This usually happenes when creating a new game
        // or loading a savegame
        case EVENT_TYPE_MODULE_LOAD:
        {
            // The UT_AddItemToInventory function adds various resources to a
            // creature's inventory. Here we add one weapon and one shield.
            UT_AddItemToInventory(R"my_armor_bow.uti", 1);
            UT_AddItemToInventory(R"my_armor_.uti", 1);
            UT_AddItemToInventory(R"my_armor_boots.uti", 1);
            UT_AddItemToInventory(R"my_armor_gloves.uti", 1);
            UT_AddItemToInventory(R"my_armor_ring", 1);
            UT_AddItemToInventory(R"my_armor_tunic.uti", 1);



            // Set our plot flag to TRUE, so the next time this script tries
            // to run it will not add extra items to the player's inventory
            WR_SetPlotFlag( PLT_MY_CUSTOM_PLOT, MY_ITEM_CHECK_FLAG, TRUE );

            // We have dealt with the event we were waiting for.
            // At this point we can stop looking for other events
            break;
        }
        default:
            break;
    }
}
// ---- SCRIPT ENDS HERE ----

Is this a right script? By the way demo is the weapon, been practicing.

However, there is also another problem, when i do Export - Export without dependent variables, it says in the log that there was "No area specified for campaign". I have tried almost everything to get rid of the error but it just sticks there Posted Image

Can someone please help me on these matters, btw im quite new to Toolset Posted Image

#2
Dansharp1

Dansharp1
  • Members
  • 103 messages
// ---- SCRIPT STARTS HERE ----



// Later on in this script, we will use the UT_AddItemToInventory()

// function to add an item to the player's inventory.

// But before we could use it, we have to tell the toolset where

// to look for it. The function is in the "utility_h" script file

// under _Core Includes, we will include this file at the top of

// our script file, above the main function.



#include "utility_h"

#include "plt_my_custom_plot"



void main()

{

// If our plot flag is set to TRUE, that means we have already

// given the items to the player, there is no need to continue

// running this script.

event ev = GetCurrentEvent();

int nEventType = GetEventType(ev);



// We will watch for every event type and if the one we need

// appears we will handle it as a special case. We will ignore the rest

// of the events

switch ( nEventType )

{

// This event happenes every time the module loads

// This usually happenes when creating a new game

// or loading a savegame

case EVENT_TYPE_MODULE_LOAD:

{

// The UT_AddItemToInventory function adds various resources to a

// creature's inventory. Here we add one weapon and one shield.

UT_AddItemToInventory(R"demo.uti", 1);

// Set our plot flag to TRUE, so the next time this script tries

// to run it will not add extra items to the player's inventory

WR_SetPlotFlag( PLT_MY_CUSTOM_PLOT, MY_ITEM_CHECK_FLAG, TRUE );



// We have dealt with the event we were waiting for.

// At this point we can stop looking for other events

break;

}

default:

break;

}

}

// ---- SCRIPT ENDS HERE ----



Beg my parden xD

#3
Proleric

Proleric
  • Members
  • 2 352 messages
You mention that you can't get your module to load under Other Campaigns. What exact symptom do you have? For example, is the module not listed at all?

Regarding the start area, in the module properties (File > Manage Modules > Properties) you must specify the start area and waypoint.

The following script should work. Note that by using an event which only runs once per game (MODULE_START), there's no need for a plot flag check. Also, all module events are passed to the default script, which ensures that all the other good things in the game happen.

// Module Event Script
//
// Proleric 06-Feb-2010
//
// Events handled :
//    - Module start         
//
// Any event not handled is passed to the Bioware core script.

#include "events_h"
#include "global_objects_h"
#include "sys_chargen_h"
#include "utility_h"
#include "sys_rewards_h"
void main()
{
    event ev            = GetCurrentEvent();
    int   nEventType    = GetEventType(ev);
    int   bEventHandled = FALSE;
    switch(nEventType)
    {
         case EVENT_TYPE_MODULE_START:
         {
            UT_AddItemToInventory(R"demo.uti");
            break;
         }
    }
    if (!bEventHandled)
    {
        HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
    }
}


Modifié par Proleric1, 26 juillet 2010 - 04:30 .


#4
Dansharp1

Dansharp1
  • Members
  • 103 messages
Well 2 of my modules appear inc. my main one but when I try to load the module in "Other Campaign" it comes up on the page for loading then it cuts out saying "Unable to Load Module". Just tried the waypoint and starting area as redcliffe and it works yet the module can't load and still comes up with the same message "Unable to load module". The game recognizes it as a module, however, it doesn't seem to want to load it. I have set all the settings according to what it should be.

Modifié par Dansharp1, 29 juillet 2010 - 05:31 .


#5
Dansharp1

Dansharp1
  • Members
  • 103 messages
Please can you help me with this issue.

#6
TimelordDC

TimelordDC
  • Members
  • 923 messages
It appears you've set your module to extend the Single Player in which case it will not appear as a separate campaign. Just load up a save game from the Single Player campaign and you should get your items.

#7
Dansharp1

Dansharp1
  • Members
  • 103 messages
I tried that but it doesn't show up. I used the script and that works but the item still won't show up :(
I export the item and script from "Export without Dependent resources". Should i try Dependent? Or what should i do. I saw this log in the window log : E: 15:05:26 - Could not get starting area resource information. How do i make this message go away? I think this is what is causing it from not going into the game.

Modifié par Dansharp1, 05 août 2010 - 06:13 .


#8
TimelordDC

TimelordDC
  • Members
  • 923 messages
If it is an add-in, that message can be ignored.



Does the script compile successfully? It would be helpful if you could add some debug messages to your script and check the log files. Add PrintToLog or DisplayFloatyMessage commands in your script - preferably before and after the UT_AddItemToinventory commands and check the log file or in-game respectively.

#9
Dansharp1

Dansharp1
  • Members
  • 103 messages
when i entered the script which i got from Proleric1, it came up with the message in log window : "Could not get starting area resource information".

I will try the printtolog and displayfloatymessage commands. As im new to toolset scripts, what should i put exactly into the script? should it just be PrintToLog as its own before the inventory command or something with it? Like eg: event ev            = GetCurrentEvent(); Or #include "events_h".


And yes it does complete compilying succsesfully, Here is what my log says:

I: 06:40:46 - the_sword_of_kratos.nss - The resource "the_sword_of_kratos.nss" has been checked in.
I: 06:40:46 - the_sword_of_kratos.nss - The resource "the_sword_of_kratos.nss" has been saved.
I: 06:40:46 - Offers.xml file has been updated successfully.
I: 06:40:46 - AddIns.xml file has been updated successfully.
E: 06:40:46 - Could not get starting area resource information.
I: 06:40:46 - Compile successful.
I: 06:40:45 - Compiling the_sword_of_kratos.nss...


Or could you please show me how u would do it with my script? Heres the script im using:

//
// Proleric 06-Feb-2010
//
// Events handled :
//    - Module start
//
// Any event not handled is passed to the Bioware core script.
#include "events_h"
#include "global_objects_h"
#include "sys_chargen_h"
#include "utility_h"
#include "sys_rewards_h"
void main()
{
    event ev            = GetCurrentEvent();
    int   nEventType    = GetEventType(ev);
    int   bEventHandled = FALSE;
    switch(nEventType)
    {
                       case EVENT_TYPE_MODULE_START:
         {
            UT_AddItemToInventory(R"might_of_the_king.uti");
            break;  
         }
    }
    if (!bEventHandled)
    {
        HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
    }
}

The Message comes up whenever i want to export without dependent resources on both the Item and the script.

Modifié par Dansharp1, 06 août 2010 - 09:57 .


#10
Dansharp1

Dansharp1
  • Members
  • 103 messages
please can someone help me with this i really want to have my own creations in DA