Go Back   RunUO - Ultima Online Emulation > RunUO > Script Support

Script Support Get support for modifying RunUO Scripts, or writing your own!

Reply
 
Thread Tools Display Modes
Old 08-04-2008, 01:07 PM   #1 (permalink)
Forum Novice
 
Arkryal's Avatar
 
Join Date: Jan 2003
Location: Rochester NY
Age: 26
Posts: 208
Unhappy Speech to MobileID

Okay, one more question.

Has anyone got an example of converting a spoken name to a MobileID?

In reworking my falconry script, I would like to be able to have the player say "Send this to PlayerName". Capture that player name from the speech argument and the item chosen is put in the falcon's pack. The falcon is then teleported (after a Fly-off screen animation and short delay I've worked up) to the location of the Mobile named in the command. The reciving player then is freiended to the bird and given a message that a package has arrived for them etc.

Some obvious problems, converting string to a Mobile type, handling letter case etc. I've looked at several chat systems and mail systems but don't quite see what I need. I am trying to avoid creating a "Friend List" or limiting the number of people that the falcon can interact with. Since the sending and recieving players may be in different areas of the world, targeting is no good.

I'll be implementing a custom letter-writing system as well. I prefer this to current chat systems as dialogue between 2 people 1000 miles apart should not be instantaneous. I think it lends more to the realism of my shard.

I've considered reading in from the accounts list and converting it to Lowercase and building an array, but it presents an issue since new players would have to wait for a complete recompile before being accessible by the system.

Any ideas?
__________________
•¤•¤•Arkryal •¤•¤•
Arkryal is offline   Reply With Quote
Old 08-04-2008, 02:11 PM   #2 (permalink)
Master of the Internet
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 6,024
Send a message via Yahoo to Lord_Greywolf
Default

best way would be to set it up as a command

[Falcon "name"
or [FalconGoTo "Name"
etc

if no "name" return with message error needs a name
then have a check for all mobiles
and if playermobile and name == "name" then sendfalcon and break
if none are found - send message to make sure the player's name is spelled correctly
also - remember if more than 1 player with that name, it will only send it to the 1st one it fines with the name
and the name has to be exact, including CaPs
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)
Lord_Greywolf is offline   Reply With Quote
Old 08-06-2008, 11:01 AM   #3 (permalink)
Forum Novice
 
Arkryal's Avatar
 
Join Date: Jan 2003
Location: Rochester NY
Age: 26
Posts: 208
Default

Worked very well, thanks for the advice.
__________________
•¤•¤•Arkryal •¤•¤•
Arkryal is offline   Reply With Quote
Old 08-06-2008, 11:11 AM   #4 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 21
Posts: 2,294
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Default

Take what you have that works now, and apply it to the OnSpeech method in your Falcon NPC script, to check the name, simply use something like:

Code:
//Get "Name" from "Send this to <Name>"
//(where "nameToCheck" is a string variable of the name from the list you have already.

//If it IS a match.
if( e.GetString( 3 ).IndexOf( nameToCheck ) != -1 )
{
//do something.
}
I guess it would give it the more realistic feel as opposed to a command, but there's nothing wrong with what you have already and what greywolf suggested

As for deciding which player to send it to in a multiple scenario, you can have something like;

"Send this to [<Title>] <Name> [ in ] [ in region <Region>/ in guild <Guild> ]"
"Send this to Lord Vorspire in guild Staffembers"
"Send this to Lord Vorspire in region Shame"
"Send this to Vorspire in guild Staffembers"
etc...

where [ and ] are optional?
__________________

RPK.VORSPIRE.COM - The WoW-UO Cross-Over Shard

Last edited by Vorspire; 08-06-2008 at 11:18 AM.
Vorspire is offline   Reply With Quote
Old 08-07-2008, 11:02 AM   #5 (permalink)
Forum Novice
 
Arkryal's Avatar
 
Join Date: Jan 2003
Location: Rochester NY
Age: 26
Posts: 208
Default

cool idea. I was thinking about simply passing a name from the speech events to the existing command code. The trouble I have is the fact that there would be multiple commands that may include a player name.

At lower levels, a player may train the falcon to send a message.
At a higher level, they may send an item.
At the highest, they may send many items (pack capacity).
They may be commanded to track a player if it's in x range (imagine bounty systems then)

So I would need to compare part of the string to the name list and reference another part to a list of commands.

Any ideas??? C# is not my language of choice, my efforts there have been victim of many syntactical errors.
__________________
•¤•¤•Arkryal •¤•¤•
Arkryal is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5