Aller au contenu

Photo

Starting gold


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

#1
twcheney

twcheney
  • Members
  • 36 messages
I am creating a mod but I cannot get characters to start with any gold. How do I fix this?

#2
dunniteowl

dunniteowl
  • Members
  • 1 559 messages
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

#3
El Condoro

El Condoro
  • Members
  • 148 messages
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.

#4
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
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
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
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_*

Guest_Chaos Wielder_*
  • Guests
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);

}



}

#7
El Condoro

El Condoro
  • Members
  • 148 messages
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
M. Rieder

M. Rieder
  • Members
  • 2 530 messages

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
twcheney

twcheney
  • Members
  • 36 messages
Thanks for the replies. So far it seems to work. Later testing will tell.