Adding a new if check in mob program

Posted by Oblisgr on Tue 31 Mar 2020 12:28 PM — 4 posts, 20,141 views.

#0
Hello, i know you don't support area editor anymore but i want to ask something and maybe you can help by your experience.

I have added to my code, new if checks for mob programs but area editor does not recognize them.

Fr exmple i added MG which is the faction Mages guild and i ask if it is less than -200 to do somthing. If i edit the area file with notepad and put it, smaug recognized but the area editor eachself doesnt.

Is there any way to add it in editor?


if isPC($n)
if MG($n) < -200
say Traitor!!!
murder $n
endif
endif
Australia Forum Administrator #1
There is a way, if you compile it yourself. The source is here: http://www.gammon.com.au/downloads/dlareaeditor.htm

In the file CheckCommandSyntax.cpp appears to be a list of things it checks against, like "ispc" like this:



const t_specialconditions SpecialConditions [] =
  {

    // no vnums
    { "rand", eCondNone, eCondNone, true  },
    { "otypehere" },
    { "otyperoom" },
    { "otypecarry" },
    { "otypewear" },
    { "otypeinv" },
    { "number" },
    { "name" },
    

    // room argument, eg. mobinroom (10300) > 4
    { "economy", eCondRoom }, 
    { "mobinroom", eCondRoom }, 

    // mob argument
    { "timeskilled", eCondMobile }, 
    { "ismobinvis", eCondMobile, eCondNone, true },
    { "mobinvislevel", eCondMobile },
    { "ispc", eCondMobile, eCondNone, true },
    { "isnpc", eCondMobile, eCondNone, true },
    { "ispkill", eCondMobile, eCondNone, true },
    { "isdevoted", eCondMobile, eCondNone, true },
    { "canpkill", eCondMobile, eCondNone, true },
    { "ismounted", eCondMobile, eCondNone, true },
    { "isgood", eCondMobile, eCondNone, true },
    { "isneutral", eCondMobile, eCondNone, true },
    { "isevil", eCondMobile, eCondNone, true },
    { "isfight", eCondMobile, eCondNone, true },
    { "isimmort", eCondMobile, eCondNone, true },
    { "ischarmed", eCondMobile, eCondNone, true },
    { "isfollow", eCondMobile, eCondNone, true },
    { "isaffected", eCondMobile },
...


You could add new things to that list. However you would need to compile it with a compiler that supports MFC.

Microsoft previously released a free version of Visual Studio which supports MFC. See: http://www.gammon.com.au/forum/?id=13695

If that is still available, you may be able to compile with that. I don't know how easy that would be, and you need to do something with the resources. It has been so long ago (14 years!) that I can't really help much more than that, sorry.
Amended on Tue 31 Mar 2020 08:22 PM by Nick Gammon
USA Global Moderator #2
I believe that the latest editions of Visual Studio still support MFC, but support for Windows XP requires a special add-on configuration option (through the installer) that isn't part of the default configuration.
Amended on Tue 31 Mar 2020 10:31 PM by Fiendish
#3
Thanks guys