Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
skillsystem [2020/11/06 13:03] – [Skill] adminskillsystem [2020/11/06 13:16] – [Skillsystem] admin
Line 14: Line 14:
 FSkillSystem : TGorillaSkillSystem; FSkillSystem : TGorillaSkillSystem;
 FMySkills : TGorillaSkillGroup; FMySkills : TGorillaSkillGroup;
-FSkills : Array[0..1] of TGorillaSkill;+FSkills : Array[0..2] of TGorillaSkill;
  
 [...] [...]
Line 24: Line 24:
 // add a group for managing general skills // add a group for managing general skills
 FMySkills := FSkillSystem.AddGroup(); FMySkills := FSkillSystem.AddGroup();
-FMySkill.Name := 'MySkills';+FMySkills.Name := 'MySkills';
  
 // add some skill to this group // add some skill to this group
-FSkills[0] := AddSkill();+FSkills[0] := FMySkills.AddSkill();
 FSkills[0].Name := 'Power'; FSkills[0].Name := 'Power';
 FSkills[0].Level := 1; FSkills[0].Level := 1;
 FSkills[0].MaxLevel := 10; FSkills[0].MaxLevel := 10;
  
-FSkills[1] := AddSkill();+FSkills[1] := FMySkills.AddSkill();
 FSkills[1].Name := 'Speed'; FSkills[1].Name := 'Speed';
-FSkills[1].Level := 1; + 
-FSkills[1].MaxLevel := 10;+FSkills[2] := FMySkills.AddSkill(); 
 +FSkills[2].Name := 'Turbo'; 
 +FSkills[2].Level := 0; 
 +FSkills[2].MaxLevel := 1; 
 +// we can enable this by leveling up the "Speed" skill 
 +FSkills[2].Enabled := false; 
 +// just link to another skill 
 +FSkills[1].NextSkill := FSkills[1].GUID;
 </file> </file>
  
 ===== Skill ===== ===== Skill =====
 +
 +Each skill is completely configurable. You activate/deactivate them, configure values and factors for in game computations, and we support evolving of skills by levels. You can also level up by converting one skill into another.
  
 ^Property ^Description^ ^Property ^Description^
Line 50: Line 59:
 |NextSkill | Defines a linked skill which will be enabled on leveling up. Use this property instead of interpolation mechanism. By default this value is not set.| |NextSkill | Defines a linked skill which will be enabled on leveling up. Use this property instead of interpolation mechanism. By default this value is not set.|
 |Data |Use this value to store skill specific variable content. For example if the Value field do not provide enough information for this skill. By default this value is set to TValue.Empty.| |Data |Use this value to store skill specific variable content. For example if the Value field do not provide enough information for this skill. By default this value is set to TValue.Empty.|
 +
 +==== Leveling Up ====
 +
 +In most games it's not enough to just manage skill values, you also like to evolve your character.
 +Leveling up allows you to change values and factors by levels. Each leveling up will start a TGorillaSkillProcess, because
 +you might won't change the value immediately. The "LevelingTime" property of each skill item defines how long this process takes.
 +At the moment only leveling up is allowed.
 +
 +Besides easy leveling up, you can also enable new skill values by this method. Simply set the "NextSkill" property in the specific skill item. The leveling-process will automatically enable the new skill.
 +
 +<file pascal>
 +var LLevelProc : TGorillaSkillProcess;
 +begin
 +  LLevelProc := FSkills[0].StartLevelingUp();
 +  LLevelProc.Start();
 +end;
 +</file>
 +
 ===== User Interface ===== ===== User Interface =====
  
Line 59: Line 86:
 Sadly AssetsManager support is not given yet. Sadly AssetsManager support is not given yet.
  
 +Next step: [[inputpolling|InputPolling]]