Hello again!
Thanks everyone for your help, it gave me a lot to think about!
I have now created a prototype for an event system that I think might feel dynamic enough, but I still have some design questions.
I agree that events should probably have a category, (considering I am thinking of having 30-50 trigger-able events), but what I am unsure of is if it should focus on splitting these up into many scenes or if that is frowned upon? Or would it be better if it is as few as possible scenes, and then huge text files with many labels for scenes?
If I have categories, would it be interesting if it worked like a triangle system? Lets say the player has already read a character events, that makes the next event (if available) a story-event, and next a general-event (if available), and back to character events. Or would a random system work better?
And while I know some coding stuff I am a complete novice with ChoiceScript, so if any of this code is not allowed or can be done in a much simple way, please let me know!
What my code does currently:
It takes in events made by “arrays”, takes their priority, gives out a list of highest priority events, remembers which event are what, and finally randomizes out one scene and sends the player there.
This could easily instead be separated into groups and then remembers the label-event-name if that is easier.
I thought this system would feel dynamic enough as there is an element of random, but clear enough with the priority system, allows for easy constraints. Perhaps on top of all this, I will add that priority levels are changed depending on character choices.
The code I have created could be used as an event/quest system, and although it does not yet have all the features I am planning, anyone is very welcome to use it!
*the code will need, at this moment, five scenes called event_1, event_2, event_3, event_4, event_5, to have something to go to.
Code
*temp variableReachedChapterX
*set variableReachedChapterX true
*temp ePrio_1 8
*temp eTitle_1 "Event 1"
*temp eEvent_1 1
*temp eStateOn_1 false
*if (variableReachedChapterX = true)
*set eStateOn_1 true
*temp ePrio_2 8
*temp eTitle_2 "Event 2"
*temp eEvent_2 2
*temp eStateOn_2 true
*temp ePrio_3 9
*temp eTitle_3 "Event 3"
*temp eEvent_3 3
*temp eStateOn_3 false
*temp ePrio_4 8
*temp eTitle_4 "Event 4"
*temp eEvent_4 4
*temp eStateOn_4 true
*temp ePrio_5 3
*temp eTitle_5 "Event 5"
*temp eEvent_5 5
*temp eStateOn_5 true
*temp priorityNumber 10
*temp NumberOfEvents 5
*temp i priorityNumber+1
*temp j 0
*temp z 0
*temp s 0
*temp p_1 0
*temp p_2 0
*temp p_3 0
*temp p_4 0
*temp p_5 0
*temp pAmount 5
*label loop1
*set i (i-1)
Priority ${i}
*goto loop2
*label loop12
*set j 0
*if (i < 2)
*goto testx
*goto loop1
*label loop2
*set j (j+1)
*if (eStateOn[j]) and (ePrio[j]=i)
Adding event: ${eTitle[j]}, has priority ${ePrio[j]}
*set s (s+1)
*goto loop3
*label loop22
*set z 0
*if (j > (NumberOfEvents-1))
*if (s>0)
*goto randomChooseEvent
*goto loop12
*goto loop2
*label loop3
*set z (z+1)
*set p[s] eEvent[j]
*if (z > (pAmount-1))
*goto loop22
*goto loop3
*label randomChooseEvent
*temp randomEvent1 1
*rand randomEvent1 1 s
Test
${p_1}
${p_2}
${p_3}
${p_4}
${p_5}
*temp selectedScene p[randomEvent1]
envents in prio ${s}
rand ${randomEvent1}
selected scene ${selectedScene}
*goto_scene event[selectedScene]
*comment goes to scene "event_(number)" but could be remade to name of scene if better.
*comment - I will change the prio number depending on choices
*comment - and if numbers are the same the events is randomized
*comment - should there be different piles of events though?