this is not a noob question, it's a bit of advanced coding and if-code logic involved.
------------
there's 4 randomization functions:
http://docs.textadventures.co.uk/quest/ ... eroll.htmlhttp://docs.textadventures.co.uk/quest/ ... hance.htmlhttp://docs.textadventures.co.uk/quest/ ... omint.htmlhttp://docs.textadventures.co.uk/quest/ ... ouble.html--------------
as to what you want to do exactly in your game, is up to you, which determines which one (or combination of them) you want to use.
------------
as to how to actually implement them for what you want to do in your game, this is the meat (hard part) of the problem.
we need more details on exactly how~what your design idea is...
do you want random events to happen upon moving amongst the rooms? or do you just want random events to be occuring just within a single room?
----------
if you do want the random events based upon changing rooms, a way to do it is to create~add a global Turnscript for your scripting, and I would personally use a combination of two of the randomization functions:
'GetRandomInt' for selecting what event (out of a pool of events)
and then
'RandomChance' for the chance of that selected event actually triggering~occuring or not
// if you want an event to always occur, then don't use this combination, just use one of the randomization functions to select your event from a pool of events
you can be advanced-fancy in your coding by using a dictionary for your pool of events, but this is probably too advanced for you right now.
so, you'd probably just want to use an 'if' scripting structure, for example (sorry for in code, but it's faster for me):
actually... using the special 'changed' Script within the 'player' Player Object, would work better than a global turnscript, just a very lame example below:
<object name="player">
<attr name="changedparent" type="script">
choice = GetRandomInt(1,4)
if (choice = 1 and RandomChance(5)) {
msg ("muwahahaha, HK snaps his fingers and you die!")
msg ("GAME OVER")
finish
} else if (choice = 2 and RandomChance(10)) {
player.level = 99
player.cash = 999999999999999
player.current_life = 9999
player.maximum_life = 9999
player.strength = 1000
player.endurance = 1000
player.dexterity = 1000
// etc etc etc
msg ("god mode event, enjoy!")
} else if (choice = 3 and RandomChance(30)) {
player.condition = "poisoned"
msg ("You've been poisoned.")
} else if (choice = 4 and RandomChance(90)) {
player.fatigue = player.fatigue + 5
msg ("You're a little bit more exhausted from your travels.")
}
</attr>
</object>
----------
to do this in the GUI~Editor:
the 2 SUPER SCRIPTS that epsecially when used together, let's you do 90% of everything that you want to do in your game!:
1. run as script -> add new script -> variables -> 'set a variable or attribute' Script -> set variable (see my code lines above for examples) = [EXPRESSION] (see my code lines above for examples)
2. run as script -> add new script -> scripts -> 'if' Script -> if [EXPRESION] (see my code line examples above, but the syntax used for this, is a bit different from my code lines above)
how to add the special 'changed' Script to your 'player' Player Object:
'player' Player Object -> 'Attributes' Tab -> Attributes -> Add -> (see below)
(Object Name: player)
Attribute Name: changedparent
Attribute Type: script
Attribute Value: (add in the scripts, see my scripting block above)