|
||
|
|||||||
| Starbucks @ RunUO.com Unmoderated forum for off-topic banter, screen shots, chit-chat and things of this nature. Flames are permitted, and you can pretty much do nearly anything within reason. No advertisements. |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Account Terminated
Join Date: Jul 2006
Age: 29
Posts: 240
|
ok been trying to get my images to do different things.. cant seem to get a string to embed in it properly. can get it to call the names and titles.. but trying to add something like "name: " + $name doesnt work for crap =( so anyone wanna give me a hand that is familiar with php??
|
|
|
|
|
#2 (permalink) |
|
Forum Expert
Join Date: Nov 2003
Location: Illinois, USA
Age: 22
Posts: 2,911
|
Google is your friend.
And so is using the correct forums: Script Languages - RunUO - Ultima Online Emulation
__________________
Useful links (Use them or die in a fire!!!): Ultimate Little Guide, C# Tutorials & Docs, RunUO Basic Scripts, Run UO How to..., Configure server for connections, Scripting for Dummies, Common Problem Solutions, FAQ Forum, RunUO Wiki, Basic Generics, Xml Tutorial |
|
|
|
|
#3 (permalink) |
|
Account Terminated
Join Date: Jul 2006
Age: 29
Posts: 240
|
actually thought i posted there. =P if you dont have any help other then "google is your friend" then please stfu lol.. google is always my first resort to 99% of anything.. even looking up a number instead of using the phone book.. google is godsend I swear.. but no frets i am still roaming through countless websites learning yet another scripting language.. but having found the answer yet.. found a ton of other things.
|
|
|
|
|
#4 (permalink) |
|
Forum Expert
Join Date: Nov 2003
Location: Illinois, USA
Age: 22
Posts: 2,911
|
Well if you want help, then you will need to actually describe the problem better than that. And I provided great help:
1. use google 2. use the correct forum
__________________
Useful links (Use them or die in a fire!!!): Ultimate Little Guide, C# Tutorials & Docs, RunUO Basic Scripts, Run UO How to..., Configure server for connections, Scripting for Dummies, Common Problem Solutions, FAQ Forum, RunUO Wiki, Basic Generics, Xml Tutorial |
|
|
|
|
#7 (permalink) | |
|
Master of the Internet
|
Quote:
you should have used google to find the 10+ posts created by the runuo higher ups telling people not to respond to threads with posts like "use google"
__________________
Experience is not what happens to you; it is what you do with what happens to you. - Aldous Huxley In order to be effective truth must penetrate like an arrow - and that is likely to hurt. - Wei Wu Wei Let men gain wisdom - or buy a rope - Antisthenes |
|
|
|
|
|
#8 (permalink) | |
|
Account Terminated
Join Date: Jul 2006
Age: 29
Posts: 240
|
Quote:
Mordero oh i wasnt arguing bud.. =P i was teasing.. though i meant to post in the other thread.. and i did google already.. what i am trying to do is add text into the image. if you have a tutorial on this be great.. atm the way i am adding the strings its very limited what i can do... |
|
|
|
|
|
#9 (permalink) | |
|
Forum Novice
Join Date: Feb 2008
Location: Wasilla, Alaska
Age: 35
Posts: 127
|
You might have better luck if you went and got help from a site that deals specifically with php.
__________________
Quote:
|
|
|
|
|
|
#11 (permalink) | ||
|
Forum Expert
Join Date: Nov 2003
Location: Illinois, USA
Age: 22
Posts: 2,911
|
Quote:
Quote:
![]()
__________________
Useful links (Use them or die in a fire!!!): Ultimate Little Guide, C# Tutorials & Docs, RunUO Basic Scripts, Run UO How to..., Configure server for connections, Scripting for Dummies, Common Problem Solutions, FAQ Forum, RunUO Wiki, Basic Generics, Xml Tutorial |
||
|
|
|
|
#13 (permalink) |
|
Forum Expert
|
You know i already have this working fully, php is a fun and very simple, easy language to learn...
BTW, Zaphieon, you generated image is over 100kb, which is really bad... To put synamic PHP scriings together, instead of the generic C# '+' char modifyer, use a full-stop '.' char to joion strings. Code:
$string = 'Name: '. $name; Code:
$string = " Name: $name ";
__________________
![]() WWW.RPK-UO.COM - The WoW-UO Cross-Over Shard Last edited by Vorspire; 07-01-2008 at 02:27 PM. |
|
|
|
|
#14 (permalink) | |
|
Account Terminated
Join Date: Jul 2006
Age: 29
Posts: 240
|
Quote:
|
|
|
|
|
|
#15 (permalink) | |
|
Forum Expert
|
Quote:
PHP is not dissimilar to C# in a lot of ways, but differentiates to C# in the aspect of Object Orientation. PHP is incapable of storing scripts in memory, thus you only get one output per page and without using Sessions, it is nearly impossible to pass references to seperate scripts. If you write your PHP classes as if you were writing a C# class (same sort of structure), then you'll pick it up easily. The main differences are, when accessing a class or method (PHP-specific Methods are called Functions) (if the method exists in the same class as you wish to call it from, you must still use "this" accessor): Code:
PHP: $this->Function(); C#: this.Method(); Code:
PHP: var $variable; C#: object m_variable; You can, but don't have to do any type-casting with PHP, because the PHP parser is smart enough to know the difference between and integer and a string :P Anything alse you want to learn, just ask. -Just out of curiosity, did you pick up my Paperdoll Script from that other thread for your base? If so, i will be able to offer more support on it
__________________
![]() WWW.RPK-UO.COM - The WoW-UO Cross-Over Shard Last edited by Vorspire; 07-01-2008 at 03:02 PM. |
|
|
|
|
|
#16 (permalink) |
|
ConnectUO Creator
Join Date: Jan 2004
Age: 28
Posts: 4,891
|
"name:'.$name
__________________
Jeff Boulanger ConnectUO - Core Developer Want to help make ConnectUO better? Click here to submit your ideas/requests Use your talent to compete against other community members in RunUO hosted coding competitions If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team. Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO |
|
|
|
|
#18 (permalink) |
|
Account Terminated
Join Date: Jul 2006
Age: 29
Posts: 240
|
no i was digging through an old harddrive with my last server on it.. found old from zulu's days.
though i could grab that and play with it as well.. fairly good are reverse engineering scripts. now about image sizes.. my orginal black image is abotu the same size as yours atm.. and I plan on sizing them both down when i get back to the house. going to attempt to design a few more that if i can figure it out, to switch according to the players status. Choas, Order, PK, AntiPK(( anti pk get auto antipk counts for killing pks with 10 or more murder counts, have there own hue name and so on.)), Nuetral Last edited by Zaphieon; 07-01-2008 at 04:15 PM. |
|
|
|
|
#19 (permalink) |
|
Account Terminated
Join Date: Jul 2006
Age: 29
Posts: 240
|
well I added a bit more to it.. but cant seem to get the info to print correctly.
connects to sql Code:
$link = sql_connect(); $result = sql_query($link, "SELECT char_name,char_female,char_bodyhue,char_str,char_dex,char_int FROM myrunuo_characters WHERE char_id=$id"); if (!(list($nametitle,$charfemale,$charbodyhue,$cstr,$cdex,$cint) = mysql_fetch_row($result))) die(); mysql_free_result($result); Code:
function AddText(&$img, $name, $title)
{
//$font_size = 56 ;
$textcolor = imagecolorallocate($img, 255, 255, 255);
$pos = (int) (55 - (strlen($name)));
if ($pos < 0)
$pos = 0;
imagestring($img, 1, $pos, 264, $name, $textcolor); //Name
$pos = (int) (55 - (strlen($title)));
if ($pos < 0)
$pos = 0;
imagestring($img, .5, $pos, 276, $title, $textcolor); //Title
imagestring($img, .5, 155, 264, 'Str: '.$cstr, $textcolor); // str
imagestring($img, .5, 155, 271, 'Dex: '.$cdex, $textcolor); // dex
imagestring($img, .5, 155, 278, 'Int: '.$cint, $textcolor); // int
}
|
|
|
|
|
#20 (permalink) |
|
Forum Expert
|
TMS is right, if you're going to open a string variable with double-quotes, you have to close it with double quotes, same for single quote. double-quoting strings make the string variable more solid, all characters are literals and $var values are parsed without quotations
__________________
![]() WWW.RPK-UO.COM - The WoW-UO Cross-Over Shard Last edited by Vorspire; 07-01-2008 at 05:44 PM. |
|
|
|
|
#21 (permalink) |
|
Forum Expert
|
It's been a very, very long time since I've dealt with any PHP and I was certainly never exceptional at it. But, some points I picked out that may or may not be correct and could be checked again would be that:
I noticed you don't pass the variables ($cstr, $cdex, $cint) into the function that handles the paperdoll text printing. (This might not be necessary) I noticed you don't access them through the list you put them in such as maybe ($listname[$cstr].. so forth and so on) and I was wondering if maybe that's the cause. Just a couple shots in the dark. |
|
|
|
|
#22 (permalink) |
|
Forum Novice
Join Date: Dec 2005
Posts: 608
|
You probably don't have globalvars on which is a good thing.
In your function you pass the image the name and the title, but inside the function there is no variable defined with the names $cstr, $cdex or $cint, thus these variables are null, and a null string is nothing. Also single quotes aren't made with single quotes (') but with double quotes (") Code:
imagestring($img, .5, 155, 264, 'Str: '.$cstr, $textcolor); // str Code:
imagestring($img, .5, 155, 264, "Str: ".$cstr, $textcolor); // str |
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|