I’m trying to learn more about random events. Can someone teach me in a easy way how to set up a random event in these situations:
Character is exploring rooms. Each day (or time period), a random npc will be in these rooms.
Character is leaving house to go to a shop . in-between these locations, random events may appears. Like get attaced by bandits in the street or finding a npc. There will be different districts, some of them more dangerous than others so I want this to affect the random atack events percentage.
Sometimes the character will have dreams. This will be the first thing to happen after they go to sleep
Npc shop keepers will have random dialogue everytime the character go there to buy stuff.
Probably all of these are the same type of situation that can be done with the same solution, but for me who is still learning, everything is new and different hahaha
That’s an awful lot of questions. I mean you managed to ask six or seven times in the last four days.
While some people here are really really helpful, and they have our eternal gratitude for their help, you need to find a way to answer most of your own questions.
Most often than not you can find similar questions with an internet search. Also, you can download games with features you like and open them with Twine. Then you’ll be able to check a way to do it.
I’m pretty sure you’ll have less and less difficulties in the future if you’re used to resolve yourself most of your problems.
Hey, no, that’s not a good place to go. If you don’t want to volunteer answers, that’s fine, but please don’t tell people not to ask questions…
Let’s see: I don’t really have time for a full answer just now, but I think you could add tags to your random event passages, and then use Story.lookup to find the appropriate ones, and then .random() on the array of passages to get one, and finally <<include>> to show the event?
@MarcyRangel You’re welcome to ask questions here. However, it sounds as though you’re a new Twine author and trying to make a pretty complicated RPG/VN/schedule management game as your first effort and those are notoriously difficult to understand even though they are built up out of lots of simple processes and loops.
I’d suggest starting smaller and working on each element you want to include one at a time. Try building a small experimental game that’s just about visiting a shop keeper with random dialogue and see how far you get. If you have problems, post the code you’re having problems with so people can point to something and give more specific detailed help.
It’s not that people don’t want to assist; you’ve basically just asked such general fundamental questions about RPG game structure in Twine that it’s hard to answer without writing a long essay tutorial about game design. Those do exist - you can find some here by searching, and elsewhere on the internet. That’s what @souppilouliouma meant by searching - people have asked your questions and answered them in the past and you can benefit from that existing knowledge.
I’m sorry I didn’t realize how much of a bother I as being. This year I dint have the time to work on this project but this month In finally having the time for it that’s why I got excited and wanted to learn as much as possible so quick. I will stop now, I’m really sorry.
@souppilouliouma you wasn’t harsh, you were right, I was really being inconvenient. I will work harder from now on tofind a solution when I have difficulty in something instead of going to ask help right away
Again, we’re here to support you and you’re not alone. So long as you’re aware you’ll get better and quicker feedback if you post a specific problem and someone can say “You forgot to close your parentheses here…” as opposed to composing a lengthy explanation on design theory.
Thank you so much!! And is ok, they’re right, I was being really inconvenient these days with lots of questions. I deleted my previous questions and from now on I will work higher to find a solution by myself instead of going ask help right away
It’s not that people don’t want to learn by themselves, but obviously beginners don’t even know what keywords to search for. If you don’t want to drop links to resources, at the very least give out keywords to search for, lest your answer basically sounds “dismissive and patronizing”, acting all high and mighty telling people they do wrong without even pointing them the way to go.
Have you considered different ways to make rpg games in Twine available on Google?
You can see the emphasis on searchable keywords, which is better than “rpg game structure”, BTW. See how easy it is to be helpful? Why not help them?
Telling people not to ask questions without telling them what to research beforehand is to shut them out, simply because they can’t find any “good” resource. Is that what you want?
@HanonO I manage to find a solution to all my MadExile Time widget questions , except for one: how do I calculate remaining time using that widget? Like, if current date is x and event is y, what is the code to calculate the remaining days? I cant find this information anywhere and I am horrible at math I swear to god I looked everywhere . I found how to create widgets, how to set events, how to change days and months. But not this. Do you have any tips? I swear I will not post anything again for at least months, it’s just this one problem that I need to solve as soon as possible to move my story foward
That thread seems to provide very useful hints for the usage of the widget. (Although, probably not the exact solution to the days problem.)
So then, I’d look closely at the code of the widget itself, to see whether it contains built-in definitions that would solve the task directly. That doesn’t seem so.
That can look fairly intimidating if you aren’t used to it, but we can at first just skim-read it, since we are only looking for a method to calculate days between dates.
We don’t immediately find a promising method name, but at the bottom of the page, there’s a section called “Calculating elapsed time”.
There we see that we can subtract one date from another (or equivalently subtract the values returned by their getTime() methods), and we will get back the time difference in milliseconds. So, to get what that means in days, we will need to divide it by the number of milliseconds in a day (1 day = 24 hours = 1440 minutes = 86400 seconds = 86400000 milliseconds).
// To calculate the time difference of two dates
var Difference_In_Time = date2.getTime() - date1.getTime();
// To calculate the no. of days between two dates
var Difference_In_Days = Difference_In_Time / (1000 * 3600 * 24);
I’m not well-versed in Twine, but I think for Sugarcube it should be something like:
<<set $gameDate to new Date(2015, 2, 17, 3, 24);>>
<<set $futureDate to new Date(2015, 2, 24, 3, 24);>>
<<set $diffdays to ($futureDate.getTime() - $gameDate.getTime()) / 86400000>>
I hope this helps or provides some necessary building blocks.