I am creating a mod but I cannot get characters to start with any gold. How do I fix this?
Starting gold
Débuté par
twcheney
, déc. 25 2010 06:16
#1
Posté 25 décembre 2010 - 06:16
#2
Posté 25 décembre 2010 - 11:50
I am not scripting able to any real degree. That said, I believe in the opening of the game, you can create a Module Area (it only has to be a room that allows a merchant or items in it) and you can create something like a book for a character to sign in (similar to the roster item in SoZ) or maybe even a loot bag or something similar and give the characters a set amount of gold. There's other methods, all scripted, which include use of the GiveGold (or something similar) function and it can be set up for a set amount or based on level of the character, etc.
I know it's in there, I just don't know how to use it.
Merry Christmas and just tear the wrapping off those things under the tree!
dunniteowl
I know it's in there, I just don't know how to use it.
Merry Christmas and just tear the wrapping off those things under the tree!
dunniteowl
#3
Posté 25 décembre 2010 - 12:00
You can put a trigger around the entry point of the module and use the OnEnter routine of the trigger to call a script with GiveGold, as dunniteowl has said.
void main()
{
object oPC = GetEnteringObject();
GiveGoldToCreature(oPC, 100); // for 100gp
}
You can include other script stuff in this as well.
void main()
{
object oPC = GetEnteringObject();
GiveGoldToCreature(oPC, 100); // for 100gp
}
You can include other script stuff in this as well.
#4
Posté 25 décembre 2010 - 03:31
If your module starts with a conversation, you can put the script "ga_give_gold" in one of the conversation nodes. This will allow you to specify how much gold you want to give to the PC. You can also use this technique to give the PC items and other things as well.
#5
Posté 25 décembre 2010 - 03:51
On the module properties, there's a list of scripts including one called "on player module load" or something to that effect. Within that script, you can add in code to give gold to the PC. The script also runs when a player loads a saved game, so you have nest everything within a conditional to make sure it only runs once.
#6
Guest_Chaos Wielder_*
Posté 25 décembre 2010 - 03:54
Guest_Chaos Wielder_*
You could put El Condoro's script into the "On Client Enter" script portion of your mod. That would give 100 gold to entering PCs. Now, you'd have to set a variable to make sure this didn't happen again, so I'll modify it(credit where credit is due).
void main()
{
if(GetLocalInt(GetModule(), "MOD_GOLDONCE")!=1)
{
object oPC = GetEnteringObject();
GiveGoldToCreature(oPC, 100); // for 100gp
SetLocalInt(GetModule(), "MOD_GOLDONCE", 1);
}
}
void main()
{
if(GetLocalInt(GetModule(), "MOD_GOLDONCE")!=1)
{
object oPC = GetEnteringObject();
GiveGoldToCreature(oPC, 100); // for 100gp
SetLocalInt(GetModule(), "MOD_GOLDONCE", 1);
}
}
#7
Posté 25 décembre 2010 - 10:02
If it's an MP module, I guess you'd just change GetModule() to oPC and then every entering PC would get the gold. If using a trigger you might want to put a check for IsPC() if other critters wander around the area, too.
Modifié par El Condoro, 25 décembre 2010 - 10:05 .
#8
Posté 26 décembre 2010 - 01:25
El Condoro wrote...
If it's an MP module, I guess you'd just change GetModule() to oPC and then every entering PC would get the gold. If using a trigger you might want to put a check for IsPC() if other critters wander around the area, too.
That would be a funny bug! I can see it now, you kill a kobold and find that it had 10,000 GP!
#9
Posté 30 décembre 2010 - 12:23
Thanks for the replies. So far it seems to work. Later testing will tell.





Retour en haut






