Aller au contenu

Photo

creating starting characters with no weapons (solved)


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

#1
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
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.

Modifié par gordonbrown82, 07 janvier 2010 - 01:04 .


#2
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
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
Mengtzu

Mengtzu
  • Members
  • 258 messages
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")

#4
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
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.

Modifié par gordonbrown82, 07 janvier 2010 - 12:05 .


#5
Mengtzu

Mengtzu
  • Members
  • 258 messages
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).


#6
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
still not sure where to put that code. man i suck.

#7
AnnoyingDisplayName

AnnoyingDisplayName
  • Members
  • 53 messages
don't worry, I suck more

#8
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
awwww

#9
Mengtzu

Mengtzu
  • Members
  • 258 messages
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 :)

#10
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
thanks a lot that worked, i'm taking a crying break now.