Page 1 of 1
RPG Scoring/Cash sytem
Posted: Sat Feb 07, 2009 4:29 pm
by Sky_216
After having spent ages reading through both stock scripts and Mav's ffx lua, not to mention making a campaign level (that gets more and more complicated as it progresses), I feel like I'm ready to start making the story based map(s) I've been making sides and skins for. However, there's a couple of ideas I need to flesh out/learn the limits of, the most importanat one is a cash/scoring system.
Since each mission or 'chapter' is planned to be short (longer than a normal campaign mission - but shorter than ffx, reb ops or OFM), a leveling up system doesn't make much sense (there's another system that gives you a temporary health bonus for killing a certain kind of enemy, but once you die the change is gone). So I was thinking a system where you gain 'cash' which can be traded for items (gun upgrades, ammo increases, health packs, extra lives) at the 'market.' The simplest way to do the cash sytem (as far as I know) is to score a point per unit killed (more for certain enemies) and detract points fo buying items. Problem with this is I need some way of showing the cash points on screen, and aren't entirely sure how (maybe...using team 2's reinforcement count? and then just have a single hidden, unkillable enemy on team 2? Just an idea).
Second way of doing it (and I doubt this is possible), is to have a certain pickup item give you points, and enemies drop them at random instead of ammo or health packs. Like I said, unsure if its possible.
Re: RPG Scoring/Cash sytem
Posted: Sat Feb 07, 2009 9:04 pm
by ryukaji
The second one sounds like it would work better but thats only if an item can score points, but there are lines that determine the probability of dropping certain items at death
EDIT: I was looking at map scripts and one of them is called "points" and it has lines like
Code: Select all
{ point_gain = 5 }, --// PS_CON_CAPTURE_CP,
{ point_gain = 1 }, --// PS_CAP_PICKUP_FLAG,
But i dont have much knowledge in this area so i dont know how you would make a new line work
and they dont help much by commenting at the top by saying
Code: Select all
-- Format: { point_gain = number }, --// description
-- Notes: number should between [-128, 127]
-- If you need to ADD/REMOVE items, please ask programmer to change accordingly
-- enum PointStatT in PlayerStats.h
Re: RPG Scoring/Cash sytem
Posted: Sat Feb 07, 2009 11:01 pm
by [RDH]Zerted
Skyhammer_216 wrote:...have a single hidden, unkillable enemy on team 2...
Why? What would that unit be for?
You can't add another line in the point values, but you can change the existing ones. However, you don't have to base the money off of points. Just use a variable to hold how many points/money the player has. One something happens, like a strong monster is killed or a certain object is picked up, increase that money variable. If you want to display it, every time you change the variable, redisplay it on screen. You can display numbers through the reinforcement count, team points, or a non-active timer.
Re: RPG Scoring/Cash sytem
Posted: Sun Feb 08, 2009 12:24 am
by MasterSaitek009
[RDH]Zerted wrote:or a non-active timer.
That was my thought too. A frozen timer would be very noticeable to players.
Now.. giving a unit a new weapon... Don't units have to respawn before changes like that take place? On the other hand Health and Shields/Armour would be easy. Changing a weapons damage wouldn't be to hard either. Just use something like this.
Code: Select all
damageAdded = 50
OnObjectDamage(
function(object, damager)
--If the weapon that hit last is not your souped up weapon, or the the damager is not your RPG unit, or the object/unit you shot is dead, exit.
if GetObjectLastHitWeaponClass(object) != "NAME_OF_WEAPON" or damager != VarContainingYourUnit or object == nil then return end
SetProperty(object, "CurHealth", GetObjectHealth(object) - damageAdded)
end
)
Re: RPG Scoring/Cash sytem
Posted: Sun Feb 08, 2009 2:19 am
by [RDH]Zerted
Changing weapons and their stats will cause crashes in MP. However, they work fine in SP.
After changing a class' weapon you could kill the player, then directly force spawn him back to his old location. Since this will be SP, theres no reason to increase the damage through the lua like that. Change the odf properties instead. Theres no need to come up with workarounds if you can do something the way you're supposed to do it.
Re: RPG Scoring/Cash sytem
Posted: Sun Feb 08, 2009 4:16 am
by Sky_216
Skyhammer_216 wrote:After having spent ages reading through both stock scripts and Mav's ffx lua, not to mention making a campaign level (that gets more and more complicated as it progresses), I feel like I'm ready to start making the story based map(s) I've been making sides and skins for. However, there's a couple of ideas I need to flesh out/learn the limits of, the most importanat one is a cash/scoring system.
Since each mission or 'chapter' is planned to be short (longer than a normal campaign mission - but shorter than ffx, reb ops or OFM), a leveling up system doesn't make much sense (there's another system that gives you a temporary health bonus for killing a certain kind of enemy, but once you die the change is gone). So I was thinking a system where you gain 'cash' which can be traded for items (gun upgrades, ammo increases, health packs, extra lives) at the 'market.' The simplest way to do the cash sytem (as far as I know) is to score a point per unit killed (more for certain enemies) and detract points fo buying items. Problem with this is I need some way of showing the cash points on screen, and aren't entirely sure how (maybe...using team 2's reinforcement count? and then just have a single hidden, unkillable enemy on team 2? Just an idea).
Second way of doing it (and I doubt this is possible), is to have a certain pickup item give you points, and enemies drop them at random instead of ammo or health packs. Like I said, unsure if its possible.
Pretty sure I answered my own question in paragraph 2. The way it works is pretty much the same as Mav's level system from FFX (uses some of the same code - based on a variable). The important difference is setting the reinforcement count to the variable (skillcount). The weapons thing isn't an issue either - cash bought weapons and powerups are bought at a 'market' - I'll implement that systemof killing and respawning Zerted suggested so every time you buy a weapon upgrade you'll get respawned at the market CP.
Also, team 2 doesn't need any units? Sweet.
Re: RPG Scoring/Cash sytem
Posted: Sun Feb 08, 2009 2:17 pm
by [RDH]Zerted
If you don't use any of the of the game's official Objectives then yes, the map will only end when you tell it to end.
Re: RPG Scoring/Cash sytem
Posted: Sun Feb 08, 2009 2:28 pm
by bobfinkl
I know it would be sloppy but couldn't you use the "money" that Zerted mentioned and the weapon unlock system to allow weapon pickups, my theory is to use the variable point value to give the unit that weapon if they have Y number of points and the unit holding that weapon drops Y points? (sorry if this is unclear how I said it)
Re: RPG Scoring/Cash sytem
Posted: Mon Feb 09, 2009 7:38 pm
by ryukaji
bobfinkl wrote:I know it would be sloppy but couldn't you use the "money" that Zerted mentioned and the weapon unlock system to allow weapon pickups, my theory is to use the variable point value to give the unit that weapon if they have Y number of points and the unit holding that weapon drops Y points? (sorry if this is unclear how I said it)
If im understanding you I dont think he wants weapon pick-ups he wants them bought from a store. And i dont think you can "drop" points and I'm wondering how a store would be possible. Is there a way to display weapons and prices and select one or were you planning on weapon upgrades not having choice to what you upgrade to.
Re: RPG Scoring/Cash sytem
Posted: Mon Feb 09, 2009 8:05 pm
by Tygr
For the store, you could have weapon models as destroyable props, and when the player shoots one, it will deduct that weapon's cost and give it to the player. If the player doesn't have enough points, the weapon prop will immediately respawn.
Re: RPG Scoring/Cash sytem
Posted: Mon Feb 09, 2009 8:07 pm
by Sky_216
ryukaji wrote:bobfinkl wrote:I know it would be sloppy but couldn't you use the "money" that Zerted mentioned and the weapon unlock system to allow weapon pickups, my theory is to use the variable point value to give the unit that weapon if they have Y number of points and the unit holding that weapon drops Y points? (sorry if this is unclear how I said it)
If im understanding you I dont think he wants weapon pick-ups he wants them bought from a store. And i dont think you can "drop" points and I'm wondering how a store would be possible. Is there a way to display weapons and prices and select one or were you planning on weapon upgrades not having choice to what you upgrade to.
Here's how it works (got the cash/point system working now).
Most is through lua coding. It's for a singleplayer RPG/story, not a norml game mode. Points are displayed in the place of team 2 reinforcements.
Every time you kill an enemy, your points increases (by 1 for a standard enemy, 2 for an advanced enemy, more for bosses/elite enemies). Every time you pick up an 'artifact' (actually a flag with different model....dissappears instantly when you pick it up), your points go up by 10.
In a certain area (the 'market') there are stalls with NPCs in them. Each one sells one item/upgrade. Now, I need two weapons to get it to work properly, 'talk' and 'action.' Use talk on a market stall owner, and they tell you what they sell, how much it is, what it does. Use 'action', and you get whatever the upgrade/item is and get the cost of it detracted from your cash/credits/score. You get instantly respawned in the middle of the market if you bought a weapon/weapon upgrade (don't if you bought a health bonus/life). So you have to (1) earn points, then (2) go to the market to get things with them.
Re: RPG Scoring/Cash sytem
Posted: Mon Feb 09, 2009 9:12 pm
by [RDH]Zerted
Since you have to walk up to the seller to talk/buy from them, why not just give each one a close region. When the player walks into the region, the seller automatically starts talking. That would save you from using another weapon and save the players from needing to learn how to use it.
Re: RPG Scoring/Cash sytem
Posted: Mon Feb 09, 2009 9:15 pm
by Sky_216
@Zerted: Good idea, will do.