RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Character origin to change dialogue options?

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 88
http://www.rukinet.com
At the beginning of my new game you will be able to choose some info about yourself (or your character) such as your name, if not too troublesome sex (as in gender, you pervert), as well as your birthplace (or more accurately, current hometown) which will all alter the entire game in different ways.

Now, without using scripts (I do not know how like anything about object-oriented scripting language) or common events (which I have no idea how to use or how they even work since I have never gotten any good explanation about this) making the dialogue of the game differ slightly (or extremely) depending on where you lived in the beginning of the game or other factors would require every event to have lots of conditional branches and not only is that tedious work but it's messy! So I'm wondering is there any way to simplify this using scripts or common events or something? Thank you in advance!

~Rukishou


Rukinet. - the dot's included!

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Tedious, yes, but the only thing that makes it tedious is that you have to write the dialogue, which is something you would have to do whether you did it with events or with scripts. If all you want are superficial changes, like insert this name instead of that name, then any message script would do that. But if you want substantial changes, there is no way to get around writing extra dialogue - no script can do that for you.

I would also think that scripting would be messier, because the easiest way I can see doing this is on a per-event basis, and scripting would more or less require a database of text.

***
Rep:
Level 88
http://www.rukinet.com
Well I was actually thinking that in eventing, if there are let's say 5 character origins to choose from, I would have to check 5 different switches for all dialogues which need a minor or major change, but I just realized I can use a variable where 1 represents the first background story, 2 represent the next one etc...

Should I use variables like that, or is there a better way?


Rukinet. - the dot's included!

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Ultimately, it would make little difference whether you use five switches or one variable, though perhaps the variable would be more efficient -that would be a fine way to do it - better perhaps because you'd be able to make a binary tree. It's still going to be five conditional branches if you want a different dialogue for each origin though.

***
Rep:
Level 88
http://www.rukinet.com
What's a "binary tree"?  ;8


Rukinet. - the dot's included!

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
It wouldn't be important with such a small number of conditional branches, but the basic idea, trying to put it plainly, is that it would reduce the possibility of a lot of conditional branches being gone through by eliminating by halves. Take for instance, if you had eight possibilities. Then one way to do it would be:

Code: [Select]
if var == 1
else
  if var == 2
  else
    if var == 3
    else
      ...
          if var == 8
          end
      ...
end

So, in the case where the value of the variable is 8, then that would have to check the conditions eight times every time it goes through. The purpose of a binary tree would be to reduce the maximum number of conditionals, though this may also raise the minimum number of conditionals.

So, you could rewrite that and have it as this instead:

Code: [Select]
if var <= 4
  if var <= 2
    if var == 1
      # code for when var == 1
    else
      # code for when var == 2
    end
  else
    if var == 3
      # code for when var == 3
    else
      # code for when var == 4
    end
  end
else
  if var <= 6
    if var == 5
      # code for when var == 5
    else
      # code for when var == 6
    end
  else
    if var == 7
      # code for when var == 7
    else
      # code for when var == 8
    end
  end
end

That way, there would only be three checks necessary, no matter what the variable is. So it reduces the worst case scenario. It would become particularly important where there are lots and lots of options, like for instance, 128 possibilities.

**
Rep:
Level 82
Ultimately, it would make little difference whether you use five switches or one variable, though perhaps the variable would be more efficient -that would be a fine way to do it - better perhaps because you'd be able to make a binary tree. It's still going to be five conditional branches if you want a different dialogue for each origin though.

You say 5, but I think it's look more like, because I think they want it where npcs respond to men and women differently even from the same origin? But I may have misread?

*
Rep:
Level 87
the method remains the same ;)  If he learns how to do it with 5, he can do it with 10, or 15, or however many he wants.
Always remember you're unique.
Just like everybody else.