FiLTHYESKiMO Posted March 2, 2012 Author Share Posted March 2, 2012 Scriptname HumanAging extends Forms {Player aging system.} int TheYear = GameYear.GetValue() GlobalVariable property GameYearVar auto int property Stage auto Perk property AgePerk1 auto Perk property AgePerk2 auto Perk property AgePerk3 auto Function AgePerks() ActorBase PlayerBase = Game.GetPlayer().GetBaseObject() as ActorBase Race PlayerRace = PlayerBase.GetRace() float GameYear = GameYearVar.Value If (PlayerRace == "Redguard" || "Imperial" || "Nord") If (GameYear <= 220) && (Stage == 0) Stage += 1 Game.GetPlayer().AddPerk(AgePerk1) elseif (GameYear >= 221) && (GameYear <= 231) && (Stage == 1) Game.GetPlayer().AddPerk(AgePerk2)Stage += 1 elseif (GameYear >= 241) && (Stage == 2) Game.GetPlayer().AddPerk(AgePerk3) endif endif endif endif endFunction Event OnInit() RegisterForUpdateGameTime(24) EndEvent Event OnRegisterForUpdateGameTime() AgePerks() EndEvent How about this? Link to comment Share on other sites More sharing options...
ramla Posted March 2, 2012 Share Posted March 2, 2012 This a great Idea!!! I do think 50 Hours/years is short for a life, but I guess life expectency in an environment where you are constantly fighting giant dragons and bears and other characters, is a given. I think all characters should be marryable, and should be able to get married in any temple or even by a jarl. Also if possible you should be able to become a General, king, jarl (I see yall already covered that), Leader of your own bandits crew or Militia. Again great idea! Link to comment Share on other sites More sharing options...
FiLTHYESKiMO Posted March 2, 2012 Author Share Posted March 2, 2012 (edited) Scriptname HumanAging extends Forms {Player aging system.} int TheYear = GameYear.GetValue() GlobalVariable property GameYearVar auto int property Stage auto float Age = PlayerAge.Getvalue() int property DayCount auto Perk property AgePerk1 auto Perk property AgePerk2 auto Perk property AgePerk3 auto Function AgePerks() ActorBase PlayerBase = Game.GetPlayer().GetBaseObject() as ActorBase Race PlayerRace = PlayerBase.GetRace() float GameYear = GameYearVar.Value If (PlayerRace == "Redguard" || "Imperial" || "Nord") If (GameYear <= 220) && (Stage == 0) Stage += 1 Game.GetPlayer().AddPerk(AgePerk1) elseif (GameYear >= 221) && (GameYear <= 231) && (Stage == 1) Game.GetPlayer().AddPerk(AgePerk2)Stage += 1 elseif (GameYear >= 241) && (Stage == 2) Game.GetPlayer().AddPerk(AgePerk3) endif endif endif endif endFunction Event OnInit() RegisterForUpdateGameTime(24) EndEvent Event OnRegisterForUpdateGameTime() DayCount += 1 AgePerks() if (DayCount == 364) PlayerAge.SetValue(Age + 1) DayCount = 0 endif EndEvent You are now supposed to be able to view your characters age. If anyone notices anything off with this script, let me know. EDIT: This will only count your players age from the first day the script is installed so it would be recommended to start a new game. I am, however, working on a way to calculate your age from the game hours played--which means it will work with any existing save. Edited March 2, 2012 by FiLTHYESKiMO Link to comment Share on other sites More sharing options...
yota71 Posted March 2, 2012 Share Posted March 2, 2012 (edited) On my opinion 50 real hours live its to short, you will never accomplish anything with this short time (asd my first playtrough had ended after 300+ hours) Edited March 2, 2012 by yota71 Link to comment Share on other sites More sharing options...
FiLTHYESKiMO Posted March 2, 2012 Author Share Posted March 2, 2012 On my opinion 50 real hours live its to short, you will never accomplish anything with this short time (asd my first playtrough had ended after 300+ hours) I've modified it. You live longer than 50 years. Also, you don't necessarily die at a certain age but the chances of dying are higher. You may live to be 100, but you'd need a great f***ing diet to live that long. :) Scriptname HumanAging extends Forms {Player aging system.} int TheYear = GameYear.GetValue() int Age = PlayerAge.Getvalue() int property DayCount auto int property Stage auto int property DayCount auto Perk property AgePerk1 auto Perk property AgePerk2 auto Perk property AgePerk3 auto Function AgePerks() ActorBase PlayerBase = Game.GetPlayer().GetBaseObject() as ActorBase Race PlayerRace = PlayerBase.GetRace() float GameYear = GameYearVar.Value If (PlayerRace == "Redguard" || "Imperial" || "Nord") If (Age <= 40) && (Stage == 0) Stage += 1 Game.GetPlayer().AddPerk(AgePerk1) elseif (Age >= 41) && (GameYear <= 60) && (Stage == 1) Game.GetPlayer().AddPerk(AgePerk2)Stage += 1 elseif (Age >= 61) && (Stage == 2) Game.GetPlayer().AddPerk(AgePerk3) endif endif endif endif endFunction Event OnInit() RegisterForUpdateGameTime(24) EndEvent Event OnRegisterForUpdateGameTime() AgePerks() PlayerAge.SetValue(Age + (DayCount / 356)) EndEvent Link to comment Share on other sites More sharing options...
MoonCrossWarrior Posted March 2, 2012 Share Posted March 2, 2012 Ooohh.. this project has similar idea's of what I want in a skyrim mod. :PQuestion, do the NPC's also age and if so do they need to breed as well?If they do breed, do they get random names? (thus making a random name generator) Once your done this mod; I will most likely play it. :D Link to comment Share on other sites More sharing options...
AoCBane Posted March 3, 2012 Share Posted March 3, 2012 You need any voice work? Link to comment Share on other sites More sharing options...
FiLTHYESKiMO Posted March 3, 2012 Author Share Posted March 3, 2012 This is pissing me off. I've written a perfectly fine script for aging. I've tried to add it to a quest but each time I do, it crashes. I've sent the script to others and they can add it to quests without a problem. The code:Scriptname HumanAging extends Quest GlobalVariable property PlayerAge auto GlobalVariable property GameDaysPassed auto Perk property AgePerk1 auto Perk property AgePerk2 auto Perk property AgePerk3 auto int property Stage auto Event OnInit() RegisterForUpdateGameTime(24) EndEvent Event OnRegisterUpdateGameTime() ActorBase PlayerBase = Game.GetPlayer().GetBaseObject() as ActorBase Race PlayerRace = PlayerBase.GetRace() float Age = PlayerAge.Value float DayCount = GameDaysPassed.Value PlayerAge.SetValue(Age + (DayCount / 356)) Debug.Notification("A new day has come. You are now " + PlayerAge.Value + " years old.") If (PlayerRace == "Redguard" || "Imperial" || "Nord") If (Age <= 40) && (Stage == 0) Stage += 1 elseif (Age >= 41) && (Age <= 60) && (Stage == 1) Stage += 1 elseif (Age >= 61) && (Stage == 2) Stage += 1 elseif (Age == 100) && (Stage == 3) UnregisterForUpdateGameTime() endif endif EndEvent Link to comment Share on other sites More sharing options...
FiLTHYESKiMO Posted March 4, 2012 Author Share Posted March 4, 2012 Scriptname HumanAging extends Form GlobalVariable property GameHour auto GlobalVariable property GameDaysPassed auto GlobalVariable property PlayerAge auto Perk property AgePerk1 auto Perk property AgePerk2 auto Perk property AgePerk3 auto int property Stage auto Event OnInit() RegisterForUpdateGameTime(1) EndEvent Event OnUpdateGameTime() float TimeOfDay = (GameHour.Getvalue()) float CurrentAge = (PlayerAge.Getvalue()) float DaysPassed = (GameDaysPassed.Getvalue()) if (TimeOfDay == 0) ActorBase PlayerBase = Game.GetPlayer().GetBaseObject() as ActorBase Race PlayerRace = PlayerBase.GetRace() float DayCount = (DaysPassed / 356) float Age = (CurrentAge + DayCount) PlayerAge.SetValue(Age) Debug.Notification("A new day has come. You are now " + PlayerAge.GetValue() + " years old.") If (PlayerRace == "Redguard" || "Imperial" || "Nord") If (Age <= 40) && (Stage == 0) Stage += 1 elseif (Age >= 41) && (Age <= 60) && (Stage == 1) Stage elseif (Age >= 61) && (Stage == 2) Stage += 1 elseif (Age == 100) && (Stage == 3) UnregisterForUpdateGameTime() endif endif endif EndEvent Here is the code: Here are the problems. - It doesn't seem to be changing the value of my custom made "PlayerAge" variable.- It is not updating at 0000 like specified. Any ideas? Link to comment Share on other sites More sharing options...
FiLTHYESKiMO Posted March 9, 2012 Author Share Posted March 9, 2012 (edited) Project Legacy will be ready for download this evening. First features include a working aging system. This is just the spine of the mod, after this many amazing features will be added. Edited March 9, 2012 by FiLTHYESKiMO Link to comment Share on other sites More sharing options...
Recommended Posts