Aller au contenu

Photo

Doubling attribute points


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

#1
Rayean

Rayean
  • Members
  • 21 messages
I've created a small module that adds a few items into my game, and until recently it was working fine, but I had to change a few things to be able to distribute it. I've worked out a majority of the kinks, but a new one appeared where every individual attribute point distrributed during level up counts for two (1 point given to strength gives 2 points, etc.).
I cannot, for the life of me, figure out how to fix this. Someone suggested that I " need to override module_core with your module script, not module_core. That should fix the stat problems.", but I've no idea where to do this. any help would be appreciated.

Modifié par Rayean, 18 novembre 2009 - 02:10 .


#2
Rayean

Rayean
  • Members
  • 21 messages
Double, deleted.

Modifié par Rayean, 17 novembre 2009 - 11:24 .


#3
Rayean

Rayean
  • Members
  • 21 messages
Bump, still lost on this one :/

#4
weriKK

weriKK
  • Members
  • 106 messages
It's a bit hard to give any kind of advice without actually seeing what you have, but from what you say this might work:



In the Toolset:

- File->Module Manager

- Select your module and click properties

- Take a look at the Script field. If it says "module_core", try to change it to (None)

#5
Ambaryerno

Ambaryerno
  • Members
  • 532 messages
I think weri is right on this, someone specifically identified this as a problem using module_core as the script field.

#6
Rayean

Rayean
  • Members
  • 21 messages
Sadly, that did nothing to fix the problem. I'm using an _additemonload script in the field to run the itemload script for multiple items within the module itself. I'll go ahead and post the script I'm using because it's quite possible I changed something in it I shouldn't have. Its a modified version from the item tutorial, and...well, it -was- working better before this happened.

// ---------- Script Starts Here ----------

// Includes for utility functions and event definitons
#include "utility_h"
#include "wrappers_h"
#include "events_h"

void main()
{
// We need to retrieve the event that called our script
// and only act if it is the one we are waiting for
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);

// We also need the object representing the player's main character.
object oPC = GetHero();

// We use the ARCANE_ARMOR_GIVEN variable to check whether we already run the
// script in this play session and gave the sword to the player!
int nDoOnce = GetLocalInt(OBJECT_SELF, "ARCANE_ARMOR_GIVEN");

// If we have not run the script yet:
if ( nDoOnce != 1 )
{
// We look for the even that we need
switch(nEventType)
{
// If our module just loaded - which happens somewhere during
// the loading of a savegame or resuming an old game -
// we add the sword to the player during the loading screen
case EVENT_TYPE_MODULE_LOAD:
{
// First we make sure that we don't have the item yet
// fro manother gameplay session!
int nHas1 = CountItemsByTag(oPC, "amr_mel_boo_justice");
int nHas2 = CountItemsByTag(oPC, "amr_mel_che_justice");
int nHas3 = CountItemsByTag(oPC, "amr_mel_hel_justice");
int nHas4 = CountItemsByTag(oPC, "amr_mel_glo_justice");
int nHas5 = CountItemsByTag(oPC, "amr_mis_rng_avarice");
int nHas6 = CountItemsByTag(oPC, "amr_mis_rng_generosity");
int nHas7 = CountItemsByTag(oPC, "amr_mis_nec_pride");
int nHas8 = CountItemsByTag(oPC, "wep_mel_lsd_sin");
int nHas9 = CountItemsByTag(oPC, "amr_mel_shd_penance");
int nHas10 = CountItemsByTag(oPC, "amr_mis_blt_relief");

// If we do not, then we add it to the inventory
if ( nHas1 == 0 )
UT_AddItemToInventory(R"amr_mel_boo_justice.uti");
if ( nHas2 == 0 )
UT_AddItemToInventory(R"amr_mel_che_justice.uti");
if ( nHas3 == 0 )
UT_AddItemToInventory(R"amr_mel_hel_justice.uti");
if ( nHas4 == 0 )
UT_AddItemToInventory(R"amr_mel_glo_justice.uti");
if ( nHas5 == 0 )
UT_AddItemToInventory(R"amr_mis_rng_avarice.uti");
if ( nHas6 == 0 )
UT_AddItemToInventory(R"amr_mis_rng_generosity.uti");
if ( nHas7 == 0 )
UT_AddItemToInventory(R"amr_mis_nec_pride.uti");
if ( nHas8 == 0 )
UT_AddItemToInventory(R"wep_mel_lsd_sin.uti");
if ( nHas9 == 0 )
UT_AddItemToInventory(R"amr_mel_shd_penance.uti");
//else ( nHas10 == 0 ) // Will never be called since all of the above are true.
if ( nHas10 == 0 )
UT_AddItemToInventory(R"amr_mis_blt_relief.uti");
break;
}
}

// Update the ARCANE_ARMOR_GIVEN variable to signal that the script
// finished properly and does not have to run again during this session.
SetLocalInt(OBJECT_SELF,"ARCANE_ARMOR_GIVEN", 1);
}

// As we are done with all our stuff, we pass the it back to the
// original script, so it can deal with the rest of the core functions.
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
}
// ---------- Script Ends Here ----------

#7
weriKK

weriKK
  • Members
  • 106 messages
hmm, this script looks very familiar :P



Yeah, you want to remove this part from the code:

// As we are done with all our stuff, we pass the it back to the
// original script, so it can deal with the rest of the core functions.
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);


#8
Rayean

Rayean
  • Members
  • 21 messages
AHA! I just found that after thumbing through yer gazillion comments as well :P. Thanks again, WeriKK.