Modifié par gordonbrown82, 07 janvier 2010 - 01:04 .
creating starting characters with no weapons (solved)
Débuté par
gordonbrown82
, janv. 06 2010 04:42
#1
Posté 06 janvier 2010 - 04:42
i want the starting character to not have any weapons but the character creation automaticly assigns some weapons and armor to the ranger and fighter. is there any script i can use to remove these and put some commoner clothes on? preferably without some "item removed from inventory" message showing.
#2
Posté 06 janvier 2010 - 10:28
well then maybe a new question to help me on my way: what is the tag name for the clothes and sword that the fighter gets when the game starts? where can i look this up?
#3
Posté 06 janvier 2010 - 10:59
Use Chargen_ClearInventory(oHero); to get rid of the gear (#include "sys_chargen_h")
Use EquipItem(oHero, UT_AddItemToInventory(R"whatevertheresourcenameis.uti")); to put something on them (#include "utility_h")
Use EquipItem(oHero, UT_AddItemToInventory(R"whatevertheresourcenameis.uti")); to put something on them (#include "utility_h")
#4
Posté 07 janvier 2010 - 12:01
Ok, though i'm not sure where to put either function. For now i have the Chargen_clearInvetory() function like below in the main module script but that will probably remove all the equipment from the character every time an event is sent to the module and that's not good. I put it inside the case brackets as well but it didn't work then.
#include "events_h"
#include "global_objects_h"
#include "utility_h"
#include "sys_chargen_h"
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:
{
// preloads resources needed for character generation
PreloadCharGen();
// initiates character generation
StartCharGen(GetHero(),0);
break;
}
}
// if this event wasn't handled by this script fall through to the core script
if(!nEventHandled)
{
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
}
Chargen_ClearInventory(GetHero());
}
maybe i can help play test one of your modules as payment for this.
#include "events_h"
#include "global_objects_h"
#include "utility_h"
#include "sys_chargen_h"
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:
{
// preloads resources needed for character generation
PreloadCharGen();
// initiates character generation
StartCharGen(GetHero(),0);
break;
}
}
// if this event wasn't handled by this script fall through to the core script
if(!nEventHandled)
{
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
}
Chargen_ClearInventory(GetHero());
}
maybe i can help play test one of your modules as payment for this.
Modifié par gordonbrown82, 07 janvier 2010 - 12:05 .
#5
Posté 07 janvier 2010 - 12:11
There's a Chargen_End event, like so:
case EVENT_TYPE_CHARGEN_END: {
object oHero = GetHero();
if (!(WR_GetPlotFlag(PLT_PLOT_MAIN, GAME_STARTED))) {
if (GetLevel(oHero) == 1) {
Chargen_ClearInventory(oHero);
}
}
}
I used a plot flag and checked the level there to make doubly sure I wasn't stripping gear from characters levelling up (level-up counts as chargen).
case EVENT_TYPE_CHARGEN_END: {
object oHero = GetHero();
if (!(WR_GetPlotFlag(PLT_PLOT_MAIN, GAME_STARTED))) {
if (GetLevel(oHero) == 1) {
Chargen_ClearInventory(oHero);
}
}
}
I used a plot flag and checked the level there to make doubly sure I wasn't stripping gear from characters levelling up (level-up counts as chargen).
#6
Posté 07 janvier 2010 - 12:19
still not sure where to put that code. man i suck.
#7
Posté 07 janvier 2010 - 12:21
don't worry, I suck more
#8
Posté 07 janvier 2010 - 12:22
awwww
#9
Posté 07 janvier 2010 - 12:27
Putting that code in your module script will work.
I use ClearInventory() to strip the PC at the start of my module for their dream, and EquipItem(oHero, UT_AddItemToInventory(R"whatevertheresourcenameis.uti")); to add a bunch of stuff to the hero for testing, it does work
I use ClearInventory() to strip the PC at the start of my module for their dream, and EquipItem(oHero, UT_AddItemToInventory(R"whatevertheresourcenameis.uti")); to add a bunch of stuff to the hero for testing, it does work
#10
Posté 07 janvier 2010 - 12:39
thanks a lot that worked, i'm taking a crying break now.





Retour en haut






