Jump to content

man_s_our

Community Members
  • Posts

    20
  • Joined

  • Last visited

Posts posted by man_s_our

  1. 10 hours ago, Freagarach said:

    Very cool! It seems you are coming close to something we may be able include in the main game (feature wise), could you upload a patch on our Phabricator, please? (https://trac.wildfiregames.com/wiki/SubmittingPatches) It will allow us to give direct comments on your code and speed up the inclusion. :) (I see quite some hardcoding in some functions, but it might be unavoidable.)

    I already planned to do it when I complete the TODO list. the same with the hunger script when finishing the last bug.

  2. @Freagarach

    changelog:

    riders' orientation is now the same with the horse most the time when the horse is walking (turretable.js)

    the horse will automatically go to the targeted unit so that the rider attack it instead of having to make 2 seperate orders.

    the cavalry units are automatically using hit-run tactics (can be disabled by replacing "range.max / 2" in the line 5087 by range.min)

    TODO:

    fix the bugs related to gathering (when gather order issued you can't stop it)

    UnitAI.js Turretable.js

  3. 11 hours ago, Freagarach said:

    Glad you got it working. :) I've bitten my teeth on this turret-order problem before, so I'm very interested in any results, so please do keep us (me) updated. :)

    till now the problems I got is:

    when order the unit to gather while it's riding a horse (propably will be solved after editing more UnitAI functions)

    if I order a melee unit to ride a horse and send it to fight it doesn't attack the enemies.

    I don't know which function that will return the current movement speed (instead of max speed) to use it for archer's spread. (solved)

  4. I fond the problem was in the need to turn the args into dictionary first.

    this code solves the problem:

    UnitAI.prototype.Walk = function(x, z, queued, pushFront)
    {
    	let mov = 1;
    	let cmpTurretable = Engine.QueryInterface(this.entity, IID_Turretable);
    	if (cmpTurretable)
    	{
    		mov = 0;
    		let tur = cmpTurretable.HolderID();
    		if (tur)
    		{
    			let cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer);
    			if (cmpTimer)
    			{
    				var data = { "x": x, "z": z, "queued": queued, "pushFront": pushFront };
    				cmpTimer.SetTimeout(tur, IID_UnitAI, "Walkt", 100, data);
    			}
    		}
    		else
    			mov = 1;
    	}
    	if (mov)
    	{
    		if (!pushFront && this.expectedRoute && queued)
    			this.expectedRoute.push({ "x": x, "z": z });
    		else
    			this.AddOrder("Walk", { "x": x, "z": z, "force": true }, queued, pushFront);
    	}
    };
    UnitAI.prototype.Walkt = function(data, lateness)
    {
    	let x = data.x;
    	let z = data.z;
    	let queued = data.queued;
    	let pushFront = data.pushFront;
    	if (!pushFront && this.expectedRoute && queued)
    		this.expectedRoute.push({ "x": x, "z": z });
    	else
    		this.AddOrder("Walk", { "x": x, "z": z, "force": true }, queued, pushFront);
    };

     

  5. I was trying to implement the feature of seperate entities for horse riders but I got a problem and didn't knew what the thing that keeps changing coordinates.

    the logs gave me:

    the horse 7079 got the order from 7085, x = 608.2567138671875 z = 852.1669311523438
    
    7079 ordered to Walk to x = 841.0175601990993, z = 100

    the function is:

    UnitAI.prototype.Walk = function(x, z, queued, pushFront)
    {
    	let mov = 1;
    	log(this.entity + " ordered to  Walk to x = " + x + ", z = " + z);
    	let cmpTurretable = Engine.QueryInterface(this.entity, IID_Turretable);
    	if (cmpTurretable)
    	{
    		mov = 0;
    		log(this.entity + " Turretable");
    		let tur = cmpTurretable.HolderID();
    		log(tur + " is Turret");
    		if (tur)
    		{
    			let cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer);
    			if (cmpTimer)
    			{
    				log("the horse " + tur + " got the order from " + this.entity + ", x = " + x + " z = " + z);
    				cmpTimer.SetTimeout(tur, IID_UnitAI, "Walk", 100, x, z, queued, pushFront);
    			}
    		}
    		else
    			mov = 1;
    	}
    	if (mov)
    	{
    		if (!pushFront && this.expectedRoute && queued)
    			this.expectedRoute.push({ "x": x, "z": z });
    		else
    			this.AddOrder("Walk", { "x": x, "z": z, "force": true }, queued, pushFront);
    	}
    };

    any ideas?

  6. so, I added some features in my mod (WIP) that included units being hungry/thirsty and supplying units. the hungry units needs gathering food or otherwise they start losing their health. the same (but higher rate) goes for thirsty units.

    this requires that units automatically go gather their needed supplies but I wonder whether there is predefined functions for this or I need to define a new function that looks for the near supply units and start gathering it.

  7. 12 hours ago, Freagarach said:

    Cooperative play is not yet possible, but planned (https://trac.wildfiregames.com/ticket/2459). One can work around that by enabling cheats and changing perspective.

      Hide contents
    1. Start a match with one player observer and cheats enabled.
    2. Let the observer use <alt>+<d> to open the development panel.
    3. Click "Change perspective".
    4. Select the player to control at the top right of the screen.
    5. Enjoy cooperative play, but remember: "With great power comes great responsibility.".

     

    good to know this feature is already planned

  8. 11 minutes ago, borg- said:

    You can have a 5v5 or 6v6 game but you will have to reduce the max population to 150 for example, which might make the experience not so fun since you need a good amount of units to collect resource and another to fight.

    the idea is not about having many players. but about being able to divide leadership between multiple commanders instead of having only one leader for the entire army.

  9. 4 hours ago, nani said:

    https://code.wildfiregames.com/D2667

    With this you can try up to 30 players (or AI). You will need to rebase any changes and compile it, and only works from command line but works.

    Also had alternative implementation that allowed arbitrary sizes (> 100) but is not published.

    they play as different sides, right?

    what I meant is being able to play as commanders in  one nation (not just allies) and share the resources and such things.

    but I think it can be edited through JS (by editing deplomacy and gui and such)

  10. programmatically, is it enough to edit the javascript files or it needs to rewrite the engine to implement:

    civs limit per map stays the same.

    but players number can be increased, where many players can play as one civilization against other players/AIs to do multitasking like one gather resources and one explore and one build or they co-op to do things like flanking enemies or other tactics.

    • Like 2
  11. in my computer I added a mod where:

    there is water resource, you get it from wells or water treasures. and food is splitted into meat food and vegan food

    wells have unlimited water.

    you can order your workers to plant a tree (consumes water and some wood).

    you can plant a field using some vegies and water but it has limited vegan resources.

    from coral you can spend water and vegies to get meat.

    this way you can afford realistic resource regeneration except for stone and metal.

    it has a problem with AI tho, because it rely on harvesting the fruit bushes.

     

    • Like 1
  12. if you ask for my opinion, I think that resources system should be changed to:

    there is no resources shown (or showing the sum) in the upper bar, every resource is stored where it was putted.

    when you order the workers to build they get the materials from the storehouses or harvest it by themselves.

    you can transfer the resources from a storehouse to anywhere else. this is how you trade, support allies, supply your units.

    barracks need to have the resources near it to recruit units.

    • Like 1
    • Haha 1
×
×
  • Create New...