Full Version : [global + XmlSpawner
xmlspawner >>Q&A >>[global + XmlSpawner


<< Prev | Next >>

Vladimir- 08-14-2006
Hi there

I have a "maze" with 114 teleporters. When a player finished the maze I want to set all of the teleporters to active again, but if i can help id rather not write 114 lines for it.

Each of the tele's has to have its own name, because i need to refer to them individually with other spawners.

is it possible to use a global command for this? and if so what would the format be?

They all have the same point dest, so could i do something along the lines of a Gloabal Set Active True where pointdest=(1234,2423,43)?

Thx for your help

Vlad

ArteGordon- 08-14-2006
it would be something like that

[global set active true where teleporter pointdest == (1234,2423,43)

Vladimir- 08-14-2006
Ok but would I be able to add that in a spawner entry? so that when the spawner triggers it does that global cmd?

ArteGordon- 08-14-2006
QUOTE (Vladimir @ August 14, 2006 05:40 pm)
Ok but would I be able to add that in a spawner entry? so that when the spawner triggers it does that global cmd?

unfortunately the runuo command system requires commands to be issued by mobiles so that accesslevel can be checked.
There is a "COMMAND/commandline" keyword, but it can only be used in conjunction with player triggering, and the player has to have accesslevel sufficient to issue the command.

COMMAND/global set active true where teleporter pointdest == (1234,2423,43)

So an staff GM or higher would have to trigger the spawner and then the command would be issued.

Vladimir- 08-14-2006
Ouch :S hehe ok looks like i'm going to have to write out 114 lines then ;p or make everyone a GM ^.^

hehe thanks for the help again smile.gif

ArteGordon- 08-14-2006
QUOTE (Vladimir @ August 14, 2006 05:53 pm)
Ouch :S hehe ok looks like i'm going to have to write out 114 lines then ;p or make everyone a GM ^.^

hehe thanks for the help again smile.gif

there is a possible solution that involves creating a "dummy" char with appropriate access level, and then having that char coded to issue the commands of the "COMMAND" keyword.

It is a simple mod to accomplish this.

around line 9147 in basexmlspawner.cs make this change

QUOTE

                    case typeKeyword.COMMAND:
                        {
                            // the syntax is COMMAND/commandstring
                            string[] arglist = ParseSlashArgs(substitutedtypeName, 3);
                            if (arglist.Length > 0)
                            {
                                // mod to use a dummy char to issue commands
                                Mobile dummy = FindMobileByName(spawner, "dummycharname", "PlayerMobile");
                                    if (dummy != null)
                                    {
                                        CommandSystem.Handle(dummy, String.Format("{0}{1}", CommandSystem.Prefix, arglist[1]));
                                    }
                               
                                /*
                                if (triggermob != null && !triggermob.Deleted)
                                {
                                    CommandSystem.Handle(triggermob, String.Format("{0}{1}", CommandSystem.Prefix, arglist[1]));
                                }
                                 */

                            }


where you would substitute the name of your dummy char for "dummycharname".

With this mod, you no longer have to trigger the spawner, and you can have the spawner issue commands any time you like.
I would set the accesslevel of the char to GM or lower. That will determine the commands that are allowed.

I think I will add support for this mod to the next release.

(edit)

I added support for this into basexmlspawner.cs in beta_20_315.zip