Author Topic: Achievements mod  (Read 36697 times)

Offline Shoes

  • Commander
  • *****
  • Posts: 502
    • View Profile
Achievements mod
« on: July 07, 2013, 05:58:59 am »
The purpose of this thread is really more for me to ask general questions in one thread, instead of many. Also, I will outline the mod so people can feel free to recommend more elegant ways of proceding!

Purpose

The purpose of this mod is to award soldiers medals for their valor in combat. These medals would grant stat bonuses. In the future, they could be required before a soldier can equip a certain weapon or something. Or provide bonuses in specfiic conditions, like long range accuracy or vs alien accuracy.

Outline

This mod will act a lot like how promotions are done.

In the SoldierInfoState, there will be a new button that leads to SoldierMedalState that lists all the medals (and their effect) for the current soldier.

After a mission, the DebriefingState will check to see if a medal has been awarded. If one has, it will show which soldier got what (This is different from Promotions and Ranks, because there is only ever one new rank, but many possible new medals...).

In Soldier.cpp, I am adding the actual medal code. Perhaps I will make Soldier.cpp call Medal.cpp to keep things clean. I will be asking questions about how to do what I want to do at a later point.

Here is a link to my git repo branch : https://github.com/Shoes01/OpenXcom/compare/master...MEDALS

My first question is this : Where are all the strings located? :x I know they are all centralized for easier translation, I just can't find where!
« Last Edit: July 07, 2013, 06:39:31 am by Shoes »

Offline xracer

  • Commander
  • *****
  • Posts: 565
  • X-COM lover, we've gone at it everywhere
    • View Profile
Re: Achievements mod
« Reply #1 on: July 08, 2013, 06:11:12 pm »
*********WARNING TEXT WALL AHEAD*************

i like your ideas, i t would be great if you could do it :)
also if you don't mind it will be nice to do multiple awards of the same medals just like in RL, here is what i have suggested somewhere else

The leveling of the medals is based on a pin system (similar to that of real military units). This pin is placed on top of the ribbon once a second or subsequent award is received. Each medal can have its own specific threshold for receiving said subsequent awards.
As such this will be a template:
1st award    Medal/Ribbon
2nd Award    1st silver pin on ribbon
3rd Award    2nd silver pin
4th Award    3rd silver pin
5th Award    1st gold pin on ribbon which replaces the 3 silver pins
6th Award    2nd gold pin
7th Award    3rd gold pin
8th Award    1st Platinum pin on ribbon which replaces the 3 gold pins
9th Award    2nd Plat pin
10th Award     3rd Plat pin


Also this was a list of medals we had come up with ;)



1ST CATEGORY
Honor Cross Given to all units upon arrival as recognition for fighting the Alien threat, and for being part of the force to save humanity. This Medal does not have multiple awards it will only be given once.
Service Medal Given in recognition for serving for a specific number of months. The first award is received on the 6th month of service and all subsequent awards will also be received on the 6th month thereafter.
Military Cross Given to soldiers for been in a specific number of missions. The unit must meet a certain criteria such as having perform at least a certain number of action or using a certain number of time units.
Merit Star Given when a unit kills a certain number of Aliens
Star of GallantryGiven when a unit captures a certain number of live aliens, in any manner such as stun weapons/grenades; stun baton or simply knocking them out with an explosion, a melee attack or your bare fist!!!
Bolt's Cross This medal is given when a unit stuns a certain number of aliens with a stun baton (commander/leader).
Specialists Medal This medal is given when a unit stuns a certain number of aliens with one stun grenade/rocket.
Campaign Medal This medal is given when a unit serves “X” months in the specific area to receive that area campaign ribbon (e.g. North America, Central America, South America, Europe, Africa, etc.)
2ND CATEGORY
Grenadiers Medal Given when a unit kills 3 or more aliens with one grenade.
Marksman Medal Given when a unit kills an alien at over *** m with a weapon (this can then apply for all other weapons).
Proficiency Medal This medal is given when a unit reaches a certain number of kills with a specific weapon (replace weapon with pistol, rifle, heavy grenades, etc.) as such you can have a badge for each weapon.
Star of Valor This medal is given when a unit kills a certain number of alien in close quarters combat or hand-to-hand or stun-baton-to-hand, you get what i mean, and you must be a bad ass if you get close enough to try and capture or kill an alien like that.
Star of Courage This medal is given to a unit for not panicking, after 3-4 squad deaths, each with higher or equal rank.
Star of Sol This medal is given when a unit is the first trooper into X amount (where X is a large amount) of UFOs and alien bases.
Hell-raiser Medal   This medal is given when a unit kills a certain number of enemies with incendiary weapons.
Defender Medal This medal is given for being part of a successful base defense.
Longest Night This medal is given for participating “X” amounts night terror mission.
Black Cross Given to soldiers that survive friendly fire after being hit
3RD CATEGORY
Crimson Heart This medal is given when a unit survives a mission with health (25% or less).
Heart of Terra This medal is given to soldiers that survive the mission after falling unconscious from fatal wounds.
Order of Glory This medal is given when a unit kills 7 aliens in a single mission
Loneliest Number This medal is given when a unit is the sole survivor in a mission, this is given only when attacking a medium or above size UFO with at least 7 soldiers in a mission.
Order of Earth This medal is given when a unit clears a UFO of medium/large size
Nike Cross This medal is given when a unit kills all aliens in a mission
Medal of Heroism
Distinguished Service
Sedgwick's Cross This medal is given when the highest ranking soldier kills enemy commander before any of his men
Eagled Eyes This medal is given to a unit for sighting the first of a new Alien species
Star of Asclepius   This medal is given when a unit survives a battle after being shot (at) more than 10 times by enemy units.
Prowler Cross This medal is given to a unit for being the first to capturing a live alien, for each alien race
Man of Steel This medal is given when a units survives a battle after being hit 5 times or more by enemy units
Dying Kill Medal    This medal is given when a unit kills an Alien with a grenade, after the unit has died. (Aliens turn)(if game allows to track your fallen units)
Demolition-Man    This medal is given to a unit for blowing up a whole UFO (if possible) 
Ace in the Hole    This medal is given when a unit kills an enemy with last round in his inventory
Senile Medal This medal is given when a unit kills an enemy with projectile weapon while enemy is in Fog of War
Terran Cross This medal is given for achieving mission objectives as the highest rank left standing after your squad has taken fatalities (only if you weren't the highest rank at the start)
Meritorious Citation This medal is given for leading the team that recovers a specific piece of alien tech (highest rank soldier in the mission only)
Order of the fallen This medal is given to any soldier fallen in combat (if the system allows tracking and displaying your fallen units)(Medal does not have multiple awards)
Valiant Crux   This medal is given to a unit for completing a terror mission without a single civilian casualty



The categories are just based on rarity, meaning category one basically every single soldier could achieve them sooner or later however category 3 not many will achieve them if any ;) it is simply to tie you to your soldiers so they are not simple cannon fodder :)
« Last Edit: July 10, 2013, 06:20:54 am by xracer »

Offline Shoes

  • Commander
  • *****
  • Posts: 502
    • View Profile
Re: Achievements mod
« Reply #2 on: July 09, 2013, 06:09:49 am »
This is great! I am not too creative or informed about RL military stuff, so this is great. I will be referring to this when I eventually get this mod working.

Offline xracer

  • Commander
  • *****
  • Posts: 565
  • X-COM lover, we've gone at it everywhere
    • View Profile
Re: Achievements mod
« Reply #3 on: July 09, 2013, 07:12:55 am »
hey before you start or rather complete it, i would like to see if can get together to talk a little bit :P i have been on IRC hunting you down, and i just missed you by 5 min :(

check this album, https://plus.google.com/u/1/photos/117436529281832067974/albums/5894756605877745809 is what i would like to do and since you can code :)

Let me know

Offline Shoes

  • Commander
  • *****
  • Posts: 502
    • View Profile
Re: Achievements mod
« Reply #4 on: July 10, 2013, 05:38:59 pm »
Oh my, I think you over estimate my ability to code! Wayboy is holding my hand throughout this a lot. You're looking at increasing the resolution of the game so you can display more stats and info, is that it?

Offline xracer

  • Commander
  • *****
  • Posts: 565
  • X-COM lover, we've gone at it everywhere
    • View Profile
Re: Achievements mod
« Reply #5 on: July 10, 2013, 06:06:50 pm »
well you are much farther ahead than I am :) and my coding skills are zero, what i am trying to do is merge the inventory screen with the stats screen, i gave it a try but the compiler spit out in my face :)

Warboy was looking at the code also i don't think he got it to work either is truly a mess (your welcome) i will keep on modifying it and maybe a code magician (read warboy) will decide to help me :)

In any case that is what i have planned, as well a fixing my control panel and adding a little higher resolution artwork. but that is down the road and if this works.

Offline Shoes

  • Commander
  • *****
  • Posts: 502
    • View Profile
Re: Achievements mod
« Reply #6 on: July 11, 2013, 12:25:42 am »


It is taking shape!

More pictures : https://imgur.com/a/ByD9T#0

More still : https://i.imgur.com/hjJKYLl.png

Added the ability to cycle through your soldiers. Attempted to add descriptions, but as expected, it gets cut off by the columns : https://imgur.com/a/hrYSN
« Last Edit: July 11, 2013, 04:57:44 pm by Shoes »

Offline cort

  • Sergeant
  • **
  • Posts: 43
    • View Profile
Re: Achievements mod
« Reply #7 on: July 11, 2013, 06:54:44 pm »
Regarding the descriptions, maybe you can find some inspiration from the "Advanced options".


Offline xracer

  • Commander
  • *****
  • Posts: 565
  • X-COM lover, we've gone at it everywhere
    • View Profile
Re: Achievements mod
« Reply #8 on: July 11, 2013, 08:08:08 pm »
that is not a bad idea show the medals above and the description at the bottom once selected. to keep it all in one screen, good thinking cort

Offline Shoes

  • Commander
  • *****
  • Posts: 502
    • View Profile
Re: Achievements mod
« Reply #9 on: July 11, 2013, 10:01:13 pm »
Thanks cort! I am looking into it now.

Got the pop up working : https://i.imgur.com/VErg1VC.png

I will change to hover text anyway because that is more user friendly.

Now I got the mouse over working as well! https://imgur.com/a/cNROj ; I haven't removed the pop up yet ... because why not, right?

A behin the scenes change : I have moved all the code inside Soldier into a new file, SoldierMedals, because these medal checks are gonna take up some space!

More stuff : some medals are handed out at the end of the month, and kills per race are now being tracked, albeit incorrectly! I have to work on that part...
« Last Edit: July 17, 2013, 08:39:23 pm by Shoes »

Offline Shoes

  • Commander
  • *****
  • Posts: 502
    • View Profile
Re: Achievements mod
« Reply #10 on: October 21, 2013, 12:21:15 am »
So I have restarted work on this mod, and here is the latest update:

https://i.imgur.com/y6f2Q6P.png

Mission regions and mission types are tracked, and medals are awarded accordingly. The same is already done with race kills, but I will be able to display them soon. After that, I will work on tracking which guns a soldier used to get kills or stuns, and then award more medals based on that.
« Last Edit: October 21, 2013, 01:14:06 am by Shoes »

Offline Hobbit Lord

  • Captain
  • ***
  • Posts: 64
    • View Profile
Re: Achievements mod
« Reply #11 on: October 21, 2013, 05:27:07 am »
1ST CATEGORY
Service Medal Given in recognition for serving for a specific number of months. The first award is received on the 6th month of service and all subsequent awards will also be received on the 6th month thereafter.
Does anyone actually have soldiers surviving more than 6 months? I suppose if you don't send them on any missions they'd get a medal for babysitting the base?[/td][/tr][/table]

Offline Shoes

  • Commander
  • *****
  • Posts: 502
    • View Profile
Re: Achievements mod
« Reply #12 on: October 23, 2013, 11:46:45 pm »
Here are some more pictures of the kind of details that could be found in the missions and kills stats.

https://imgur.com/a/H8MT2#0

Weapons are now tracked. Oddly enough, it's the weapon's ammo that is awarded the kill. I will look see if I can fetch the parent weapon.

https://i.imgur.com/qQWiHhH.png
« Last Edit: October 24, 2013, 12:49:19 am by Shoes »

Offline Shoes

  • Commander
  • *****
  • Posts: 502
    • View Profile
Re: Achievements mod
« Reply #13 on: October 28, 2013, 02:04:09 am »
In order for medals to move forward, I need to properly track statistics. This mod is slowly turning into a stat tracking mod, with medals as an aside ;p Here is my latest work

old : https://i.imgur.com/3XG3UAc.png



Each soldier will have their own diary listing their missions. I will also be adding more details as I keep working. I will also make the thing look ... not ugly. Maybe.

edit : things are looking better.
« Last Edit: October 28, 2013, 10:50:40 pm by Shoes »

Offline Sharp

  • Colonel
  • ****
  • Posts: 181
    • View Profile
Re: Achievements mod
« Reply #14 on: October 28, 2013, 10:40:57 am »
Looks pretty cool