Skip to content

CLUAConsole:CreateCreature on Mac

Hi,

I'm trying to create a monster in a test game so I can practise taking them out. I can't seem to get the command to work, but I'm not sure of the right Creature Codes to use for BG-EE and BG-EE2 for Mac?

I've tried a number of codes I found on the web, but they don't work, e.g. when I try:

CLUAConsole:CreateCreature("orc01") I get an error:

lua: indexed expression not a table
Active Stack:
Active Stack:

How do I get this command to work and is there a list of Creature Codes? CreateItem seems to work ok using the codes I found.

Thanks a lot of any help.
Dave
«1

Comments

  • JLeeJLee Member Posts: 650
    edited March 2014
    I believe you are using an Icewind Dale code there. There are no orcs in BGEE.

    Edit: that is a valid code for bg2.
    Post edited by JLee on
  • JLeeJLee Member Posts: 650
    If you have eekeeper, you can find all of the creature codes under: View > Creature Browser
  • Troodon80Troodon80 Member, Developer Posts: 4,110
    @LookToWindward, can you try copying and pasting that command into the console? I mean as you have it typed there? It works fine for me.

    As for a list of codes, you can probably use something like Near Infinity to find the codes for any creatures you want to spawn. There are a few lists out there, some are better than others. I can get you a complete list for both games, though, but will take a couple hours.
  • JLeeJLee Member Posts: 650
    Derp, missed the whole "Mac" part. My apologies...
  • LookToWindwardLookToWindward Member Posts: 179
    Yes, I think the codes or the command format must be different on Mac. Not sure why this would be but I can't get any code I've found online to work! It would be useful if during game play you could get it to log the internal name/code as well as the external name.
  • LookToWindwardLookToWindward Member Posts: 179
    I tried a couple of the code for BG and they don't work either!

    e.g. CLUConsole:CreateCreature("belt")
    or
    CLUConsole:CreateCreature("gnoll_a") just give the same error message:

    lua: indexed expression not a table
    Active Stack:
    Active Stack:
  • JLeeJLee Member Posts: 650
    Hmmm...I'm obviously not helping, sorry! Interesting that there are different codes for Mac.
  • LookToWindwardLookToWindward Member Posts: 179
    Hi,

    Found it! It was my mistake! You can't paste into the Console, I had typed CLUConsole: instead of CLUAConsole:

    Also the original codes I tried were not valid, so I think I tried the command spelled correctly but with the wrong codes, then tried it with the command spelled incorrectly but with the right codes!

    Thanks for your help!








  • Troodon80Troodon80 Member, Developer Posts: 4,110
    @LookToWindward, strange that you cannot paste, but glad it's sorted out for you.
    JLee said:
    @JLee, that's the first one I came across when doing a search for BG2. Doesn't say what the names are, so I've attached a saved list with resource name and creature name. There are also a few new BG2:EE specific codes that were not in the original game.
  • LookToWindwardLookToWindward Member Posts: 179
    Thanks a lot for this!! I will make it into an SQLite file, it will make it easier to update and find find monsters via their name, description, etc. I'm wondering how easy it would be to find our their stats, I could include these as fields in the database. So could could do things like get a list of all the Orcs with > 50 HP or whatever! Any ideas what fields I should include? To start with it would have:

    CreatureCode Name Description


    Game which game it appears in.
    Location Map Location in game
    HP Hit points (if it's possible to get this).



    As an aside:

    Try creating the character Hack - it's great fun to create Hack, leave it about 30 secs then create another Hack and stand them next to each other. The first Hack will go hostile but the second Hack is still friendly so they have a fight!

    Love it!

    Oh well, back to Durlag's for me now after a much needed rest from it!

    Thanks again!






  • CrevsDaakCrevsDaak Member Posts: 7,155
    You have to paste with CRTL+V, plus, you should be using C:CreateCreature instead of CLUAConsole:CreateCreature.
  • elminsterelminster Member, Developer Posts: 16,317
    edited March 2014
    Yea like CrevsDaak is saying the enhanced edition makes it so you don't have to write out CLUAConsole. Just C will do.

    So

    C:CreateCreature("Imoen1")

    or something to that effect.
  • Troodon80Troodon80 Member, Developer Posts: 4,110
    @LookToWindward,

    Thanks a lot for this!! I will make it into an SQLite file, it will make it easier to update and find find monsters via their name, description, etc. I'm wondering how easy it would be to find our their stats, I could include these as fields in the database. So could could do things like get a list of all the Orcs with > 50 HP or whatever! Any ideas what fields I should include?

    What fields to include would be entirely up to you. I am contemplating adding more features to EE Keeper and, if included, would allow the exporting of such information as XP for kill, base HP, current HP, stats and attributes, resistances, and thieving skills, etc., though probably not effects. If you are interested in such a thing in order to create a database like that (it would be fantastic if this database could be online for others to access), then I will send you the exported file as a text document when I can.
  • LookToWindwardLookToWindward Member Posts: 179
    Yes, that would be great! What format would you export it in? If you defined it in a way that included a published set of keys for each field, I could import it directly into an SQLite Database. It would be good to have it online. I'm a Mac/iOS developer so can write the client side stuff but I don't know much about the Server Side.




  • Troodon80Troodon80 Member, Developer Posts: 4,110
    edited March 2014
    @LookToWindward, exporting will be in plain text format, with tabs separating the columns, but can also be exported as comma delimited (or any other character since a comma can be tricky), or as one of multiple spreadsheet formats (for example, on Google Drive). If you select a format, I can probably accommodate it. If you can also design a language selection, I can accomodate the translated versions to a certain extent; for example, the Polish or Korean lists for BG:EE.
  • LookToWindwardLookToWindward Member Posts: 179
    Comma delimited would be great, with the first row being the field or column names, e.g.

    CreatureCode,Name,Description,GameCode,etc
    orc1,Orc,Some text about Orcs,BG-EE|BG2-EE|BG,BG2,etc.

    We'd have to agree on the field names, or if they are already defined somewhere we could just use those.

    Just a suggestion/example of what I meant, an Orc for instance can appear in more than one game, but if they have the same code, we'd only need one entry in the Database for.

    I'll then read the first line and create a table containing the fields specified and populate with each row in the file.



  • Troodon80Troodon80 Member, Developer Posts: 4,110
    @LookToWindward, I think it would be better to include duplicates, just for the sake of completeness. I don't think there are very many, but those that do tend to duplicate also tend to have different stats. For example, 'XZAR' from BG:EE has differing stats to those in BG2:EE, here is a side-by-sideview of the basics, noting of course that Xzar in BG:EE is a recruitable NPC while 'XZAR' in BG2:EE is unused in favour of 'LYROS':

    BG:EE BG2:EE
    Strength 14 10
    Strength+ 0 0
    Dexterity 16 16
    Constitution 10 10
    Inteligence 17 17
    Wisdom 16 14
    Charisma 10 14
    Gender Male Male
    Race Human Human
    Alignment Chaotic Evil Chaotic Evil
    Class Mage Mage
    Kit Necromancer Necromancer

    We'll work those details out in the future. I'll work on getting the lists when I'm not busy filtering through bug reports. :-)
  • Troodon80Troodon80 Member, Developer Posts: 4,110
    @LookToWindward, attached is a compressed archive containing a CSV document with as many stats as I can include (for now). If you can let me know what columns you want, that would be great. :-)

    Some columns will be altered to include actual text instead of a decimal/hexadecimal number, but this is the basics.
  • LookToWindwardLookToWindward Member Posts: 179
    edited March 2014
    That's brilliant! I will work on this tomorrow. One question, the hex values, should I convert them to decimal before adding to the database? I'm wondering the significance, if they are bit fields, they it's probably best to leave them as hex values? I'll just get it working so that it adds everything as a string for now.
  • Troodon80Troodon80 Member, Developer Posts: 4,110
    @LookToWindward, I'll be updating them to actual string values, probably tomorrow. That file is only a sample. :-)

    If those columns are all okay, then I shan't add or remove any more in that regard.
  • LookToWindwardLookToWindward Member Posts: 179
    I'm working with it now, lets have a look once I get it going, about another 30 mins! One thing, the field names shouldn't have Spaces in them, for instance - "Attacks Per Round", I think that's the only one, which I've corrected in my version of the file. If you could change it in your app that would be great. One other thing, I'm prefixing the field names with "k" for key, it's easier for me to do that since the tool I am using assumes database keys start with "k" and I'd have to write loads more code if I don't do this!
  • Troodon80Troodon80 Member, Developer Posts: 4,110
    edited March 2014
    @LookToWindward, sounds good. I won't be changing the way Keeper saves the lists for the next actual release, but I will alter it for now so as to give you a decent list.

    I have amended the Attacks Per Round to AttacksPerRound, and I will have the list ready tomorrow. To note, the list will have the string representations instead of an integers for things like race, gender, etc.

    As an example, list items will look something like this:

    BG2:EE,Valygar,"VALYG14",12,1,1,17,0,18,16,10,14,10,1,10,9,2500000,0,94,94,0,0,10,5,60,7,9,8,8,10,0,0,0,0,0,0,0,0,0,0,0,0,94,0,0,94,0,0,0,Human,Male,Neutral Good,Ranger,Stalker,Golem,Neutral,State Normal,Fighter Male Human

    I assume spaces are usable in this context? Perhaps surrounding them with quotes would be better?

    Also, note the 'BG2:EE'; this is a new column to denote which game is being referenced since the list will contain all creatures from both games. If you would rather create two separate lists (thus cutting down on the overall size of the databases as individual elements should you decide to make them available online), then I can remove that. :-)
  • LookToWindwardLookToWindward Member Posts: 179
    Take a look at the file attached, it's the first pass SQLite File generated by my App using your data!

    You should be able to open it with any tool that works with SQLite. I'm on a Mac and use MesaSQL, but I'm sure you will find a Windows tool that will open it!
  • LookToWindwardLookToWindward Member Posts: 179
    Spaces are ok for the data part, just not in key names as it buggers up the SQL Syntax Generator! I strip all double quote (") character before writing to the database, so it doesn't really matter to me, but for others it might, so probably better to denote it as a text field with by adding them.

    Did you know there are 1,125 monsters with a BaseHP of >= 70!


  • LookToWindwardLookToWindward Member Posts: 179
    I could now add a feature that would let you export a character file for import into BG or BG-EE from an entry in the database!!
  • LookToWindwardLookToWindward Member Posts: 179
    One more question - should the Resource Field be unique? e.g. there can only be one record for "MEPHSP1" ?
  • Troodon80Troodon80 Member, Developer Posts: 4,110
    @LookToWindward,

    I could now add a feature that would let you export a character file for import into BG or BG-EE from an entry in the database!!

    I would be somewhat cautious about that, things like proficiencies (and other effects) are not included and would probably require quite a bit of work on your part even if I could include them on the list. It is an interesting idea you have there, however. With PHP, you could most likely create an online character/creature creator. But a list like this would only serve as a foundation.

    One more question - should the Resource Field be unique? e.g. there can only be one record for "MEPHSP1" ?

    Like I said above—that would be entirely up to you, but I think it would be better to include all creatures.
  • LookToWindwardLookToWindward Member Posts: 179
    But if there are two characters with the same Resource code, how will you know which is which? The "Resource" name is the name of a file as far as I know, can there be more than one copy of the file "MEPHSP1" containing different data?

  • LookToWindwardLookToWindward Member Posts: 179
    At the moment, all the fields are text fields, which means the ordering is incorrect for numeric values. I could hardwire the types or you could specify them in the export file maybe?

    We could add a line after the first line, with a list of the types,

    e.g.

    Line 1 - Name,Resource,BaseHP,...,...,...
    Line 2 - string, string,integer,,...,...,...
    Line 3 - NameData,ResourceData,BaseHPData,...,...,...

    Alternatively the type could be appended to the field name,

    Name:string,Resource:string,BaseHP:integer,...,...,...

    What do you think?
Sign In or Register to comment.