void main()
{
//int GetIsNight(); //not sure how to use this... want it to fire one time per day, either at night or morning...
object oObject = GetFirstObjectInArea(OBJECT_SELF);
// Continue looping until there are no more objects left
while (oObject != OBJECT_INVALID)
// string sTag = GetTag(object oObject); //The base function
string sTag = GetTag(oObject); //I think this should return the tag of oObject
int iFN = 0; //number of friendly creatures in the area, based on their "Tax amount"
{
// Test to see if oObject is a townsperson. If so, add it up.
if (sTag = "Townsman")
iFN = (iFN + 5); //five gold for an average townsman
else (sTag = "TownsmanLv2");
iFN = (iFN + 8); //more gold for upgraded townspeople
// Move on to the next object
oObject = GetNextObjectInArea(OBJECT_SELF);
}
//Create Gold in the Mayor's office...would rather it go into the inventory of a chest, but near a desk for now
int nObjectType = OBJECT_TYPE_ITEM;
string sTax = "NW_IT_GOLD001";
location lTarget = GetLocation(GetWaypointByTag("Mayor_Desk"));//gets the waypoint by the Mayor's Desk
CreateObject(nObjectType, sTax, lTarget); //Make it so, Number One.
//How do I change the stack size so that iFN gold pieces apear?
}
I am unable to get this script to work, and it is probably a very basic lack of understanding on my part. The script is for a single player mod where you are an overlord, claiming land as you go. To encourage the player to protect against random incursions as well as investing in the town, you get an amount of money each day equal to the amount of townspeople you have.
I tried to write a script that gets tags and loops through them, adding an appropriate amount for each creature type. In the end, I would like to increase the stack size by the final integer from the loop. I have a few problems here:
1. I do not know how to make this fire once a day... maybe put it on the town mayor as a heartbeat...
2. I do not know how to increase the stack size of gold in the final create item function.
3. I keep getting issues with my "if" statement.
Last, I know this can be abused by resting 8 hours continually... can I put an actual timer on it?
Thank you to anyone who takes the time to read this. I hope it is interesting, at least.
Ret





Retour en haut






