Random Name Generator

I want to make a random name generator I've been having many troubles with this and I don't really know how most of this works.


Here's how I'd do it - but you'll need a little java scripting. I tried to keep it to a minimum. Make sure that the random number generator is tab-indented (or has four spaces before it). You can change gender to male or female. And you can increase the randomizer and have more names. This is just the basics...

[[init]]:

    var rnd = Math.ceil(Math.random() * 3);    // random number between 1 and 3
    squiffy.set("rnd",rnd);

<set game variables here. can be male or female>
@set gender=female

{if gender=male:
{if rnd=1:{@name=Able}}
{if rnd=2:{@name=Cain}}
{if rnd=3:{@name=Duke}}
}
{if gender=female:
{if rnd=1:{@name=Abby}}
{if rnd=2:{@name=Cate}}
{if rnd=3:{@name=Darlene}}
}

Name is {name}.

Of course, you would really set your gender through the earlier script you were working on.


Thank you so much sorry I took a while to get back to you. You have been a great help I was struggling a lot as I didn't know how to use the @set name with the If statement. I had it as {if randomnumber=1:{@set name=Darfer}}. As I stated before I don't know much coding so I'm quite surprised I was actually quite close.


Actually, I didn't know how to set it until quite recently. This document is a superb reference that will give you all sorts of clear instructions on how to do advanced squiffy.

https://dynalist.io/d/kocz1psBWP_sDFR0bk8wApfY


Oh this link will help me so so much thanks a lot! Currently I'm thinking about adding an inventory system as well... It'll take a while to add all the items I want because I want this to be very long and sophisticated because I'm awkward like that. But I'm pretty sure I'll enjoy it. It's tedious and time consuming but great.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums