Aller au contenu

Photo

I'm looking for a script for the start of my module


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

#1
ginger samurai

ginger samurai
  • Members
  • 13 messages
 Hey forum,
  I am working on a game, I'm looking without success for two things I was hoping to get help with
I assume many many people come across this (I would say almost every game needs these) yet I cannot find reference to this in the forum or any tutorial I've done:
1. Setting/Normalizing the level of all the characters in a party.
2. Removing all pre-existing equipment.

*scene* player is starting the game, and registers their party, SoZ style (completely set up), and upon approaching the doorway out, they hit an OnEnter trigger that prospectively performs the two functions enumerated above. I've been learning scripting, so if the answer is a simple command, I should be able to sort it out. Once in the game they can be given a set amount of money, as well as access to a shop, so as to keep this as simple as possible.

Thanks!
-gs;)

#2
The Fred

The Fred
  • Members
  • 2 516 messages
This is something not uncommon to modules. Try the following code snippets:

//This will remove all items from oPC's inventory.
object oItem = GetFirstItemInInventory(oPC);
while(GetIsObjectValid(oItem))
{
    DestroyObject(oItem);
    oItem = GetNextItemInInventory(oPC);
}

//This will remove all items from oPC's equipment slots.
int nSlot;
for(n = 0; n <= NUM_INVENTORY_SLOTS; n++)
{
    oItem = GetItemInSlot(nSlot, oPC);
    if(GetIsObjectValid(oItem))
    {
        DestroyObject(oItem);
    }
}

To set the level of an object, use SetXP();

Of course, if you have multiple players, you will want to loop through them doing this stuff to each one. Try something like:
object oEnt = GetEnteringObject();
object oPC = GetFirstFactionMember(oEnt);
while(GetIsObjectValid(oPC))
{
    //Do above stuff
    oPC = GetNextFactionMember(oEnt);
}

Hope that helps!

Modifié par The Fred, 03 juin 2011 - 09:24 .


#3
ginger samurai

ginger samurai
  • Members
  • 13 messages
This should help!

#4
ginger samurai

ginger samurai
  • Members
  • 13 messages

Modifié par ginger samurai, 05 juin 2011 - 02:22 .


#5
ginger samurai

ginger samurai
  • Members
  • 13 messages

Modifié par ginger samurai, 05 juin 2011 - 02:32 .