[ACS] Custom name entry

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
Nash
 
 
Posts: 17506
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

[ACS] Custom name entry

Post by Nash »

http://nash.wanzafran.com/doomstuff/stringname.zip

I've written a custom naming system for my RPG thingy and I just thought I'd share it with everyone here.

The final naming interface for my RPG won't involve wall switches, but will feature a fullscreen "keyboard" that you navigate with your mouse. You will click on the letters on screen to key in your name.

Anyway, enjoy. :)
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

I did something like this, but it just read the from the player's angle and translated it to a character. I just stored the alphabet into an array, then took the player's angle and translated int into an index for the array. So you moved the mouse to select the character and pressed the use button to select the character. I've got a lot of ideas for rpg stuff, and even a small mod started... Maybe I should start sharing my ideas with other people and vis versa (hint hint)?
Last edited by solarsnowfall on Wed Apr 25, 2007 9:10 pm, edited 1 time in total.
User avatar
Nash
 
 
Posts: 17506
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Player's angle - clever indeed!
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

Sorry, I edidted my post before you replied.

One thing you will need to do is store a "namepos" for each name of every character in the game you can allow a custom name for. You'd essentially be printing character names from arrays if you want customizability. Anyway, the algorithms I've been working on are based on FF3.
User avatar
Nash
 
 
Posts: 17506
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Well to be honest I didn't even expect this thing to be an RPG. In the thread I linked to, I wrote that I was actually just playing around with expressions in DECORATE's damage parser. And then I was like "hmmm what if I made the fist do damage based on this variable". And before I knew it, I guess it has turned into an RPG.

I took a look at several damage algorithms - Castlevania: Symphony of the Night's, FF1's and FF6's (that'll be FF3 to you hehe)... but finally, I decided that I don't really need anything complex because part of the inspiration for this came from playing Ultima Underworld - I just wanted to create a simple first-person hack and slash dungeon crawler thingy. So I came up with my own algorithms which worked quite well and produced some nice numbers. :)

You're right about the namepos suggestion but I intend this to be a single-player only thing. I don't expect to get this to work with multiplayer (I don't think it will anyway, due to the way I'm doing the damage calculations).
User avatar
Isle
Posts: 687
Joined: Fri Nov 21, 2003 1:30 am
Location: Arizona, USA

Post by Isle »

try using characters so you wont need a big array of strings. then you can also just do print(a: name) to print the array.
User avatar
Nash
 
 
Posts: 17506
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

What do you mean?

(Yes, the fact that I have to key in a bunch of arrays just to print one name kind of bothered me)
User avatar
Isle
Posts: 687
Joined: Fri Nov 21, 2003 1:30 am
Location: Arizona, USA

Post by Isle »

characters are essentially ascii index numbers that are used with some print() cast types. to get them you just use single quotes.
example

Code: Select all

int name[3];

script 1 (void)
{
  name[0] = 'h';
  name[1] = 'e';
  name[2] = 'h';
  print(a: name);
}
would print "heh"
User avatar
Nash
 
 
Posts: 17506
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

WTF? This crashes ACC.exe.

Code: Select all

int char = 'h';
int anotherchar = 'a';
script 10 OPEN
	{
	print(a: char);
	}
User avatar
Isle
Posts: 687
Joined: Fri Nov 21, 2003 1:30 am
Location: Arizona, USA

Post by Isle »

you shoulda looked at the wiki for [wiki]Print[/wiki] first.
a: is used for arrays of characters, c: is used for a single character.
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

Ah, cool. That removes exactly one variable from my mod.
User avatar
Nash
 
 
Posts: 17506
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Actually, Final Fantasy III is the American version of Final Fantasy VI.

Anyway, updated the file to use a character array, thanks Isle. It's much cleaner now.
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

Heh, gotcha.

Anyway, doesn't this limit you to one name per array? Wouldn't this present more of a problem than it pretends to solve with only 64 global/world variables? I guess I just like the idea of one global array containing the names and another array containing the name lengths. Seems like you could get a lot more variety and customizability that way. So I take it back. It removes one variable, and takes up at least a dozen more in my case. If I want to store several custom character names along with several other stats globally, Isle's method simply won't do at all.
User avatar
Isle
Posts: 687
Joined: Fri Nov 21, 2003 1:30 am
Location: Arizona, USA

Post by Isle »

you dont need the array of chars, you can just do 'a'+alpha-1 because its just a number.
User avatar
Kaiser
Posts: 180
Joined: Thu Jul 15, 2004 8:21 am
Contact:

Post by Kaiser »

CIF3 uses a more complex naming system that not only appears in the player's name text, but will also appear in messages and dialogs.

So you can have a character give a message and have the player's name included, no matter what you name yourself.
You could also give another characters a name and their name would appear in messages too.
Locked

Return to “Editing (Archive)”