Hyper.nl Unreal Services Forum Index Hyper.nl Unreal Services
The forum of Hyper.nl Unreal Services and the semi-offical resource for Winged Unicorn's Unreal mods
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

About MCoopExtraCommands

 
Post new topic   Reply to topic    Hyper.nl Unreal Services Forum Index -> Support
View previous topic :: View next topic  
Author Message
AlamGBx



Joined: 26 Jan 2004
Posts: 8
Location: Lawrence, MA

PostPosted: Tue Feb 03, 2004 9:39 pm    Post subject: About MCoopExtraCommands Reply with quote

I was wondering if the MCoopExtraCommands can make to let you "chain" MCoopExtraCommands classes together like a mutator, ofcouse i/anyone can just copy and paste MCoopExtraCommands code together, but it would be great if MCoopExtraCommands behave like a mutator
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Winged Unicorn



Joined: 22 Jan 2004
Posts: 87

PostPosted: Tue Feb 03, 2004 9:57 pm    Post subject: Reply with quote

At the moment, it doesn't work as a mutator. But if I find some time I could always add that in the next little upgrade
_________________
Ride to the starlight... there, where heroes lie
Back to top
View user's profile Send private message Visit poster's website
AlamGBx



Joined: 26 Jan 2004
Posts: 8
Location: Lawrence, MA

PostPosted: Thu Feb 05, 2004 12:54 am    Post subject: I got off my lazy butt and "code up" the ExtraComm Reply with quote

For MCoopExtraCommands
Code:

//================================================================================
// MCoopExtraCommands.
//
// Copyright(c) 2003, Winged Unicorn.
// Modified by Alam_GBC to "chain" like a Mutator
//================================================================================
class MCoopExtraCommands extends Info
   abstract;

var MCoopExtraCommands NextEC;
var MCoopGame MCoopGame;


function PostBeginPlay()
{
   if ( MCoopGame(Level.Game) != None )
      MCoopGame = MCoopGame(Level.Game);
}

function AddEC(MCoopExtraCommands EC)
{
   if(EC==none) return;
   if ( NextEC == None )
      NextEC = EC;
   else
      NextEC.AddEC(EC);
}

function Com(string Command, MCoopUnrealIPlayer Requester)
{
   //pre stuff

   if(NextEC!=none)
      NextEC.com(command,Requester);

   //post stuff
}

For MCoopGame's InitGame
Code:

   /*if (ExtraCommands != "")
   {
      ExtraSpawnClass = Class<MCoopExtraCommands>(DynamicLoadObject(ExtraCommands, class'Class'));
      if (ExtraSpawnClass == None)
         Reason = "load class '"$ ExtraCommands $"'!";
      else
      {
         MCoopExtraCommands = Spawn(ExtraSpawnClass);
         if (MCoopExtraCommands == None)
            Reason = "spawn '"$ string(ExtraSpawnClass) $"' mutator!";
      }
   }*/

   MCoopExtraCommands = spawn(class'MCoopExtraCommands');
   log("Base ExtraCommands is "$MCoopExtraCommands);
   InOpt = ExtraCommands; //copy
   if ( InOpt != "" )
   {
      log("ExtraCommands"@InOpt);
      while ( InOpt != "" && Reason=="")
      {
         pos = InStr(InOpt,",");
         if ( pos > 0 )
         {
            LeftOpt = Left(InOpt, pos);
            InOpt = Right(InOpt, Len(InOpt) - pos - 1);
         }
         else
         {
            LeftOpt = InOpt;
            InOpt = "";
         }
         ExtraSpawnClass = class<MCoopExtraCommands>(DynamicLoadObject(LeftOpt, class'Class'));
         if (ExtraSpawnClass == None)
            Reason = "load class '"$ LeftOpt $"'!";
         else
         {
            TempEC = Spawn(ExtraSpawnCLass);
            if (TempEC == None)
               Reason = "spawn '"$ string(ExtraSpawnClass) $"' mutator!";
            else
            {
               log("Add ExtraCommands "$LeftOpt);
               MCoopExtraCommands.AddEC(TempEC);
            }
         }
      }
   }

   if (Reason != "")
   {
      Log("**************************************************************************************************************", 'MCoopMutator');
      Log("    CRITICAL ERROR!!  Server crashed because it couldn't "$ Reason, 'MCoopMutator');
      Log("**************************************************************************************************************", 'MCoopMutator');
      ConsoleCommand("exit");
   }
   else
   {
      Log("----------------------------------------------------------------------------------------------------------------------------", 'MCoopMutator');
      Log("    Game Mutator loaded....."@ string(MCoopMutator.Class), 'MCoopMutator');
      Log("    Commands Mutator loaded....."@ string(MCoopCommands.Class), 'MCoopMutator');
      if (ExtraCommands != "")
         Log("    Extra Commands Mutator(s) loaded....."@ ExtraCommands, 'MCoopMutator');
      Log("----------------------------------------------------------------------------------------------------------------------------", 'MCoopMutator');
   }

hmm, it feel go to code "new" stuff ahhh, i hope my ego didn't show
_________________
My Qtracker Server List: http://lawarias.webhop.net
My Website: http://lawarias.webhop.info
My Currect Project: SRB2 Coding http://www.srb2.org/
My 2 Fav Mod:JCoop And (AK)MCoop
My Fav Radio: http://radio.emulationzone.org
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Winged Unicorn



Joined: 22 Jan 2004
Posts: 87

PostPosted: Thu Feb 05, 2004 1:09 pm    Post subject: Reply with quote

Heh thanks for your code, but I already had in mind to use a dynamic array (I prefer not to grab ExtraCommands from the Options string because it will be harder for admins to set it up ). Anyway, as soon as people come up with new bugs or little requests, I will release a new upgrade
_________________
Ride to the starlight... there, where heroes lie
Back to top
View user's profile Send private message Visit poster's website
AlamGBx



Joined: 26 Jan 2004
Posts: 8
Location: Lawrence, MA

PostPosted: Thu Feb 05, 2004 1:37 pm    Post subject: Reply with quote

The Code pull from the ExtraCommand like this
GBxMCmd.xmCMD,GBxj4cmd.xjCmd
from ExtraCommand, not from the Options string
Code:

InOpt = ExtraCommands; //copy


See? :/

oh wait!
Code:

 //check for ExtraCommands list
 InOpt = GetPropertyText("ExtraCommands"); // if ExtraCommands was a dyn string arrty
 // strip the parens
 InOpt = Mid(InOpt, 1, Len(InOpt) - 2);


And i forget the temp vars i made for my code
Code:

 local string InOpt, LeftOpt;
 local int pos;
 local MCoopExtraCommands TempEC;

_________________
My Qtracker Server List: http://lawarias.webhop.net
My Website: http://lawarias.webhop.info
My Currect Project: SRB2 Coding http://www.srb2.org/
My 2 Fav Mod:JCoop And (AK)MCoop
My Fav Radio: http://radio.emulationzone.org
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Winged Unicorn



Joined: 22 Jan 2004
Posts: 87

PostPosted: Thu Feb 05, 2004 7:28 pm    Post subject: Reply with quote

hehe Alam, I already wrote that little code using native functions of mine two days ago. Anyway, thanks for your "tips" (even if not really needed)
_________________
Ride to the starlight... there, where heroes lie
Back to top
View user's profile Send private message Visit poster's website
AlamGBx



Joined: 26 Jan 2004
Posts: 8
Location: Lawrence, MA

PostPosted: Thu Feb 05, 2004 8:26 pm    Post subject: Reply with quote

ok
_________________
My Qtracker Server List: http://lawarias.webhop.net
My Website: http://lawarias.webhop.info
My Currect Project: SRB2 Coding http://www.srb2.org/
My 2 Fav Mod:JCoop And (AK)MCoop
My Fav Radio: http://radio.emulationzone.org
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Hyper.nl Unreal Services Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot 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


Powered by phpBB © 2001, 2005 phpBB Group