Aller au contenu

Photo

Auto character level up not working properly


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

#1
Bassline204

Bassline204
  • Members
  • 26 messages
ok so i used this script to auto level my character at the start of the module

#include "sys_rewards_h"
 
const int FORCE_AUTOLEVEL = 2;
 
void main()
{
// keep track of whether the event has been handled
int nEventHandled = FALSE;
 
event ev = GetCurrentEvent();
switch(GetEventType(ev))
{
case EVENT_TYPE_MODULE_START:
{
object oHero = GetHero();
 
// [chargen code goes here]
 
// auto-level the player to level 10
RewardXP(oHero, RW_GetXPNeededForLevel(10), FALSE, FALSE);
SetAutoLevelUp(oHero, FORCE_AUTOLEVEL);
 
break;
}
}
 
// if this event wasn't handled by this script fall through to the core script
if(!nEventHandled)
{
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
}
}however when i run the game. I get stuck at a tutorial level up message and it pauses the game endlessly and i can't move on. How do i get out of this please

#2
Proleric

Proleric
  • Members
  • 2 350 messages
I suspect you need some chargen code at the point indicated by the comment. The wiki gives this example:

[dascript]
object oHero = GetHero();

// skip character generation
Chargen_InitializeCharacter(oHero);
Chargen_SelectGender(oHero, GENDER_MALE);
Chargen_SelectRace(oHero, RACE_HUMAN);
Chargen_SelectCoreclass(oHero, class_WARRIOR);
Chargen_SelectBackground(oHero, BACKGROUND_NOBLE);
[/dascript]

I have exactly the same level up code as your example. It works fine. Of course, the automatic levelling up is a bit lacking in finesse, but for testing purposes that's usually acceptable.

#3
Bassline204

Bassline204
  • Members
  • 26 messages
i have added the chargen code but it will still pause at the start of the game and i can't get out of it. That's my problem. I don't mind that auto leveling up is a bit lacking in finesse. I just want to play the game. I can't because it is endlessly paused.

#4
Proleric

Proleric
  • Members
  • 2 350 messages
Did you try disabling tutorials in the Options menu before starting the game?

I can't reproduce the problem, even with tutorials enabled, so maybe something else is pausing the game? What message are you getting, exactly?