Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Aransus

Pages: [1] 2
1
Dead Souls Support / Re: Setting up Dead Souls - suggested Linux distro?
« on: February 26, 2007, 04:28:20 pm »
I'd suggest you play around with a few different Linux distributions, the same way you did with mudlibs. Since DS isn't terribly picky about which flavor it runs on, you have a fair bit of freedom to find what -you- want to run. Most distributions have live CD's available, which you can use to boot the OS and play around a bit without going through a number of OS installs. Some you may be interested in are:

Ubuntu - http://www.ubuntu.com/download
Fedora - http://fedora.redhat.com/Download/ (no live CD that I could see)
Mandriva - http://www.mandriva.com/en/download

While Fedora doesn't seem to have a live CD available for download (I could just be blind), it may be worth a shot if you're used to Red Hat.

Good luck with the new mud!

2
This code compiles fine on my DS2.1 mud. Based on this, though:

Oblivion@MatrixMud <ds> ok the first three lines are *Bad argument 2 to
foreach Expected: array Got: 0. Object: /realms/oblivion/area/npc/Agent#5214
(/lib/race.c) at line 98

I'd say the most likely problem is that someone removed 'human' as a valid race.

-- Aransus

3
Dead Souls Support / Syntax error
« on: September 19, 2006, 12:57:20 pm »

Doh, you're right, that was dumb  :P. The array functionality is actually damn useful, because it lets you map one description to many item names. Ah well, the brain can't work all the time :).



Anyway, I noticed something else that's going to give you trouble when you try to load this room, Zaroth. On line 9, you have SetAmbientLight("10"). You're passing a string to SetAmbientLight(), instead of an integer. The file will still update successfully, but you'll get crazy errors when you try to go to the room. Change it to SetAmbientLight(10) (without the quotes around the 10), and you should be fine.



Sorry to spin you in circles with bad advice the first time around!



-- Aransus


4
Dead Souls Support / Syntax error
« on: September 19, 2006, 12:33:20 pm »
The problem: You are using arrays as keys to your SetItems() mapping, when you should be using strings.



The fix:



({ "fireplace" }) ---should be---> "fireplace"

({ "bookcases" }) ---should be---> "bookcases"

etc...



Hope that helps!



Edit: Just figured I'd add in a full, syntactically correct SetItems() bit, for the sake of completeness.



SetItems( ([

  "fireplace" : "There's a fireplace here.",

  "bookcases" : "There are bookcases here.",

// Side note: The comma at the end of the above line is optional

]) );



I suggest putting each item on a new line, for a number of reasons. It enhances code readability, makes it easier to edit/add/delete items, and simplifies tracking down pesky little errors.



-- Aransus

5
Dead Souls Support / Fix for channel emotes
« on: September 14, 2006, 06:38:39 pm »
You presume correctly, no problems here.



-- Aransus

6
Dead Souls Support / Fix for channel emotes
« on: September 14, 2006, 03:23:23 pm »
Shadyman@QuantumScape raised an issue on the ds channel today. You can replicate the issue by typing 'qtip', followed by 'creemote qtip'. Notice that in a room, everything looks fine. On the channel, however, the first verb appears in all four verb slots ('takes' instead of 'takes'/'stares'/'sticks'/'exclaims').



The root of the problem is in /secure/sefun/messaging.c, on line 346 of stock DS2.1:



words = ""+pluralize(verb[0]);



The line -should- read:



words = ""+pluralize(verb[verb_count++]);



The incorrect line only appears in the section that applies to an emote observer (the code for 'target' and 'subject' is correct). That's why the screwy output only shows up on channels, or in a room if you're a non-targetted observer.



If this has already been fixed, or I've muffed up something else by changing the line, let me know. Thanks!



Note: So far, the only way I've been able to make this change take effect is by rebooting the mud. I've tried updating (even with the -r switch) /daemon/soul, /secure/daemon/chat, /secure/sefun/messaging, and /secure/daemon/master. If someone knows how to make this take effect without a reboot, please post. Thanks!



-- Aransus

7
General / Trouble running/compiling
« on: November 17, 2006, 10:04:14 am »

You probably know this already, but it's worth throwing in just in case...



If you forget the '&' and have to ctrl-z to get back to a command prompt, you can use the 'jobs' command to see which jobs are running and which are stopped. Then if you see:



[1]+  Stopped                 ./addr_server 9999



You can type 'bg %1' to toss the process into the background, which does what the forgotten '&' would have done. If you want to kill it instead, you could 'fg %1' and then ctrl-c, or just 'kill -9 %1'.



Sometimes it's easier to work with job ID's, since there's less of a risk of killing something you don't want to kill. In any case, hope you're up and running well now :).


8
General / random quote+mfunc lib broken
« on: November 03, 2006, 05:31:18 pm »
Line 121 has an extra ", at the end. The file updates fine with that taken out.

9
General / offline editor
« on: November 01, 2006, 07:13:02 pm »

It should have come with 6.3, but oh well. You can download it here:



http://www.vim.org/scripts/script.php?script_id=761">http://www.vim.org/scripts/script.php?script_id=761



Be sure to check out ':help lpc.vim' too, for configuration. The file is supposedly compatible with 6.0+, and I can vouch for it on vim7.


10
General / offline editor
« on: November 01, 2006, 06:29:29 am »
Another option is to just ':set filetype=lpc' while you have an LPC file open, and see if the highlighting changes.

11
General / offline editor
« on: October 26, 2006, 09:24:00 am »
vim

12
General / ordered array? please help
« on: October 24, 2006, 02:23:17 pm »
The strcmp() function is sorting alphabetically, yes. If you want a hierarchical-type sort, you'll want to tweak Amun-Ra's solution like this:



LPC code:
static int special_sort(object alpha, object beta) {

    mapping titles = ([
        "Boss" : 0,
        "Under-Boss" : 1,
        "Soldier" : 2
    ]);
    int a = titles[ alpha->GetGuildRank() ];
    int b = titles[ beta->GetGuildRank() ];

    if( a < b ) return -1;
    else if( a > b ) return 1;
    return 0;

}




This is just a sample of something that may work. I don't think I advocate doing it this way in the long run, because it seems sensible for rank names and their relative 'levels' to be defined in the same place (wherever GetGuildRank() is getting its info from). This is just a demonstration. Ok, now with the disclaimer out of the way, I hope it works ;).

13
General / doors in interactive.c, help please
« on: October 18, 2006, 06:23:28 pm »
Capo,



Have a peek at this code. I'm just posting the 'if( !brief )' block that starts on line 217 in my /lib/interactive.c. I also had to define 'string doorexit' as a global variable, because I was running into 'too many local variable' errors defining it within this block. If this does what you want, you may want to figure out how to consolidate variables so you don't have to define doorexit globally. In any case, hope this helps somewhat.



LPC code:
    if( !brief ) {
        if( i == VISION_CLEAR ){
            desc = (string)env->GetObviousExits() || "";
            if(desc && desc != "")
                desc = capitalize((string)env->GetShort() || "")
                + " [" + desc + "]\n";
            else desc = capitalize((string)env->GetShort()+"\n" || "\n");
        }
        else desc = "\n";
        if( i == VISION_CLEAR || i == VISION_LIGHT || i == VISION_DIM )
            desc += (string)env->GetLong();

        if(functionp(tmp = (mixed)env->GetSmell("default")))
            tmp = (string)(*tmp)("default");
        smell = tmp;
        if(functionp(tmp = (mixed)env->GetListen("default")))
            tmp = (string)(*tmp)("default");
        sound = tmp;
        if( functionp(tmp = (mixed)env->GetTouch("default")) )
            tmp = evaluate(tmp, "default");
        touch = tmp;

        desc += "\n\n";
        foreach( doorexit in env->GetDoors() ) {

            desc += capitalize( env->GetDoor(doorexit)->GetShort() );
            if( env->GetDoor(doorexit)->GetClosed() )
                desc += " is closed.\n";
            else
                desc += " is open.\n";
        }

    }




-- Aransus

14
General / player.c, armor.c, weapon.c problem
« on: October 19, 2006, 09:57:37 am »

Not sure if you're still messing with this or not, but you should be able to get what you want by simply changing the three instances of $1->GetEquippedShort() to $1->GetShort() inside /lib/player.c's GetLong(). There's really no need to use an EquippedShort if you're already identifying wielded/worn items. And that way, you leave the other commands that use GetEquippedShort() unaffected.



-- Aransus


15
General / Forge is fun, help!
« on: September 28, 2006, 08:32:35 am »
Hey Capo, have a peek at this:



LPC code:
#include <lib.h>
#include <daemons.h>
#include <position.h>
#include <privs.h>
#include <config.h>

inherit LIB_DAEMON;
inherit LIB_VERB;

string process_input( string str, string from );
int MainWeaponMenu();
int CuttingMenu();
int ThrustingMenu();
int AxesMenu();
int MacesMenu();
int LancesMenu();

static void create()
{
    verb::create();
    SetVerb("forge");
    SetRules("","STR");
    SetErrorMessage("Syntax: forge <%^BOLD%^%^RED%^armor%^RESET%^> or
    (%^BOLD%^%^CYAN%^weapon%^RESET%^)");
    SetHelp("Syntax: forge <%^BOLD%^%^RED%^armor%^RESET%^> or (%^BOLD%^%^CYAN%^
    weapon%^RESET%^)\n"
      "This command allows you to forge weapons and armor\n\n");
}

mixed can_forge()
{
  return "forge <%^BOLD%^%^RED%^armor%^RESET%^> or (%^BOLD%^%^CYAN%^weapon%^
    RESET%^)\n";
}

mixed can_forge_str(string str)
{
    int pos = this_player()->GetPosition();
    if( (int)this_player()->GetParalyzed() ) {
        return "You cannot move!";
    }
    if( pos == POSITION_SITTING || pos == POSITION_LYING &&
      !RACES_D->GetLimblessCombatRace(this_player()->GetRace()) ){
        return "You cannot teach in that position!";
    }
    if(!str || str == "" || str != "weapon" || str != "armor")
           {
     write("forge <%^BOLD%^%^RED%^armor%^RESET%^> or (%^BOLD%^%^CYAN%^weapon%^
    RESET%^)\n");
     return 1;
       }
    return 1;
}

mixed do_forge_str(string str)
{
    switch( str ) {
      case "armor" :
        // MainArmorMenu();
        break;
      case "weapon" :
        MainWeaponMenu();
        break;
      default :
        GetHelp( "" );
    }
    return 1;
}

string process_input( string str, string from )
{
    switch (str)
      {
    case "q" :
    case "x" :
        switch( from ) {
          case "CuttingMenu":
          case "ThrustingMenu":
          case "AxesMenu":
          case "MacesMenu":
          case "LancesMenu":
            MainWeaponMenu();
            break;
          case "MainWeaponMenu":
          case "MainArmorMenu":
            write("You abort the forging process.\n");
            return " ";
        }
        break;
    case "y" : write("You abort the forging process.\n");return " ";
    case "cutting swords" : CuttingMenu(); break;
    case "thrusting swords" : ThrustingMenu(); break;
    case "axes" : AxesMenu(); break;
    case "maces" : MacesMenu(); break;
    case "lances" : LancesMenu(); break;
    default :
        write("'"+ str +"' is not a valid menu option.\n");
        call_other( this_object(), from );
      }
    return "(Menu fun finished.)";
    }

varargs mixed MainWeaponMenu(string str) {
    string tmp;
    tmp =  "You know how to forge the following types of weapon:";
    tmp += "----------------------------------------------------\n";
    tmp += "\t\t cutting swords\n";
    tmp += "\t\t thrusting swords\n";
    tmp += "\t\t axes\n";
    tmp += "\t\t maces \n";
    tmp += "\t\t lances\n\n";
    tmp += "\t\t q to abort\n";

    this_player()->eventPrint(tmp, "foo");

    input_to( (: process_input :), 0, "MainWeaponMenu" );
    return 1;
}

static int CuttingMenu()
{
    string tmp;

    tmp =  "You know how to forge the following types of cutting swords";
    tmp += "---------------------------------------------------------\n";
    tmp += "\t\t something goes here";
    tmp += "\t\t q to abort\n";

    this_player()->eventPrint(tmp, "foo");
    input_to( (: process_input :), 0, "CuttingMenu" );
    return 1;
}

int ThrustingMenu()
{
    string tmp;

    tmp =  "You know how to forge the following types of thrusting swords:";
    tmp += "-------------------------------------------------------------\n";
    tmp += "\t\tsomething goes here";
    tmp += "\t\tq to quit\n";

    this_player()->eventPrint(tmp, "foo");
    input_to( (: process_input :), 0, "ThrustingMenu" );
    return 1;
}

int AxesMenu()
{
    string tmp;

    tmp =  "You know how to forge the following types of axes:";
    tmp += "--------------------------------------------------\n";
    tmp += "\t\t something goes here";
    tmp += "\t\tq to quit\n";

    this_player()->eventPrint(tmp, "foo");
    input_to( (: process_input :), 0, "AxesMenu" );

    return 1;
}

int MacesMenu()
{
    string tmp;

    tmp =  "You know how to forge the following types of maces:";
    tmp += "----------------------------------------------------\n";
    tmp += "\t\n\n";
    tmp += "\t\t something goes here";
    tmp += "\t\tq to quit\n";

    this_player()->eventPrint(tmp, "foo");
    input_to( (: process_input :), 0, "MacesMenu" );
    return 1;
}

int LancesMenu()
{
    string tmp;

    tmp =  "You know how to forge the following types of lances:";
    tmp += "----------------------------------------------------\n";
    tmp += "\t\t something goes here!! imagine that";
    tmp += "\t\t q to quit\n";

    this_player()->eventPrint(tmp, "foo");
    input_to( (: process_input :), 0, "LancesMenu" );

    return 1;
}

 string GetHelp(string str) {
    return ("Syntax: <forge>\n\n");
}




This code provides some examples of how the flow -could- work. It updates and runs without error, though it may not do exactly what you're looking for. Hopefully it proves useful.



-- Aransus

Pages: [1] 2