[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Novelty forum • View topic - Using Variables to Define Assets?

Using Variables to Define Assets?

Have any technical questions or suggestions? Post them here.

Using Variables to Define Assets?

Postby Dash-X » Thu Aug 21, 2008 7:38 pm

Is it possible to generate asset names from variables?

For example...

I made visual assets with consistent filenames:
fMonkClose
fMonkMid
fMonkLong
mSwordieClose
mSwordieMid
mSwordieLong

etc...

In the visNov I'm working on, I've set a couple of global variables:
$playerSex = "m" or "f"
$playerClass = "Swordie" or "Rogue" or "Sage" or "Monk"

I was just thinking, Since my filenames are all uniform, is there a way to display or animate assets by using those variables?

For example:
Fade in [[$playerSex][$playerClass]Close] from the left

Also, is there a way to prompt the user to input text?

I hope I explained this well...
Dash-X
 
Posts: 6
Joined: Thu Aug 21, 2008 7:04 pm

Re: Using Variables to Define Assets?

Postby ErikB » Thu Aug 21, 2008 8:26 pm

User avatar
ErikB
Novelty developer
 
Posts: 1209
Joined: Wed Jul 16, 2008 3:58 pm

Re: Using Variables to Define Assets?

Postby Dash-X » Fri Aug 22, 2008 12:02 am

Thanks for the speedy reply. I tried the bit of code you gave me there, but I'm having some trouble figuring out what an identifier is and how to get the compiler not to give me an error (I'm not a programmer, you see...). I tried playing with it, and replacing bits of it with (what I thought) were things relevant to finding the required files (like the file path), but it was a no go... If it wasn't asking me for an identifier, it claimed to be expecting an open parenthesis. It's probably something ultra-simple...

How would I get the GetObject funtion to work?

Nearest I can tell, the code snippet may do this:

"Object@" portion - find an object at such-and-such location... (I've tried several methods of defining a location... None of them worked... Maybe I used incorrect syntax or something? I dunno.)
"obj" portion - assign name to object?
"Get Object()" - This is our function... So, the stuff inside is what we want the function to do.... Which is basically getting the strings from $playerSex and $playerClass and adding the suffix "Close" to the end... Right?
And then, the semicolon ends the line (or something?).

I think I messed up something... Is there anything you can point me to so that I can learn the proper syntax for this language?

Also, I have another question:

Will that work if the files are textures and not objects? Or rather, don't show up in the "Objects/Character" dropdown?

For example, the files I mentioned earlier, are located under "Textures" (as opposed to objects). But would that affect anything if the generated XML gave the textures global names identical to the filenames?

Somehow, I managed to muck it up...

I guess a better question would be:

Is there a way to create a dummy object/image, define it's size, and paste the desired imported texture on there?
Dash-X
 
Posts: 6
Joined: Thu Aug 21, 2008 7:04 pm

Re: Using Variables to Define Assets?

Postby ErikB » Fri Aug 22, 2008 1:04 am

User avatar
ErikB
Novelty developer
 
Posts: 1209
Joined: Wed Jul 16, 2008 3:58 pm

Re: Using Variables to Define Assets?

Postby Dash-X » Fri Aug 22, 2008 1:51 am

Last edited by Dash-X on Fri Aug 22, 2008 10:23 am, edited 1 time in total.
Dash-X
 
Posts: 6
Joined: Thu Aug 21, 2008 7:04 pm

Re: Using Variables to Define Assets?

Postby ErikB » Fri Aug 22, 2008 10:09 am

User avatar
ErikB
Novelty developer
 
Posts: 1209
Joined: Wed Jul 16, 2008 3:58 pm

Re: Using Variables to Define Assets?

Postby Dash-X » Fri Aug 22, 2008 10:37 am

Thanks. It's nice to know that I'm not bothering anyone.

Explain exactly what I want to do? Yes. I can do that.

The way I'm setting up the visNov project requires that the player select the main character's sex and one of four player classes/jobs.

What I want to do is figure out a way to change the character image to reflect the player's choices in a way that won't require a ton of "ifs" or branches while being stored in an easy-to-pull-up variable or something-or-other.

Ideally, I'd like to be able to use a simple variable like "$player", and whether the player chose a female Monk or male Swordie or male Rogue or whatever, the image representing the player reflects the choice.

The animation idea sounds interesting, though...
Dash-X
 
Posts: 6
Joined: Thu Aug 21, 2008 7:04 pm

Re: Using Variables to Define Assets?

Postby ErikB » Fri Aug 22, 2008 12:41 pm

Additionally I would recommend that you put the object in a global layer. That way you can reuse the same object over several pages without having to do the animation-change at the start of every page.

These types of games will be better supported by Novelty in the future.
User avatar
ErikB
Novelty developer
 
Posts: 1209
Joined: Wed Jul 16, 2008 3:58 pm

Re: Using Variables to Define Assets?

Postby Dash-X » Fri Aug 22, 2008 9:02 pm

Okay...

I've made the animation, and put it on a global layer.

it seems that now, I only have a problem figuring out how to change the animation to reflect the player's choice.

So far, I tried using a change animation action, and put "[$playerSex][$playerClass]" in the Animation box.

I also tried setting a variable "$playerType" and input "[$playerSex][$playerClass]" in the value box... Then tried to use "$playerType" in the change animation action...

I guess I'm trying to find a way to combine the results of $playerSex and $playerClass (because that's exactly what the sequence names are) and use those to change the animation.

Is there a way to change the animation to reflect the player's choices?
Dash-X
 
Posts: 6
Joined: Thu Aug 21, 2008 7:04 pm

Re: Using Variables to Define Assets?

Postby ErikB » Sun Aug 24, 2008 10:47 pm

User avatar
ErikB
Novelty developer
 
Posts: 1209
Joined: Wed Jul 16, 2008 3:58 pm

Re: Using Variables to Define Assets?

Postby Dash-X » Mon Aug 25, 2008 1:04 am

Thanks! It works! It works! It works!!!!

Novelty is gonna be the best visual novel engine ever!
Dash-X
 
Posts: 6
Joined: Thu Aug 21, 2008 7:04 pm

Re: Using Variables to Define Assets?

Postby rootbeerking » Tue Aug 26, 2008 7:15 pm

hmm yeah you should probably make this easier to do haha it sounds so complicated. I too would eventually like to do something like this. Only not as complicated, just an option for the player to choose their name, and sex.
User avatar
rootbeerking
 
Posts: 16
Joined: Sat Aug 16, 2008 11:44 pm

Re: Using Variables to Define Assets?

Postby ErikB » Wed Aug 27, 2008 2:21 am

User avatar
ErikB
Novelty developer
 
Posts: 1209
Joined: Wed Jul 16, 2008 3:58 pm


Return to Support & Development

Who is online

Users browsing this forum: No registered users and 4 guests

cron