Jump to content

ExcentriCreation

Member
  • Posts

    533
  • Joined

  • Last visited

Community Answers

  1. ExcentriCreation's post in Spawn a Zombie was marked as the answer   
    Shot answer.... Yes
    getVirtualZombieManager():createRealZombieNow(GridX, GridY, GridZ)While I haven't actually implemented spawning zombies from NecroForge YET, I use it to spawn 360 Zombies in a circle around the player if "the button" is pressed
     
    If you want to experiment with it try:
    X = getPlayer():getX();Y = getPlayer():getY();Z = getPlayer():getZ();ZeD = getVirtualZombieManager():createRealZombieNow(X + 2, Y, Z)Though that will have an error if that square is occupied
     
    EDIT:
    Sorry about my late reply but I've had some filesystem corruption on my operating drive & had to clear ALL of IntelliJ's data & re-install it before I could double check the syntax I used
  2. ExcentriCreation's post in Recipe won't come up in the menu was marked as the answer   
    Ummm.... Do you have an item called bronze ore anywhere?.... Your recipe calls for for an item called bronze ore but you've only made copper ore....
    On a side note.... Your aware that bronze doesn't occur naturally & therefor bronze ore doesn't exist.... Why would you melt "bronze ore" to make copper ingots?
  3. ExcentriCreation's post in Help - Running Custom LUA was marked as the answer   
    I'm assuming you just want to test your .lua files?
     
    Its been a while since I've done that myself but I think they should load if you put them in "....\Steam\SteamApps\common\ProjectZomboid\media\lua" Just make a new folder there so you can remove them again easily.... "....\Users\....\Zomboid\Lua" MIGHT work, but like I said I havent had to do this since before the Modloader
     
    If those dont work, you will have to set up your Mods filesystem.... I explained to someone else how it works here
     
    EDIT
    You should see your .lua file load in the console window if you run PZ in compatibility mode
     
    EDIT 2
    OnPlayerUpdate doesn't carry a key value..... Just use a:
    if isKeyDown(keyvalue) then inside the method 
  4. ExcentriCreation's post in Need help, How to Install mods. was marked as the answer   
    Start here
    Robomat talks about all the tools you need & runs through some basic lua, other than that.... ah..... hard to say, I've been bedroom programming in Basic (the syntax is VERRY similar to lua) since I was 8 & am having trouble remembering how I learned.... analyzing existing code & trial & error. Here is a good reference for lua methods & try to become familiar with the PZ lua/Java methods..... the Javadocs can be found here
     
    EDIT:
    Ok, so I should have checked myself before I started work on it but someone has already fixed the SprayPaint mod at the end of the topic here
  5. ExcentriCreation's post in Icons for perishable and drainable items was marked as the answer   
    That's Crazy, I had no idea about the UseDelta, I thought it had to do with timed actions but I guess it has to be the uses
     
    you could have a "full" icon & an "empty" icon, just add a ReplaceOnDeplete like water sources:
    item FullKettle { IsWaterSource = TRUE, Weight = 0.3, CanStoreWater = TRUE, Type = Drainable, UseWhileEquipped = FALSE, UseDelta = 0.07, DisplayName = A Full Kettle, ReplaceOnDeplete = Kettle, ReplaceOnUseOn = WaterSource-FullKettle, Icon = Kettle, }
  6. ExcentriCreation's post in Move Speed Parameter was marked as the answer   
    getPlayer():setSpeedMod()
     
    though by looking at the Java the value seems to be between 0 & 1 where 1 is "normal" speed.... Have a play with it & look at IsoGameCharacter.class for more info but Im not sure you will be able to do it that way....
    Ive been thinking about vehicles in general lately & Im pretty sure the "best" way to go about it would be to program a whole new movable object in lua rather than screwing around trying to make the character move like a vehicle. Check out ISBuildingObject.lua, the methods involved in creating a world object in lua aren't that tricky.....
  7. ExcentriCreation's post in Custom text's for getText() was marked as the answer   
    From: zombie.core.Translator 
    public static void loadFiles() { moodles = new THashMap(); ui = new THashMap(); survivalGuide = new THashMap(); items = new THashMap(); contextMenu = new THashMap(); farming = new THashMap(); recipe = new THashMap(); igui = new THashMap(); tooltip = new THashMap(); fillMapFromFile("Tooltip", tooltip); fillMapFromFile("IG_UI", igui); fillMapFromFile("Recipes", recipe); fillMapFromFile("Farming", farming); fillMapFromFile("ContextMenu", contextMenu); fillMapFromFile("SurvivalGuide", survivalGuide); fillMapFromFile("UI", ui); fillMapFromFile("Items", items); fillMapFromFile("Moodles", moodles); } private static void fillMapFromFile(String file, THashMap<String, String> map) { InputStream fis = null; try { fis = new FileInputStream("media/lua/Translate/" + getLanguage().toString() + "/" + file + "_" + getLanguage().toString() + ".txt"); parseFile(fis, map); } catch (FileNotFoundException e) { try { if (language != defaultLanguage) { fis = new FileInputStream("media/lua/Translate/" + defaultLanguage.toString() + "/" + file + "_" + defaultLanguage.toString() + ".txt"); parseFile(fis, map); } } catch (Exception localException) { } try { if (fis != null) fis.close(); } catch (IOException e) { e.printStackTrace(); } } finally { try { if (fis != null) fis.close(); } catch (IOException e) { e.printStackTrace(); } } }as you can see, those files in media\lua\Translate are being loaded into Hash Tables using SPECIFIC lines of code in PZ Java. The only way to get your file to load would be to edit the Java. Create a new Hash Table called mymod then call the fillMapFromFile() method & after looking at that method you can see that you would need a "MyMod_" .. LanguageAbbreviation .. ".txt" in each of those directories otherwise running your mod with another default language set would throw a FileNotFoundException.
    I'm sure there's more to it than this but that's all right there at the top of Translator.class
     
    So...... short answer no. There are a few things like this I would like to control from lua (AngelCodeFonts & changing the read directory of getFileReader() are BIG ones as far as I'm concerned) but as of yet there is no way to do so
     
    EDIT:
     
    after re-reading that, it sounded like I was saying "edit the Java"...... DONT EDIT THE JAVA
  8. ExcentriCreation's post in How am I supposed to debug now? was marked as the answer   
    Wait.... open the PZ.bat file & you will get the console working....
×
×
  • Create New...