Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, DotBot

Members: 0
Guests: 7
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » LoP Codebase » Program issuse
Forum Rules | Mark all | Recent Posts

Program issuse
< Newer Topic :: Older Topic > mprog_give_trigger broke?

Pages:<< prev 1 next >>
Post is unread #1 Jan 22, 2009, 5:32 am
Go to the top of the page
Go to the bottom of the page

Sanus Compleo
Magician
GroupMembers
Posts153
JoinedMar 25, 2008

Lately I've been messing around with code, hoping that I'll learn something or other (not to say that I haven't), when I came across an interesting problem with progs and such. I wanted to program the pets to gain levels randomy while they're in a fight (Wouldn't it be nice to set variables in programs? (Has an ifcheck for each level up to 32 on one mob so far, and I want to goto level 99 -_-), and I figured it would be nice to emulate some kind of hunger by the mobs, and I started work on a little give pogram. After much frustration, I wondered if the give trigger was broken so I tried adding scripts that would cause obvious error messages, and set the percentage to 100 on this new prog. Upon giving the mob a magic mushroom, nothing happened. So, like all good scientists, I spammed enter, until the mob's inventory was full. Nothing happened. I looked throuh act_obj, and saw where the trigger called, and all seemed to be well with that, then looked in mud_prog.c, found the trigger, nothing seemed to be wrong with that, so now I'm quite stumped. The mud_prog and act_obj files are untouched from when I downloaded them, so.. any ideas?
       
Post is unread #2 Jan 22, 2009, 8:44 am
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

You put progs on a pet?

Progs don't work on pets.
       
Post is unread #3 Jan 22, 2009, 9:14 am
Go to the top of the page
Go to the bottom of the page

Sanus Compleo
Magician
GroupMembers
Posts153
JoinedMar 25, 2008

Progs work on pets >.> And it turns out that there was an if line that would return the program if the second argument was the same as the name of the object... Dunno how that got in there, I think it's from stock LOP, which isn't good.
       
Post is unread #4 Jan 22, 2009, 12:05 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

Will need a little more info then that to go on Sanus. An example program or something to see what the issue is or what you think it might be.
       
Post is unread #5 Jan 22, 2009, 12:18 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

There might be a little more to the story, too.
       
Post is unread #6 Jan 22, 2009, 12:35 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

Interesting, as far as I know they all work like they are suppose to...but guess I can recheck them all lol.
       
Post is unread #7 Jan 22, 2009, 1:33 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

Well it looks like I had messed up on how the give program works (in the help file).
for the mushroom on a give program you would need to use
mpedit <#> add give magic mushroom

If you want it to work when anything is given use
mpedit <#> add give all

As long as you haven't changed the name of the magic mushroom that is.

It auto does it 100% so just need to update the help file for how to use it correctly.


And as far as the fight_prog for objects goes there has never been one added for that. :)
       
Post is unread #8 Jan 22, 2009, 1:45 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

Since I just modified this in my copy here is a slightly modified give program to make it a little better.
void mprog_give_trigger( CHAR_DATA *mob, CHAR_DATA *ch, OBJ_DATA *obj )
{
   MPROG_DATA *mprg;
   char buf[MIL];
   int vnum;

   if( is_npc( mob ) && can_see( mob, ch ) && HAS_PROG( mob->pIndexData, GIVE_PROG ) )
   {
      /* Don't let a mob trigger itself, nor one instance of a mob trigger another instance. */
      if( is_npc( ch ) && ch->pIndexData == mob->pIndexData )
         return;

      for( mprg = mob->pIndexData->mudprogs; mprg; mprg = mprg->next )
      {
         one_argument( mprg->arglist, buf );

         vnum = -1;
         if( is_number( buf ) )
            vnum = atoi( buf );

         if( mprg->type == GIVE_PROG && ( !str_cmp( obj->name, buf ) || !str_cmp( "all", buf ) || ( vnum != -1 && obj->pIndexData->vnum == vnum ) ) )
         {
            mprog_driver( mprg->comlist, mob, ch, obj, NULL, false );
            break;
         }
      }
   }
}

This will allow you to use an object vnum and more then one for the same program etc...
Example:
mpedit <#> add give 'magic mushroom' '20' '30'

so if you gave the mobile an item named magic mushroom, item vnum 20 or 30 it would allow it to work.
       
Post is unread #9 Jan 22, 2009, 4:14 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Pets can use progs? Is this unique to LoP? Because Smaug didn't.
       
Post is unread #10 Jan 22, 2009, 5:21 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

Not that I know of (sorry forgot to answer that one). They can however party with players (if around their level) and gain levels with them. Pets also can have spec functions and them work on LOP where they didn't in SMAUG. Would be simple enough to allow programs to work with pets since its as simple as removing the charm check. or tossing in to ignore the charm if they are someone's pet...
       
Post is unread #11 Jan 25, 2009, 6:37 am
Go to the top of the page
Go to the bottom of the page

Sanus Compleo
Magician
GroupMembers
Posts153
JoinedMar 25, 2008

Er, sorry, no, it's just unique to my server (And very useful as well, especially if you want more interaction with pets.) Thankfully, remcon had the foresight to add in a bit of code in the order command to return if the order involves an mpcommand, I copied that for cast, because from time to time it's nice to have a mob that buffs you :P Also, no more problem with give trigger, remcon helped me through that and some other LOP things yesterday, so all is well now.
       
Post is unread #12 Jan 26, 2009, 6:29 am
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Have you made sure progs on pets can't be abused?
       
Post is unread #13 Jan 26, 2009, 11:18 am
Go to the top of the page
Go to the bottom of the page

ayuri
Magician
GroupMembers
Posts239
JoinedJun 13, 2008

I'm interested in just what your doing with pets and progs. I myself with help of many others managed to get pets working in a fashion for swfote. Seeing how its a Star Wars game - I can't think of to many things to put on a pet prog wise. Does each pet come with progs or do your players pay points to have progs put on their pets?

Just wondering.
Ayuri
       
Post is unread #14 Jan 29, 2009, 4:31 am
Go to the top of the page
Go to the bottom of the page

Igabod
Fledgling
GroupMembers
Posts40
JoinedSep 25, 2008

by pets do you mean droids ayuri? cause I think LOTJ has the ability to buy droids as pets as well. As for progs to put on a droid, you could add random progs making the droid beep like R2-D2, or if it's a cheap droid you can make it have a rand prog that makes it break down and stop moving. There are a billion and one different progs you could add to droids to add some flavor.
       
Post is unread #15 Jan 29, 2009, 9:43 am
Go to the top of the page
Go to the bottom of the page

ayuri
Magician
GroupMembers
Posts239
JoinedJun 13, 2008

By pets, I mean actual NPC slaves. Think Twi'leks, Zeltrons. Slave girls, Leia in the gold bikini...That sort of thing. :biggrin:
As far as droids go - they are rather limited in my game.
I've not actually tired to toss progs on them yet, just haven't had the time as of late to look into it.

Ayuri
       
Pages:<< prev 1 next >>