After some snooping around I finally found a code that allows for a random action every time a twine passage loads.
<<set $dice to random(0,1)>>\
<<if $dice is 0>><<set $health -=25>>You have been ATTACKED!<</if>>
<<if $dice is 1>>Moose!<</if>>
Using this code, I can make an enemy randomly use an attack and take away from the players health. Not just one attack either, I can create a list of attacks with different damage to be used at random.
In a weird way this has created a sort of AI function with twine. The battles will be more genuine like an actual video game. Depending on what the enemy does at random, will determine the players course of action. It will be turn based as well. So when enemy attacks (or doesn’t) what will the player do? Attack? Use a healing item? ect.
This code makes battle within twine possible which is exciting because I almost abandoned the idea. Before this discovery I was going to have one battle per episode, since I would literally have to create a series of passages for every possible scenario or action that the player would choose. That would have been WAYYYYYY to much work. Below is a sample of the code in action.