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 04-17-2008, 04:01 PM   #1 (permalink)
Lurker
 
Join Date: Mar 2008
Posts: 5
Question ContextMenuEntry Problems, can anyone help?

Ok, Im trying to add quite a simple context menu entry.
I want to be able to change the 'Controlled' prop of a custom basecreature from within the OnClick ctor of my custom context menu entry.
Problem is it complies saying
Server.Mobiles does not contain a defination for...
The hue entry here works, but "m_Follow.Controlled = true;" does not, because Controlled is a variable for BaseCreature not Mobile.

Code:
public override void OnClick()
		{
			if ( m_Follow.Deleted || !m_From.CheckAlive() || !m_Follow.CheckAlive() )
				return;

			m_From.SendMessage("The subject follows you");
			m_Follow.Controlled = true;
			m_Follow.Hue = 12;
		}
Anyone understand what I'm on about - or better yet can help?
IceColdFish is offline   Reply With Quote
Old 04-17-2008, 04:26 PM   #2 (permalink)
Newbie
 
Join Date: Feb 2008
Age: 29
Posts: 23
Default

Try:

Code:
((BaseCreature)m_Follow).Controlled = true;
It's a bit picky and I'm not sure if that will work.
MadDawg2552 is offline   Reply With Quote
Old 04-17-2008, 10:34 PM   #3 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 34
Posts: 3,848
Default

Quote:
Originally Posted by MadDawg2552 View Post
Try:

Code:
((BaseCreature)m_Follow).Controlled = true;
It's a bit picky and I'm not sure if that will work.
You'd also have to set ControlMaster and probably the Command to something like Command.Follow or something otherwise I think the mobile will still ignore the person.
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."
Greystar is offline   Reply With Quote
Old 04-18-2008, 04:58 AM   #4 (permalink)
Lurker
 
Join Date: Mar 2008
Posts: 5
Default

@MadDawg2552
Great, works like a charm. I thought that might be what was needed.

@Greystar
Yeh, I had all that in before, took it out to make post a little simpler :P

Thanks very much to the both of you.
IceColdFish is offline   Reply With Quote
Reply

Bookmarks

Tags
contextmenu, onclick, problem


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