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;)
I'm looking for a script for the start of my module
Débuté par
ginger samurai
, juin 03 2011 08:34
#1
Posté 03 juin 2011 - 08:34
#2
Posté 03 juin 2011 - 09:24
This is something not uncommon to modules. Try the following code snippets:
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:
Hope that helps!
//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
Posté 03 juin 2011 - 09:34
This should help!
#4
Posté 05 juin 2011 - 01:55
Modifié par ginger samurai, 05 juin 2011 - 02:22 .
#5
Posté 05 juin 2011 - 02:19
Modifié par ginger samurai, 05 juin 2011 - 02:32 .





Retour en haut






