Jump to content
KeyWorld

ROChargenPHP - Free PHP Character Viewer

Recommended Posts

Hello,

i have little problem when i try to make any image it's says:

 

The image http://xxx.com/rochar/avatar/hemagx cannot be displayed because it contains erros

 

:/

 

EDIT:

 

Error Log :/

 

[02-Aug-2013 09:49:44 America/New_York] PHP Notice:  Undefined variable: _D in /home/xxxx/public_html/rochar/index.php on line 52[02-Aug-2013 09:49:55 America/New_York] PHP Notice:  Undefined variable: _D in /home/xxxx/public_html/rochar/index.php on line 52[02-Aug-2013 09:50:34 America/New_York] PHP Notice:  Undefined variable: _D in /home/xxxx/public_html/rochar/index.php on line 52[02-Aug-2013 09:51:44 America/New_York] PHP Notice:  Undefined variable: _D in /home/xxxx/public_html/rochar/index.php on line 52[02-Aug-2013 09:51:51 America/New_York] PHP Notice:  Undefined variable: _D in /home/xxxx/public_html/rochar/index.php on line 52[02-Aug-2013 09:51:51 America/New_York] PHP Fatal error:  Call to a member function prepare() on a non-object in /home/xxxx/public_html/rochar/core/class.Controller.php on line 95[02-Aug-2013 09:52:03 America/New_York] PHP Notice:  Undefined variable: _D in /home/xxxx/public_html/rochar/index.php on line 52[02-Aug-2013 09:52:03 America/New_York] PHP Fatal error:  Call to a member function prepare() on a non-object in /home/xxxx/public_html/rochar/core/class.Controller.php on line 95[02-Aug-2013 09:53:40 America/New_York] PHP Notice:  Undefined variable: _D in /home/xxxx/public_html/rochar/index.php on line 52[02-Aug-2013 09:53:41 America/New_York] PHP Fatal error:  Call to a member function prepare() on a non-object in /home/xxxx/public_html/rochar/core/class.Controller.php on line 95[02-Aug-2013 09:55:52 America/New_York] PHP Notice:  Undefined variable: _D in /home/xxxx/public_html/rochar/index.php on line 52
Edited by hemagx

Share this post


Link to post
Share on other sites

@hemagx
You should at least check what you wrote in the configs, the error is from you, not from me.

@all
Fix an error on the lastest version with doridori and body animation.
Add a generator, to create your own characters, can be used in a char simulator for example:
Just complete the url: /generate/body=M-0-0/hair=0-0-0/hats=0-0-0/equip=0-0-0/option=0/actdir=0-0-0
Info: /generate/body=<sex>-<job>-<clothes color>/hair=<hair style>-<hair color>-<doridori>/hats=<hat top>-<hat middle>-<hat bottom>/equip=<weapon>-<shield>-<robe>/option=<option>/actdir=<direction>-<action>-<animation>

Have fun~

Share this post


Link to post
Share on other sites

 

Happy to see you like it ! :)

 

 

where can i put the custom display can someone teach me

 

Without using the core files and controllers, you have to do this (good to build a char simulator as ratemyserver has) :

<?php
 
define('__ROOT__', dirname(__FILE__) . '/'); 
 
 
// Loading CORE files
require_once( __ROOT__ . 'core/class.Controller.php');
require_once( __ROOT__ . 'core/class.Cache.php');
require_once( __ROOT__ . 'core/class.Client.php');
require_once( __ROOT__ . 'core/class.DB.php');
 
 
// Initialize the client (load GRF, load DB, etc.)
Client::init();
 
 
// What do you want to display ?
// Full Character ?
// So include the render needed
require_once(  __ROOT__ . 'render/class.CharacterRender.php' );
 
 
// Set up the header
header('Content-type:image/png');
 
// Since you use class.CharacterRender, use it :
$chargen                 = new CharacterRender();
 
// Set your datas here
$chargen->action         = CharacterRender::ACTION_READYFIGHT;   // You can see constants in
$chargen->direction      = CharacterRender::DIRECTION_SOUTHEAST; // render/class.RORender.php
$chargen->body_animation = 0;
$chargen->doridori       = 0;
$chargen->sex            = "M";
$chargen->class          = 4002;
$chargen->clothes_color  = 0;
$chargen->hair           = 5;
$chargen->hair_color     = 12;
$chargen->head_top       = 0;
$chargen->head_mid       = 0;
$chargen->head_bottom    = 0;
$chargen->weapon         = 0;
$chargen->shield         = 0;
$chargen->robe           = 0;
$chargen->option         = 0;
 
 
// Generate the image and display it
$img = $chargen->render();
imagepng($img);
 
?>

I tested that script, its not working.

 

At first there was an error about missing class.debub.php, which was easy to fix.^^

 

now all i get is an empty white square on my screen. Any ideas how to fix that ?

Share this post


Link to post
Share on other sites

@snowflake1963

Just add your fullclient informations to be able to load and extract files ?

//- ClientClient::$path         =     __ROOT__ . "client/" ;   // Define where your client path is (where you put your grfs, data, etc.)Client::$data_ini     =     "DATA.INI"           ;   // The name of your DATA.INI (to locate your grfs, if not set: grfs will not be loaded)

Thank you guys :)

Share this post


Link to post
Share on other sites

Hi man thanks for this incredible tool !!!!!  But only one little question .... 

Could the character avatar has movement ? Using which url ?

To show a monster is :   index.php/monster/poring ?

 

Thanks in advance

Share this post


Link to post
Share on other sites

Not possible currently to generate an animated image. Some reasons for it:

- too intensive and memory consuming to generate X images for an animation.

- gif can contain only 256 colors when a sprite is 256 * elements (without talking about rgba frames).

- not possible to know when to loop the animation since each animated elements (body, hats) have a differents animation duration.

 

It can be done client side using javascript but downloading spr/act pal is already too much in my opinion.

 

To display monster it's the id you have to use : /monster/1002

Share this post


Link to post
Share on other sites

@snowflake1963

Just add your fullclient informations to be able to load and extract files ?

//- ClientClient::$path         =     __ROOT__ . "client/" ;   // Define where your client path is (where you put your grfs, data, etc.)Client::$data_ini     =     "DATA.INI"           ;   // The name of your DATA.INI (to locate your grfs, if not set: grfs will not be loaded)

Thank you guys :)

 

I used the script as YOU posted it in #9: ( I allow myself to quote it again :) )

<?php define('__ROOT__', dirname(__FILE__) . '/');   // Loading CORE filesrequire_once( __ROOT__ . 'core/class.Controller.php');require_once( __ROOT__ . 'core/class.Cache.php');require_once( __ROOT__ . 'core/class.Client.php');require_once( __ROOT__ . 'core/class.DB.php');  // Initialize the client (load GRF, load DB, etc.)Client::init();  // What do you want to display ?// Full Character ?// So include the render neededrequire_once(  __ROOT__ . 'render/class.CharacterRender.php' );  // Set up the headerheader('Content-type:image/png'); // Since you use class.CharacterRender, use it :$chargen                 = new CharacterRender(); // Set your datas here$chargen->action         = CharacterRender::ACTION_READYFIGHT;   // You can see constants in$chargen->direction      = CharacterRender::DIRECTION_SOUTHEAST; // render/class.RORender.php$chargen->body_animation = 0;$chargen->doridori       = 0;$chargen->sex            = "M";$chargen->class          = 4002;$chargen->clothes_color  = 0;$chargen->hair           = 5;$chargen->hair_color     = 12;$chargen->head_top       = 0;$chargen->head_mid       = 0;$chargen->head_bottom    = 0;$chargen->weapon         = 0;$chargen->shield         = 0;$chargen->robe           = 0;$chargen->option         = 0;  // Generate the image and display it$img = $chargen->render();imagepng($img); ?>

AND since i am a php-n00b/newbie i hoped this script will work without further edition.

 

mfg

Snowflake

Share this post


Link to post
Share on other sites

@snowflake1963

 

There were some updates since this post, it require now to include the Debug class, and define where is locate your fullclient:

 

<?phpdefine('__ROOT__', dirname(__FILE__) . '/');// Loading CORE filesrequire_once( __ROOT__ . 'core/class.Controller.php');require_once( __ROOT__ . 'core/class.Cache.php');require_once( __ROOT__ . 'core/class.Client.php');require_once( __ROOT__ . 'core/class.DB.php');require_once( __ROOT__ . 'core/class.Debug.php');  Client::$path         =     __ROOT__ . "client/" ;   // Define where your client path is (where you put your grfs, data, etc.)Client::$data_ini     =     "DATA.INI"           ;   // The name of your DATA.INI (to locate your grfs, if not set: grfs will not be loaded)Client::init();  // What do you want to display ?// Full Character ?// So include the render neededrequire_once(  __ROOT__ . 'render/class.CharacterRender.php' );  // Set up the headerheader('Content-type:image/png'); // Since you use class.CharacterRender, use it :$chargen                 = new CharacterRender(); // Set your datas here$chargen->action         = CharacterRender::ACTION_READYFIGHT;   // You can see constants in$chargen->direction      = CharacterRender::DIRECTION_SOUTHEAST; // render/class.RORender.php$chargen->body_animation = 0;$chargen->doridori       = 0;$chargen->sex            = "M";$chargen->class          = 4002;$chargen->clothes_color  = 0;$chargen->hair           = 5;$chargen->hair_color     = 12;$chargen->head_top       = 0;$chargen->head_mid       = 0;$chargen->head_bottom    = 0;$chargen->weapon         = 0;$chargen->shield         = 0;$chargen->robe           = 0;$chargen->option         = 0;  // Generate the image and display it$img = $chargen->render();imagepng($img);?>

 

Share this post


Link to post
Share on other sites

Hello AnGeal,

 

To use it use the HTML TAG for pictures

 

<img src="http://yourserver/rochargen/index.php/avatar/yourcharctername">

 

avatar can be replaced with signature, character or characterhead

 

MfG

Snowflake

Share this post


Link to post
Share on other sites

it is possible to integrate rocharger and fluxcp?

 

how

 

Sorry my bad english

 

It's a stand alone script.

So you have to install it and just add html image in your fluxcp pointing to rochargen.

Share this post


Link to post
Share on other sites

I can't get it to work for me. I'm using the latest version of PHP and MySQL 5.5, yet I keep getting the error "Connection to DB fail.SQLSTATE[HY000] [2002] Permission denied"

 

I'm using the root admin account and Centos 6.5.

 

Looks great though.

 

Nevermind, replacing "127.0.0.1" with "localhost" fixed it.

Edited by jazzy348

Share this post


Link to post
Share on other sites

Can you explain how it works with weapons & shields? I've tried different numbers and it is just showing blanks.

Also the /update/hats route doesnt exist, and yes its been enabled in the index.php

Share this post


Link to post
Share on other sites

Weapons and shield are fully display on animation ACTION_READYFIGHT.

Depending of the weapon type, the attack frame (ACTION_ATTACK, ACTION_ATTACK2, ACTION_ATTACK3) vary (the weapon is only display in one frame).

 

About the route, I don't see a reason to not be found if you enabled it in index.php

Share this post


Link to post
Share on other sites

Thanks for responding KeyWorld,

 

Well after digging in the files I noticed something.

 

in class.RORender.php there is this:

 

	const ACTION_IDLE       = 0;	const ACTION_WALK       = 0;	const ACTION_SIT        = 0;	const ACTION_PICKUP     = 0;	const ACTION_READYFIGHT = 0;	const ACTION_ATTACK     = 0;	const ACTION_HURT       = 0;	const ACTION_UNK1       = 0;	const ACTION_DIE        = 0;	const ACTION_UNK2       = 0;	const ACTION_ATTACK2    = 0;	const ACTION_ATTACK3    = 0;	const ACTION_SKILL      = 0;

Shouldn't it look like this?

 

	const ACTION_IDLE       = 0;	const ACTION_WALK       = 1;	const ACTION_SIT        = 2;	const ACTION_PICKUP     = 3;	const ACTION_READYFIGHT = 4;	const ACTION_ATTACK     = 5;	const ACTION_HURT       = 6;	const ACTION_UNK1       = 7;	const ACTION_DIE        = 8;	const ACTION_UNK2       = 9;	const ACTION_ATTACK2    = 10;	const ACTION_ATTACK3    = 11;	const ACTION_SKILL      = 12;

 Regardless either way (I tried.) nothing happens.

 

68gfhg.jpg

 

Using:

 

/generate/body=M-4015-1/hair=1-0-0/hats=0-0-0/equip=0-0-0/option=0/actdir=1-1-4
/generate/body=M-4015-1/hair=1-0-0/hats=0-0-0/equip=0-0-0/option=0/actdir=1-1-ACTION_SIT (This is probably wrong but I tried it anyway.)

 

Am I missing something..?

 

Also off topic but you need to know: I joined robrowser's forum and I never got my validation email, and I had it resent and still havent recieved it. This was about two days ago.

It was a gmail.com ending with four numbers....

Edited by Karlislie

Share this post


Link to post
Share on other sites

Hi guys.

I tried this, but it shows that my character is offline and level is 0/0 a novice?

 

www.limit-ro.net/ROChargen/avatar/Anxiety/

 

 

 

Trace output
Client init...
Loading "DATA.INI" file...
GRFs found in "DATA.INI": ldata.grf, rdata.grf, data.grf
Searching route "/avatar/Anxiety/".
Running controller "Avatar".
Connecting to DB....
Connection success.
Trying to find file "data/sprite/shadow.spr"...
Find at "/var/www/ROChargen/client/data/sprite/shadow.spr"
Trying to find file "data/sprite/shadow.act"...
Find at "/var/www/ROChargen/client/data/sprite/shadow.act"
Trying to find file "data/sprite/Àΰ£Á·/¸öÅë/³²/Ãʺ¸ÀÚ_³².spr"...
Find at "/var/www/ROChargen/client/data/sprite/Àΰ£Á·/¸öÅë/³²/Ãʺ¸ÀÚ_³².spr"
Trying to find file "data/sprite/Àΰ£Á·/¸öÅë/³²/Ãʺ¸ÀÚ_³².act"...
Find at "/var/www/ROChargen/client/data/sprite/Àΰ£Á·/¸öÅë/³²/Ãʺ¸ÀÚ_³².act"
Trying to find file "data/sprite/Àΰ£Á·/¸Ó¸®Åë/³²/2_³².spr"...
Find at "/var/www/ROChargen/client/data/sprite/Àΰ£Á·/¸Ó¸®Åë/³²/2_³².spr"
Trying to find file "data/sprite/Àΰ£Á·/¸Ó¸®Åë/³²/2_³².act"...
Find at "/var/www/ROChargen/client/data/sprite/Àΰ£Á·/¸Ó¸®Åë/³²/2_³².act"

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.