Macros in entity files

  • Thread starter Thread starter Devsman
  • Start date Start date
D

Devsman

Guest
Suppose I'm still not really sure what I want to name my character, but for organizational purposes, I put all the sprites, sounds, files, etc for the character in data/chars/[character name].

Could I define a macro so that when I decide to change the character's name from "Steve" to "Mike" I can just change that and not have to go through every frame and change "data/chars/Steve/..." to "data/chars/Mike/..."?

For example, something like this:

Code:
define $name = "Steve"

name	$name
health	100
speed	12
type	player
shadow	3
diesound	data/chars/$name/eek.wav
running	24 4 2 1 0

animationscript	data/chars/$name/animationscript.c
icon	data/chars/$name/icon.pcx

anim idle
	loop	1
	delay	70
	offset	20 44
	bbox	5 2 31 43
	frame	data/chars/$name/Stand00.pcx
	delay	30
	frame	data/chars/$name/Stand01.pcx

Thanks.
 
I guessed as much.

Replace is kinda dumb sometimes so if my character's name was previously "del" and I change it to "joe" now all my "delay" statements will be "joeay" statements.

Oh well.  I'll just have to watch out for that.

Thanks for reply.
 
You just have to be more specific.  you should search and replace like this

SEARCH: data/chars/del/del

REPLACE: data/chars/joey/joey
 
Replace is kinda dumb sometimes so if my character's name was previously "del" and I change it to "joe" now all my "delay" statements will be "joeay" statements.

No, you need to set the search to match the word, so it will search just for "DEL" and will ignore "DELAY"

I suggest you to download this http://notepad-plus-plus.org/
Its free, its good and it have color synthax on .c files (which we use in OpenBOR)
 
Oh wow I didn't know npp could search whole words like that.

Combined with including the whole path like that, I think that might cover it.

Thanks.  :)
 
Back
Top Bottom