A realistic infinate leveling system that can be reflected in resources! perfect for that RPG you're working on!
BlueScreenODeath for his Adding REAL EXP to RPGs Guide, which this system is based on.
invent00r, for quickly making me a QV Grant Resources trigger.
A guide on how to make an infinite leveling system using units killed cost, and how to show a player’s level and EXP in chats as well as reflecting them in a player’s resource count.
•AoM: TT
•Oddy’s QV Triggers. You can download them in reyk’s
•Mune84's
Active
Conditions:
Always
For this part, you have to know what the enemies in your scenario are, as well as their cost. This should be easy with Age of Mythology Unit Statistics v2.0.
Now, let’s say that the enemies in your scenario only have centaurs. Centaurs cost 12 favor and 200 wood. At this point, you should pick a resource, any resource. It has no effect on the player’s resource cost or anything like that. I’m picking gold for mine.
Modify Protounit
Protounit: Centaur
Player: (the enemy)
Field: Cost Wood
Delta: -200
At this point, you want your unit to cost nothing at all. Because I know that a centaur cost 12 favor and 200 wood, I’m using this effect to make the enemy’s centaurs cost 0 wood. You can change the centaur to whatever unit the enemy in your scenario has, but be sure to change the resources and the delta depending on the cost of the units. My next effect (still in the first trigger) would be
Protounit: Centaur
Player: (the enemy)
Field: Cost Favor
Delta: -12
Now, I chose gold as my resource, so I’m going to give the centaur an EXP value. If you want a centaur to be worth 10 EXP, then you would make an effect with the following:
Protounit: Centaur
Player: (the enemy)
Field: Cost Gold
Delta: 10
So now my enemy centaur costs 10 gold. End of Trigger #1. Now,
Active
Conditions:
Always
Effects:
Quest Var Set
Var Name: Subtract
Value: 100 (The number of EXP points the player needs to reach Level 1.)
Trigger_3:
Active, Loop
Conditions:
QV Stat Value
Fake Player: (Player that’s leveling up)
Stat Type: Units Killed Cost
Operator: >
QV Point Zero: Subtract
Value: 100 (The number of EXP points the player needs to reach Level 1.)
Effects:
(Whatever you want to happen when the player levels up)
Quest Var Modify
Var Name: Level
Operator: +
Amount: 1 (This effect will be important in part two)
Quest Var Modify
Var Name: Subtract
Operator: +
Amount: 100
Quest Var Modify
Var Name: Subtract2
Operator: +
Amount: 10 (You can customize this {see below})
Quest Var Modify 2
Var Name: Subtract
Operator: +
Var Name: Subtract2
Grant Resources:
Player: (the player that’s leveling)
Amount: 1
Resource: Favor (this is the resource you want to be equal to the player’s level. Make sure it is a resource the player can’t collect! If you don’t want to do this, then skip it.)
The amount of “Subtract2” is very important. In the trigger above, I said the player needed 100 EXP to level up. Now the player has 100, and I don’t want him to keep leveling over and over again. So, I made Subtract increased by Subtract2 every time the player levels up, and made Subtract2 increase by 10 ever time the player levels up. This means that the player needs 100 EXP more than 100+10 to level up. Notice that I set it as 110 instead of 100. Now my player needs 110 EXP for a level up, making it harder for him to get a level up each time he levels up.
And there’s your basic infinite leveling system! In only 2 triggers!
Active, Loop
Conditions:
Always
Effects:
QV Set Stat Value
Var Name: EXP
Fake Player: (Same player as all those other times)
Stat Name: Units Killed Cost
This effect makes the Quest Var “EXP” equal to the player’s EXP. However, if the player leveled up, it would say the total amount of EXP, not his current amount. So, we have our next effect:
Var Name: EXP
Operator: -
Var Name 2: Subtract (Remember this QV from part one? It’s back! This will subtract all the EXP from the previous levels.)
Now, we have the player’s EXP in a Quest Var. And the good part is, thanks to the looping, it will keep updating itself throughout the entire game.
Active, Loop
Conditions:
Let’s say that we want the message to show whenever the player kills a unit. You would do this:
Stat Type: Enemy Units Killed
Operator: >
QV Point Zero: Killed
Value: 1
Effects:
Quest Var Modify:
Var Name: Killed (Depending on the name you put in the conditions)
Operator: +
Amount: 1
QV Send Chat
Message before: (Something like) You have
Var Name: EXP
Message after: EXP.
If the player has 80 EXP, it will show up as “You have 80 EXP”. If you are making a multiplayer scenario, you may wish to use “{playername(1)}has”
as the message before. You will have to change the 1 to whatever player the message is for.
Next, to make a message showing the level (much easier!)
Active
Conditions:
(Whatever you want)
Effects:
QV Send Chat
Message before: You are level
Var Name: Level (I told you it would be important later on!)
Message after: . Congratulations!
Refer to the trigger above. SAVE YOUR SCENARIO!
Choose a resource, but make sure it is a resource the player can’t collect in the scenario! If you don’t want to do this, or if your player can collect every resource, skip this part.
Trigger_6:
Active
Conditions
QV Stat Value
Stat Type: Enemy Units Killed Cost
Operator: >
QV Point Zero: EXP2
Value: 1
Effects
Grant Resources:
Player: (the player that’s leveling)
Amount: 1
Resource: Food
Quest Var Modify
Var Name: EXP2
Operator: +
Amount: 1
Close Age of Mythology.
Find your way to your AoM installation folder, and open the trigger folder. With Notepad, open a file called typetest.xml. Copy the trigger below and past it there. If you requested a condition, then place it under or under effects if it was an effect you requested.
<Effect name="QV Grant Resources">
<Param name="PlayerID" dispName="$$22301$$Player" varType="player">1</Param>
<Param name="ResName" dispName="$$22455$$Resource" varType="resource">food</Param>
<Param name="QVName" dispName="$$32954$$Var Name" VarType="string">QV1</Param>
<Command>trPlayerGrantResources(%PlayerID%, "%ResName%", trQuestVarGet("%QVName%");</Command>
</Effect>
Close it, and run Age of Mythology again.Active
Conditions:
Always
Effects:
QV Set Stat Value
Var Name: EXP2
Fake Player: (Same player as all those other times)
Stat Name: Units Killed Cost
So now this new QV is the same as the total amount of EXP our player has amassed. Time to change that to current EXP.
Var Name: EXP2
Operator: -
Var Name 2: Subtract (This QV really comes in handy, doesn’t it?)
Now we have the current EXP. But there is one more effect that will be important later on.
Var Name: EXP2
Operator: -
Var Name 2: Previous
Now, to fire the next trigger (IMPORTANT! You must use fire event, NOT Loop!)
Trigger_7:
Active
Conditions:
Always
Effects:
QV Grant Resources (It should appear under effects. If not, you did something wrong with the new trigger).
Player: (the player that’s leveling)
Resource: Food (This is what I put, you should do whatever you chose at the beginning of this part.)
Var Name: EXP2
QV Set as Player Resource Count
Player: (the player that’s leveling)
Resource: Food (whatever you put in the previous effect)
Var Name: Previous
Fire Event: Trigger_6
So, now we granted the player food equal to the amount of EXP2, which is equal to EXP. Or is it? As you can see, “Previous” is set to the previous amount of EXP2. In the trigger above, Previous is subtracted from EXP2, so if these two triggers occur in a period of time when the player didn’t get any EXP, they wouldn’t get any food. Because of the Fire Events, these triggers will keep firing each other forever.
THE END
[This message has been edited by TartarianCerberus (edited 11-27-2007 @ 07:15 PM).]