Dune2K Maps

Leaders & Assassins Mod for v.20231010

Information and discussion for custom maps and mods.
Markis
Posts: 78
Joined: Tue Apr 27, 2021 11:54 am
Contact:

Dune2K Maps

Post by Markis »

Last edited by Markis on Thu Feb 27, 2025 1:21 pm, edited 14 times in total.

Markis
Posts: 78
Joined: Tue Apr 27, 2021 11:54 am
Contact:

Re: Dune2K Maps

Post 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.

Markis
Posts: 78
Joined: Tue Apr 27, 2021 11:54 am
Contact:

Re: Dune2K Maps

Post by Markis »


Markis
Posts: 78
Joined: Tue Apr 27, 2021 11:54 am
Contact:

Re: Dune2K Maps

Post by Markis »

Some maps have already newest and probably last version of rules L&A 1.2...personally i play d2K less than before.

Markis
Posts: 78
Joined: Tue Apr 27, 2021 11:54 am
Contact:

Re: Dune2K Maps

Post 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:-) ? -

Adrian
Posts: 135
Joined: Wed Feb 12, 2020 5:44 pm

Re: Dune2K Maps

Post 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.
Last edited by Adrian on Sun Dec 15, 2024 5:19 pm, edited 1 time in total.

Adrian
Posts: 135
Joined: Wed Feb 12, 2020 5:44 pm

Re: Dune2K Maps

Post 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).

Markis
Posts: 78
Joined: Tue Apr 27, 2021 11:54 am
Contact:

Re: Dune2K Maps

Post 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.

Adrian
Posts: 135
Joined: Wed Feb 12, 2020 5:44 pm

Re: Dune2K Maps

Post 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

Adrian
Posts: 135
Joined: Wed Feb 12, 2020 5:44 pm

Re: Dune2K Maps

Post 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

Adrian
Posts: 135
Joined: Wed Feb 12, 2020 5:44 pm

Re: Dune2K Maps

Post 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?

Markis
Posts: 78
Joined: Tue Apr 27, 2021 11:54 am
Contact:

Re: Dune2K Maps

Post 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

Adrian
Posts: 135
Joined: Wed Feb 12, 2020 5:44 pm

Re: Dune2K Maps

Post 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.

Adrian
Posts: 135
Joined: Wed Feb 12, 2020 5:44 pm

Re: Dune2K Maps

Post 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...

Adrian
Posts: 135
Joined: Wed Feb 12, 2020 5:44 pm

Re: Dune2K Maps

Post by Adrian »

Do you want to make something like this?

Image

Post Reply