Page 1 of 2

Dune2K Maps

Posted: Tue Mar 19, 2024 8:16 pm
by Markis

Re: Dune2K Maps

Posted: Thu Mar 21, 2024 11:35 am
by Markis
Updated maps for D2K v.20231010 also in no-mod version. Latest 1.1 as Leaders and Assassins custom hard-core mod & no-mod version (X) map.

Re: Dune2K Maps

Posted: Thu Mar 28, 2024 9:48 pm
by Markis

Re: Dune2K Maps

Posted: Mon Sep 02, 2024 3:30 pm
by Markis
Some maps have already newest and probably last version of rules L&A 1.2...personally i play d2K less than before.

Re: Dune2K Maps

Posted: Sat Dec 14, 2024 1:23 pm
by Markis
Request: Would someone advise me how to set game options 1) Limit for the maximum number of harvesters that a player can build. 2) Limit for the maximum number of Carryals as well. - Another SPIKED idea, hey:-) ? -

Re: Dune2K Maps

Posted: Sun Dec 15, 2024 4:01 pm
by Adrian
Limit for the maximum number of harvesters
Several years ago I made (for fun, for myself) a mod. There was a reverse problem (aim).
Limit for the minimum number of harvesters.

In most simple form, the next code.
Every 30 seconds the program checks quantity of harvesters. In Tick function().
And simply it creates new one.
(Of course, it can be with carryalls reinforcement and so on. In more interesting form.)

Code: Select all

  if DateTime.GameTime % DateTime.Seconds(30) == 0 then
    kharv = player.GetActorsByType("harvester")
    if #kharv < 1 then 
      Actor.Create("harvester", true, { Owner = player, Location =  CPos.New(6, 23)})
    end
  end
NB! Important detail.
When harvesters are flying on carryalls — they are not in the world!

So I made the check of quantity twice at least.

Re: Dune2K Maps

Posted: Sun Dec 15, 2024 4:04 pm
by Adrian

Code: Select all

that a player can build.
To check somehow Starport and Heavy Factory...

----------

UPD. I mean Production traits of Heavy Factory in lua.

But! Quite another way. You can use external control of this process.
For example, you can right in mission description for player about rule/law about maximum number of harvesters.
Player can build ANY number of harvester at Factory. BUT some service controls this number periodically. And it destroys existing excess harvesters.

If you need I can add more details about code in Lua.
At least for second decision (the external control periodically).

Re: Dune2K Maps

Posted: Mon Dec 16, 2024 5:06 pm
by Markis
Ok it would be nice...But after another consideration different values should be in lobby map options about strength of economy . Time harvesting & Spice value. These two parameters should be combined in three difficulties. ´´Spice value´´ 1)´´Low´´ = Weakest economy on map. 1xHarvester give 500 & his time of harvesting will be several minutes. 2)´´Normal´´ 1xHarvester give 1000 and his time of harvesting will be slightly faster. 3) ´´Rich´´ 1x Harvester give 1500 and his time of harvesting will be unchanged in original time therms. Just easy money. Plz tell me how make such Lobby map option. It will be better than limits for units.

Re: Dune2K Maps

Posted: Mon Dec 16, 2024 11:41 pm
by Adrian
Briefly.

1-st checking time is 30 sec.
For 1st testing you can write here 15 sec. So you'll be waiting 15 sec from game beginning.

"Media.DisplayMessage"
There are MANY messages in code — just for testing.
You can see what is going on. On the screen during the game.
For real game you can leave only warning from "Harvesters Inspector" :-)

I hope the code is clear. But if you have questions, I can explain.

Code: Select all

  -- my harvester's checking -------------------------------------------------
   
  harv_lim = 3 -- harvester's maximum limit
    
  if DateTime.GameTime % DateTime.Seconds(30) == 0 then
    kharv = Atreides.GetActorsByType("harvester") -- 1-st checking harvester's number
    Media.DisplayMessage(tostring(#kharv), "harvester's number ")
    
    -- 2-nd checking harvester's number, after 10 sek.; taking into account harv-s on carryalls
    if #kharv >= harv_lim then 
      Trigger.AfterDelay(DateTime.Seconds(10), function()
        kharv = Atreides.GetActorsByType("harvester")
        Media.DisplayMessage(tostring(#kharv), "2-nd checking harvester's number ")
        if #kharv >= harv_lim then
          Media.DisplayMessage("too many harvesters!", "Harvesters Inspector ")
          -- It destroys one harvester
          kharv[1].Kill()

        end -- if
      end) -- Trigger
    end -- if
  end

Re: Dune2K Maps

Posted: Mon Dec 16, 2024 11:51 pm
by Adrian
With messages about carryalls

Code: Select all

  harv_lim = 3 -- harvester's maximum limit
  carr_lim = 2 -- carryall's maximum limit
  
  if DateTime.GameTime % DateTime.Seconds(30) == 0 then
    kharv = Atreides.GetActorsByType("harvester") -- 1-st checking harvester's number
    carr = Atreides.GetActorsByType("carryall")  
    Media.DisplayMessage(tostring(#kharv), "harvester's number ")
    Media.DisplayMessage(tostring(#carr), "carryall's number ")
    
    if #kharv >= harv_lim then -- 2-nd checking harvester's number, after 10 sek.; taking into account harv-s on carryalls
      Trigger.AfterDelay(DateTime.Seconds(10), function()
        kharv = Atreides.GetActorsByType("harvester")
        Media.DisplayMessage(tostring(#kharv), "2-nd checking harvester's number ")
        if #kharv >= harv_lim then
          Media.DisplayMessage("too many harvesters!", "Harvesters Inspector ")
          kharv[1].Kill()

        end -- if
      end) -- Trigger
    end -- if
  end

Re: Dune2K Maps

Posted: Tue Dec 17, 2024 12:14 am
by Adrian
But after another consideration different values should be in lobby map options about strength of economy .
I not quite understand. My English is rather poor, sorry.

Do you want to create new buttons or drop-down menu somewhere in game? New graphical object?
Or to change values for harvester inside game code?

Re: Dune2K Maps

Posted: Tue Dec 17, 2024 9:54 am
by Markis
Yeah, that exactly what i want...New drop-down..but i dont know how write script correctly...because im not often & good Dune modder. It should be something like that. I can see my option in map lobby...but im not skillful enough to make it as real function. So down is my practical example what new map option ´´drop-down´´ should be changing before game is start.

ScriptLobbyDropdown@SpiceValue:
ID: SpiceValue
Label: SpiceValue
Description: Set value of spice
Default: Rich
Values:
Low: Low
Normal: Normal
High: Rich
Locked: false
Visible: true
DisplayOrder: 30

^BasePlayer:
AlwaysVisible:
Shroud:
PlayerResources:
ResourceValues:
Spice1: 5 & Harvester Capacity: 100
Spice2: 15 & Harvester Capacity: 50
Spice3: 30 & Harvester Capacity: 30

Re: Dune2K Maps

Posted: Tue Dec 17, 2024 1:58 pm
by Adrian
...because im not often & good Dune modder
Actually me too.
I am not developer (it looks like developers are rare guests in forum now, unfortunately).

I make some modifications of Dune occasionally, from time to time. Just for fun.
As a memory of the impressions of this game many years ago. Without fanaticism :-)

About „drop-down“.
Now I have no idea how to realize something like this.
I have never used new drop-down menus in my mods.

I would link to the existing menu „difficulty“... but it interesting for you to find different way.
I understand, this creative search is one of the most interesing parts of modding.

Re: Dune2K Maps

Posted: Tue Dec 17, 2024 7:52 pm
by Adrian
Maybe it will be useful.
Example of using Lobby Options in lua-file.

From standart file for CNC game (not my mod).

Several conditions.
Slightly shortened by me — with (...). Just general idea.

Code: Select all

if Map.LobbyOption("difficulty") == "easy" then
	DateTime.TimeLimit = DateTime.Minutes(10) + DateTime.Seconds(3)

elseif Map.LobbyOption("difficulty") == "normal" then
	DateTime.TimeLimit = DateTime.Minutes(5) + DateTime.Seconds(3)
	InfantryTypes = { "e1", "e1", "e1", "e2", "e2", "e1" }
	InfantryDelay = DateTime.Seconds(18)
	(...)

elseif Map.LobbyOption("difficulty") == "hard" then
	DateTime.TimeLimit = DateTime.Minutes(3) + DateTime.Seconds(3)
	InfantryTypes = { "e1", "e1", "e1", "e2", "e2", "e1" }
	InfantryDelay = DateTime.Seconds(10)
	(...)

else
	DateTime.TimeLimit = DateTime.Minutes(1) + DateTime.Seconds(3)
	ConstructionVehicleReinforcements = { "jeep" }

	InfantryTypes = { "e1", "e1", "e1", "e2", "e2", "dog", "dog" }
	InfantryDelay = DateTime.Seconds(10)
        (...)
end
Are my examples of lua code clear enough? Understable?
I can comment unclear places. If any...

Re: Dune2K Maps

Posted: Tue Dec 17, 2024 10:13 pm
by Adrian
Do you want to make something like this?

Image