RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[runuo 2.2] clue tile

Djeryv

Sorceror
I use 3 different custom land maps on my server where the players need to find the clues to get to the other lands (meaning there are no obvious moongates or teleporters to get there). The problem we have is that our group has been playing this game for almost 15 years. We don't want to (or are even used to) CNTRL-SHIFT all over the place nor double-click every decoration we see to see if a clue is to be found. I made this invisible tile that can be placed in game to make a nearby character have text appear above their head. You can set the message (by changing the items's name) and the distance it will trigger. It also has a timer between message as not so spam the client. So I have a room with a couple of books in it that have clues to find a new land. When a character goes into that room, it will have "the books in this room are quite odd" appear above their head so they know to investigate further.

I tried to figure out the WarningItem.cs but boy did I fail. From what I could tell it seems to only use a cliloc entry to display and I needed to be able to have whatever message I want. If there is a better system for what I did here, feel free to point it out. Otherwise, just put in your customs folder and reboot. Place them wherever you want with whatever messages you want.
 

Attachments

  • NoticeClue.cs
    1.4 KB · Views: 73

Nockar

Sorceror
Cool idea. Thanks for sharing your script.

I just figured out how to do this same thing with xml spanwers the other day.
 

Vorspire

Knight
Good work; You may not have succeeded in understanding the WarningItem script this time, but that can be forgiven as it includes more advanced features that you probably didn't need anyway.

I'm not sure if quest arrows are still used (?) but that would be a cool thing to bring back if not, would fit nicely in with your idea as an addition if you're feeling ambitious :)
 

Talow

Sorceror
So Djeryv here it is the script with my modification.

This one has a few different functions, and even takes into account Vorspire's suggestion.

To use, add the item to game and props it then edit as you see fit.

*required to be set to work.

Delay is how often the item can be triggered by anyone (one for all kind of thing).
*Message is the Message that will be delivered over the player's head.
QuestArrow is weather(true) or not(false) you want to point to the target location.
*Range is how far from the NoticeClue that will trigger it.
Target is the location you want to point to with the QuestArrow.
 

Attachments

  • NoticeClue.cs
    2.9 KB · Views: 16

dazedmouse

Sorceror
Talow when compling yours I get this Error;

Errors:
+ NoticeClue.cs:
CS1501: Line 115: No overload for method 'QuestArrow' takes '3' arguments
 

Talow

Sorceror
I'm not sure why you would be getting that as that's part of the core.

Code:
public QuestArrow( Mobile m, int x, int y ) : this( m, t )
        {
            Update( x, y );
        }

what version of Runuo are you using?
 

Talow

Sorceror
Again it's the core, To be able to fix it I need to know the version of runuo you are using so I can take a look at how that version is set up to use the questarrow.
 

adamg6284

Squire
i am using runuo 2.2.. pretty heavily modified but here is my questarrow.cs file:
Code:
/***************************************************************************
*                              QuestArrow.cs
*                            -------------------
*  begin                : May 1, 2002
*  copyright            : (C) The RunUO Software Team
*  email                : [email protected]
*
*  $Id: QuestArrow.cs 619 2010-12-12 23:55:08Z mark $
*
***************************************************************************/
 
/***************************************************************************
*
*  This program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
***************************************************************************/
 
using System;
using Server;
using Server.Network;
 
namespace Server
{
    public class QuestArrow
    {
        private Mobile m_Mobile;
        private Mobile m_Target;
        private bool m_Running;
 
        public Mobile Mobile
        {
            get
            {
                return m_Mobile;
            }
        }
 
        public Mobile Target
        {
            get
            {
                return m_Target;
            }
        }
 
        public bool Running
        {
            get
            {
                return m_Running;
            }
        }
 
        public void Update()
        {
            Update( m_Target.X, m_Target.Y );
        }
 
        public void Update( int x, int y )
        {
            if ( !m_Running )
                return;
 
            NetState ns = m_Mobile.NetState;
 
            if ( ns == null )
                return;
 
            if ( ns.HighSeas )
                ns.Send( new SetArrowHS( x, y, m_Target.Serial ) );
            else
                ns.Send( new SetArrow( x, y ) );
        }
 
        public void Stop()
        {
            Stop( m_Target.X, m_Target.Y );
        }
 
        public void Stop( int x, int y )
        {
            if ( !m_Running )
                return;
 
            m_Mobile.ClearQuestArrow();
 
            NetState ns = m_Mobile.NetState;
 
            if ( ns != null ) {
                if ( ns.HighSeas )
                    ns.Send( new CancelArrowHS( x, y, m_Target.Serial ) );
                else
                    ns.Send( new CancelArrow() );
            }
 
            m_Running = false;
            OnStop();
        }
 
        public virtual void OnStop()
        {
        }
 
        public virtual void OnClick( bool rightClick )
        {
        }
 
        public QuestArrow( Mobile m, Mobile t )
        {
            m_Running = true;
            m_Mobile = m;
            m_Target = t;
        }
 
        public QuestArrow( Mobile m, Mobile t, int x, int y ) : this( m, t )
        {
            Update( x, y );
        }
    }
}
 

Talow

Sorceror
I seem to be using a different version of this file, for some reason they thought it a good idea to put in the target mobile....

neways I can make it work with the quest arrow but it will take a work around.
 

Talow

Sorceror
Alright sorry about all that, I've created a fix however. Let me know how this one works. I did little testing on the 2.2 core and it worked for me.
 

Attachments

  • NoticeClue.cs
    3 KB · Views: 18

adamg6284

Squire
Code:
Server Crash Report
===================
 
RunUO Version 2.2, Build 4399.41199
Operating System: Microsoft Windows NT 6.1.7600.0
.NET Framework: 2.0.50727.4971
Time: 9/29/2012 4:19:43 PM
Mobiles: 4433
Items: 15063
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
  at Server.QuestArrow.Update(Int32 x, Int32 y)
  at Server.Items.NoticeClue.NoticeClueArrow..ctor(Mobile from, Int32 x, Int32 y)
  at Server.Items.NoticeClue.OnMovement(Mobile m, Point3D oldLocation)
  at Server.Mobile.Move(Direction d)
  at Server.Mobiles.PlayerMobile.Move(Direction d)
  at Server.Network.PacketHandlers.MovementReq(NetState state, PacketReader pvSrc)
  at Server.Network.MessagePump.HandleReceive(NetState ns)
  at Server.Network.MessagePump.Slice()
  at Server.Core.Main(String[] args)
 
Clients:
- Count: 1
+ 192.168.1.1: (account = nephal) (mobile = 0x1 'Adam')
 

adamg6284

Squire
i got this crash when i tried to set a quest arrow. i set the timer on 20 seconds and i targeted a location where i wanted the quest arrow to point to.
 

Talow

Sorceror
on line 65 try this:
Code:
if(m.QuestArrow == null && m_QuestArrow && Target.X > 0 && Target.Y > 0)
 

adamg6284

Squire
if you have skype, add me im adamg6284. would be easier to go back and forth, i can even share screen if you'd like.
 

dracek18

Wanderer
Have you solved the crashing issue Talow? I have probbably the same problem and I'm getting the same error as adamg6284. When I add quest arrow to point somewhere and then logout server will crash. Thanks for help.
 

Talow

Sorceror
Not yet I've been busy with school and work. When I get a spare second I'll look it over again.
 
Top