Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
characters

 
Post new topic   Reply to topic Printable version
 View previous topic  Flagmover plugin Post :: Post Ufo  View next topic  
Author Message
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Fri Feb 06, 2004 9:59 pm    Post subject: characters Reply to topic Reply with quote

My problem with the bot...

char a = 'A';
String blah = a;

Why does blah return 41 and not 'A'; and how can I fix this?

Dr Brain suggested doing String blah = String(a); and still didnt work.. any other would help icon_smile.gif thanks
Back to top
View users profile Send private message Add User to Ignore List
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Fri Feb 06, 2004 10:19 pm    Post subject: Reply to topic Reply with quote

oh yeah does anyone have access to the

inRadius() code thats in the flag.dll -- like determines a radius circular (tiles) ?
Back to top
View users profile Send private message Add User to Ignore List
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Fri Feb 06, 2004 10:21 pm    Post subject: Reply to topic Reply with quote

... (contents that was here, is not revelant anymore)
Back to top
View users profile Send private message Add User to Ignore List
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:41
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Fri Feb 06, 2004 10:37 pm    Post subject: Reply to topic Reply with quote

In radius is simple to make: distance = sqrt( (x1 - x2) ^ 2 + (y1 - y2) ^ 2)

As for the charater: its because type char is stored as a number, like everything else. So to get it to be a string, it needs to be an array, of length 2 (so you can set '\0' at the end).
Back to top
View users profile Send private message Add User to Ignore List Send email
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Sat Feb 07, 2004 12:03 am    Post subject: Reply to topic Reply with quote

but isnt that convered under one of catid's functions of the string class.. well prob not since it is storing as a string
Back to top
View users profile Send private message Add User to Ignore List
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Sat Feb 07, 2004 12:11 am    Post subject: Reply to topic Reply with quote

thanks MGB it worked icon_wink.gif harhar
Back to top
View users profile Send private message Add User to Ignore List
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Sat Feb 07, 2004 1:13 am    Post subject: Reply to topic Reply with quote

Here is a clip of code incase anyone would ever need to use it:

int x = ((p->tile.x * 20) / 1024) + 65;
int y = ((p->tile.y * 20) / 1024) + 1;
char az[2]={x,'\0'};
String ret = az;
// haha just = az not [2]
//ret becomes the location of the player at a coord like: A10, B20 etc...


Last edited by CypherJF on Sat Feb 07, 2004 6:38 pm, edited 1 time in total
Back to top
View users profile Send private message Add User to Ignore List
Dustpuppy
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Jan 23 2003
Posts: 215
Location: England
Offline

PostPosted: Sat Feb 07, 2004 3:27 am    Post subject: Reply to topic Reply with quote

Uh...was that code tested?
Am I the only one who things something should have gone badly wrong?
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Sat Feb 07, 2004 8:08 am    Post subject: Reply to topic Reply with quote

A10/B20 in only 2 chars?
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Sat Feb 07, 2004 4:30 pm    Post subject: Reply to topic Reply with quote

Thats a problem with ?flaginfo in asss too, not enough characters for 10-20
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Sat Feb 07, 2004 5:52 pm    Post subject: Reply to topic Reply with quote

No it works just fine.. cause it takes the character stores into a 2 char array; the actual char # and \0


then append the actual # from int y and wallah you get ret = L#

icon_smile.gif tested it out worked just fine
Back to top
View users profile Send private message Add User to Ignore List
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sat Feb 07, 2004 6:29 pm    Post subject: Reply to topic Reply with quote

Code: Show/Hide
String ret = az[2];

That should have problems. It's exceeding the char array. It won't give a compile error (like in Java) but shouldn't give you the right data...
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Sat Feb 07, 2004 6:37 pm    Post subject: Reply to topic Reply with quote

oh not the [2] but just az icon_smile.gif
Back to top
View users profile Send private message Add User to Ignore List
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sun Feb 08, 2004 12:24 pm    Post subject: Reply to topic Reply with quote

Oh, ok, that would work.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Dustpuppy
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Jan 23 2003
Posts: 215
Location: England
Offline

PostPosted: Sun Feb 08, 2004 1:17 pm    Post subject: Reply to topic Reply with quote

Heh that's what I was referring to
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 95 page(s) served in previous 5 minutes.

phpBB Created this page in 0.482491 seconds : 39 queries executed (87.4%): GZIP compression disabled