Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

How do i make a battle system in MY game?

$
0
0
Hello i'm trying to create a simple text game to teach myself autoit.
and i am wondering to to make a simple battle system.
i already got some stats like vitality, strength, dexterity and exp gain on each mob just well xD i feel newb:')

here is the code of the battle gui:
[ autoit ]      
Func guibattle() $GBattle = GUICreate("Battle", 518, 421, 192, 124) $LMHP = GUICtrlCreateLabel("Health: "&$MobHP, 16, 104, 125, 17) $BSelectMob = GUICtrlCreateButton("Select", 272, 40, 75, 25) $LMSTR = GUICtrlCreateLabel("Strenght:"&$MobSTR, 16, 128, 125, 17) $LMAGE = GUICtrlCreateLabel("Age:"&$MobAGE, 16, 152, 125, 17) $CMobSelect = GUICtrlCreateCombo("001-rat", 24, 40, 241, 25) GUICtrlSetData(-1, "002-goblin|003-orc|004-elf") $Label1 = GUICtrlCreateLabel("Select monster:", 24, 24, 77, 17) $BBattleMob = GUICtrlCreateButton("Battle", 432, 368, 81, 49) $GMobStats = GUICtrlCreateGroup("Monster Stats", 8, 72, 417, 345) GUICtrlCreateGroup("", -99, -99, 1, 1) $LMobEXP = GUICtrlCreateLabel("EXP:"&$MobEXP, 16, 176, 125, 17) GUISetOnEvent($GUI_EVENT_CLOSE, "Close") GUICtrlSetOnEvent($BBattleMob, "Fight") GUICtrlSetOnEvent($BSelectMob, "selectmob") GUISetState() EndFunc

and the function where i select the mob/data from .ini:
[ autoit ]      
Func selectmob() $Fight = GUICtrlRead ($CMobSelect) $MobHP = IniRead(@scriptdir & "\" & "Mobs.ini", $Fight, "Health","Error") $MobSTR = IniRead(@scriptdir & "\" & "Mobs.ini", $Fight, "Strength","Error") $MobAGE = IniRead(@scriptdir & "\" & "Mobs.ini", $Fight, "Age","Error") $MobEXP = IniRead(@scriptdir & "\" & "Mobs.ini", $Fight, "Exp","Error") MsgBox (0, "title", "u selected "&$Fight) GUIDelete ($GBattle) guibattle() EndFunc

that part works as intented. just now i would like to when i press battle i battle the selected monster. meaning each point in str gives 1 dmg and dex gives 1% dodge per point. vit gives 10 health per point i added that just for the rest i didn't do yet because of not knowing how i can make the battle system. can someone please give me tips like first make a damage variable where $dmg = $str*1 or something cause i am just lost. and i can figure out when u defeat it to gives exp so that's fine.

Hop that this post is clear and u can follow it otherwise just ask me anything u like to know and i discribe it better.

Greetz

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>