Jump to content


Community Members
  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by SirPope

  1. Is it possible to edit the terrain with a building? You could then make the building's 'docks' basically. The AI might be able to manage that I think.
  2. @mimo You're a bit late on that. I already patched it into petra a22 and got it working, corrals/farmstead combos, the several barracks & blacksmiths built (except for the stupid tech in the beginning). I copied petra into the Hyrule folder before I edited it. The only thing I'm missing is to 'auto-select' an option for the AI... and a way to figure out which barracks is better... I'm just randomly choosing the one it can afford and has the least of atm. I've gave up on that irritation and switched back to delenda_est. I've already patched that one. As for the svn, if you look at worker.js, the update function has a massive if, else if, else statement near the bottom of it. You could put some returns; to exit out of the statements a bit quicker. It's not much but that code is pretty much used for everything and constantly. Near the end of the update, when an if statement is reached, the function has ended or is going to end and do nothing during that time. So it's pretty much wasted time to not exit after or during these if statements. There are a few places that could use a tiny microboost similar to that as well. basemanager's checkResourceLevels could use some continues to shoot it along.
  3. Meant for the AI. An Init for petra. Add to the 'Config.advanced' building variable without needing to actually edit petra for example. Or adjust the queue priority levels after they've been set. Such as not having any farms and only corrals. Make the corrals more important. Or in this case randomly unlock a tech for the AI at the beginning. Additions to the advanced building variable would be the most used. How do you set it to nomad? I want to barricade myself in a corner. I'm a turtle.
  4. That is my point. You have to edit a file just to start on phase_city or with no phase at all. Then you are pretty much stuck with it. If you can add a 'nomad' option to the settings box that would be nice. Might break a lot of maps though. :/ As well as a 'just for mods' init and postInit function. Zoras! I can't wait for the next update. Is that a winged whale? That is awesome.
  5. What I'm wondering is why does it change the civ name for the AI? I think it is unlocking it... it's just not researching it. Might have to create a separate tech and function. Just for AI's sake and then call that in petra depending on the AI's name? I don't know. I'm done trying to figure this out for the moment. If anyone knows how to get the gerudo to train animals let me know. Is it a template error on the pig side?? I got it to search for the actually template of the corral. I had to add the class Corral to the pigfarm and then search for the important classes. I also got hyrule to build farms. you might be able to force them to just by changing the hyrule_farmstead.xml to hyrule_field.xml might break something though. I got them to build them, corrals, civcenters, 'specialbuildings'... Not posting the whole code there was quiet a few annoyances along the way. for(let t in gameState.templates) { //gameState.templates holds every template avaliable to all civs (including gaia) if( t.indexOf("structures/"+gameState.getPlayerCiv()) == -1 ) //we just want ours continue; let template = gameState.getTemplate(t); if( template ) { if( template.hasClass("Field") ) this.buildings.field.push(t); if( template.hasClass("Corral") ) //I did do a warning check and pig farm was added. this.buildings.corral.push(t); //... everything other important class I expanded this.buildings list in config.js: "field": new Array(), "corral": new Array(), //all others - FYI all advanced building have the class SpecialBuildings... //Why would you type them out or keep using applyCiv if you already know which is what? It's all stored for you. Then everywhere in several files i do the below: ... I find anything labeled with {civ} and change it let templateList = undefined; let temp_storehouse = "structures/{civ}_field"; templateList = gameState.ai.Config.getBuildingsOfType("Field"); //basically just returns template.buildings[field] //I toLowerCase it the value passed. if( templateList ) temp_field = templateList[0]; //default to first - needs a smarter way - sort them all by costSum()? let template = gameState.getTemplate(gameState.applyCiv(temp_field)); Of course this is clunky and needs a better way to get the file. A simple function...
  6. Yeah I don't think they do either. I don't think the AI isn't actually set up or initialized until session.js is finished. I tried to get access to the AI but the player object hasn't even been assigned yet. I could turn it into a function and just call ResearchTech when petra starts. However, I'm not sure why player.js has an AddStartingTechnology function if you can't even access it before the game begins. I can't figure out how to get to the data at all. Moving it to shared.js might work. I'd have access to the AI there and the actual player I think it's also 'shared' between players as well so network play should work. I just don't know if it's only for sharing AI data. Will it run with 2 actual people and no AI? @darkinterlooper When you attacked? From what I can tell it's a combination of getBestBase and an improper template with 'getAttackBonus'. My edit doesn't do anything to the Attack or defence manager. Yeah, I think it will unlock it for the player now that you mention it. I was just testing it with gerudo vs hyrule... never thought of that. I'm glad someone tested it though. The function needs to get out of session.js anyways. That is ran when you join a game. If someone (like an observer) joins the game the dialog menu will pop up again for everyone. It's an easy way to troll. Some of the template's obstruction radius is off a bit. I noticed that with the main CivCenter for hyrule. My guess is it tried to set a building checked the obstruction radius said 'it will fit', marked it as done, and then the foundation collision checker popped in. That's the best explanation I can give. Can't get units info from a building that can't be built. It's kinda neat to see a tree growing from a barracks. The Capture attack part of some templates might also be messed up.
  7. Observer fix and AI auto select for civ_choices.js function initCivChoicesDialog() { for(let player in g_Players) { //unlock teck for AI if( g_GameAttributes.settings.PlayerData[ player ] ) //Observers have no player data if( g_GameAttributes.settings.PlayerData[ player ].AI != "" ) { let aiPlayer = g_Players[player]; let civChoices = g_CivData[aiPlayer.civ].CivChoices; if( civChoices ) { let randomi = Math.floor( Math.random()* (g_CivData[aiPlayer.civ].CivChoices.length)); Engine.PostNetworkCommand({ "type": "civ-choice", "template": g_CivData[aiPlayer.civ].CivChoices[randomi] }); //warn(player +" AI choose: "+g_CivData[aiPlayer.civ].CivChoices[randomi]); //Unsure how to make petra unlock it though Engine.GetGUIObjectByName("civChoicesDialogPanel").hidden = true; } } } if( Engine.GetPlayerID() == -1) { //observers have no playerData return; } let currentPlayer = g_Players[Engine.GetPlayerID()]; //choice menu for players let civChoices = g_CivData[currentPlayer.civ].CivChoices; if (civChoices) { for (let i = 0; i < civChoices.length; ++i) { if( civChoices[i] == undefined) continue; let civChoiceButton = Engine.GetGUIObjectByName("civChoice[" + i + "]"); civChoiceButton.caption = GetTechnologyData(civChoices[i]).name.generic; let size = civChoiceButton.size; size.top = 20 * i; size.bottom = 20 * (i + 1); civChoiceButton.size = size; civChoiceButton.onPress = (function(tech) { return function() { //warn("playerSelected:"+tech ); Engine.PostNetworkCommand({ "type": "civ-choice", "template": tech }); Engine.GetGUIObjectByName("civChoicesDialogPanel").hidden = true; }})(civChoices[i]); civChoiceButton.hidden = false; } Engine.GetGUIObjectByName("civChoicesDialogPanel").hidden = false; } } Until petra is patched, which mimo seems to know everything needed to be done, the AI doesn't quite work well. Note: gerudo's won't train any sheep for some reason and I can't figure out why. It might be something wrong with the pig template. I don't know missing Unit tag? I did edit petra to get hyrule to build farms and start building civcentres early. I'm impatient for a mod friendly AI. I don't know if mimo's edits will work with A22 as it is or not. I don't quite know how to download a folder from the tracbrowser anyway. He's seemed to have removed the mod breaking aspect of petra: which was using direct template names and not gathering them off the <Classes> tag (NOTE: VisibleClasses are completely different). You may want to revisit some files and make sure they have the proper tags. I had to add "Field" to the hyrule's farmstead/field combo for my petra edits to work properly. Anyway: Hyrule Conquest Opinions - probably already addressed these in this forum somewhere. Training times are 30 seconds. One minute for 2 soldiers... I don't like that really. You may have to edit petra's researchManager quiet a bit to get some of the techs to work for the AI. I'll look over them but I want to see if mimo's AI does this already. The building models are quite huge the AI (and people) will have trouble expanding with the small amount of territory influence they add ( and the 'must build in own territory' limitation). You can edit the limitation by adding neutral to the build restrictions territory tag. You may have to set the territory influence to 0. I'm not sure if petra really cares about the neutral tag though. I have yet to properly look over A23's future version to see if that's changed. They didn't seem to notice it or take advantage of it in delenda though. UPDATE: ... -.- It doesn't seem to unlock the tech for the AI. It will pick one. I'm not sure how to force the tech to be unlocked.
  • Create New...