|
Post by ranjid on Jul 17, 2018 16:23:54 GMT 1
Hello everyone, I am new in the forum and I hope you can help me out. I have reinforcement issuse at the map editor and need a bit help with that. I know there was some threads made in past but no thread helped me to fix my issuse. I really do not understand that reinforcement system. I checked for example that old thread: blitzsrbija.proboards.com/thread/269/reinforcementWhat I want to make is easy. For example you have 5 Infantry Squads on map and if they die you get then 5 new squads and if they die then 5 new and so on . Second what I want to make is that a player get everytime new reinforcements (can be the same or different). For example get every 2 minutes 3 Infantry Squads and every 10 minutes 1 tank or so. I checked that forum and found nothing what could help me here. The thread didnt helped me. I made my own maps and I need a bit help to optimize my maps. I could delete then a good amount of units at my maps for time reinforcements or reinforcements if the units are dead. picload.org/view/dldarppa/20180716211517_1.jpg.htmlpicload.org/view/dldarppl/20180715123037_1.jpg.html
|
|
|
Post by Quintaxel on Jul 17, 2018 20:47:56 GMT 1
What you want do do should not be that difficult. Let me walk you through it Create a map a put 5 units on it. (In the example I'll use units instead of squads but the this does not make any difference) Assign a ScripID to each unit. In the example I use 100, 200,300,400 and 500. Next you'll need to put the units into a Reinforcement Group. In the example I added all units to the reinforcement group 1000. Save the map. Next we will need do do some scripting. This is what needs to be scripted 1) Put Reinforcementgroup 1000 on the map 2) Check the status of the units in Reinforcementgroup 1000 3) If all unit are killed then go to 1 4) If there are still units of reinforcementgroup 1000 on the map then go to 2 Be back later with more.
|
|
|
Post by Quintaxel on Jul 17, 2018 21:47:36 GMT 1
Here you have a the script. DisplayTrace ("Reinforcements Demo");
function Reinf1000()
LandReinforcement (2000);
RunScript ("CheckRein1000Status", 5000);
Suicide();
end;
function CheckRein1000Status()
local ScriptGroupCount = GetNUnitsInScriptGroup(100) + GetNUnitsInScriptGroup(200) + GetNUnitsInScriptGroup(300) + GetNUnitsInScriptGroup(400) + GetNUnitsInScriptGroup(500);
if ScriptGroupCount == 0 then
DisplayTrace ("All units in the Reinforcement group 1000 are killed");
LandReinforcement (1000);
end;
end;
function Init()
RunScript ("Reinf1000", 5000);
end; Note that I assigned a unique ScriptID to each unit belonging to the reinforcement group 1000. You do not have to do this and could opt to give all 5 units the same ScriptID. This would slightly simplify the scripting. The reason I give each unit its own unique ScriptID is to have more flexibility and better control over each unit. You can find the demo map here.Let me know if the script is clear to you. Your second question will have to wait until tomorrow.
|
|
|
Post by ranjid on Jul 18, 2018 10:54:24 GMT 1
Thank you very much for your answer.
I made it on map editor how you told me. Work all fine + I checked your Demo version of it. Looks all good. Now I am not sure how to make that script. Do I need a programm to open any datas or where can I make the script? The thing is I have no clue. I never ever made any script befor.
|
|
|
Post by ariete on Jul 18, 2018 11:24:07 GMT 1
you can open and edit lua files with noteook of windows. check any SH mod map, i compiled the script with a certain .. how say .. order and simplicity
|
|
|
Post by ranjid on Jul 18, 2018 11:37:42 GMT 1
Thanks! I used notepad and can open the datas. But the next problem is there is no lua files.
|
|
|
Post by Quintaxel on Jul 18, 2018 12:12:47 GMT 1
Thank you very much for your answer.
I made it on map editor how you told me. Work all fine + I checked your Demo version of it. Looks all good. Now I am not sure how to make that script. Do I need a programm to open any datas or where can I make the script? The thing is I have no clue. I never ever made any script befor. You are welcome. If I may suggest to use Geany to create or edit Lua files. I have made a portable version (so you do not need to install it) including syntax highlighting for BK functions. You can find it hereJust extract the zip file to a folder and run the exe. When you create a new Lua then you must save it first with the name and extension (example <MyScript.lua> ). Once saved you should see the syntax highlighting. The editor will now recognize al BK functions and show them in a different colour. About the maps you make. Judging from the screenshot they quite look nice. Please tell us more about your work.
|
|
|
Post by ranjid on Jul 18, 2018 12:35:33 GMT 1
Thanks! I will test it and check your data! I have a small group of players with who I play. I create my own maps and we play it then with cool scenarios. Sometimes I change multiplayer maps for different gameplay(no worry I can change back to the original whenever I want ) We are play these in BK1: - Script multiplayer scenarios with singleplayer content - my own maps (at the moment only assault because I have no clue how to make flag capture) - and of course normal multiplayer
|
|
Grot
General
J-23 znowu nadaje
Posts: 4,047
|
Post by Grot on Jul 18, 2018 12:49:42 GMT 1
ranjid why don't you share your cool maps here so others can enjoy your work
|
|
|
Post by ranjid on Jul 18, 2018 12:57:21 GMT 1
ranjid why don't you share your cool maps here so others can enjoy your work
Because its not really finish. If the script is finish then I will share. But at first I want to make the maps so how I want it.
After that I will share my maps with you!
|
|
|
Post by ranjid on Jul 18, 2018 13:01:38 GMT 1
Thank you very much for your answer.
I made it on map editor how you told me. Work all fine + I checked your Demo version of it. Looks all good. Now I am not sure how to make that script. Do I need a programm to open any datas or where can I make the script? The thing is I have no clue. I never ever made any script befor. You are welcome. If I may suggest to use Geany to create or edit Lua files. I have made a portable version (so you do not need to install it) including syntax highlighting for BK functions. You can find it hereJust extract the zip file to a folder and run the exe. When you create a new Lua then you must save it first with the name and extension (example <MyScript.lua> ). Once saved you should see the syntax highlighting. The editor will now recognize al BK functions and show them in a different colour. About the maps you make. Judging from the screenshot they quite look nice. Please tell us more about your work.
So check that one here please:
I am not really sure if that correct or not. I made with your programm now a lua data with that what you send me. I only changed the name because my data have a different name too.
I made now that here. Thats a lua data right now. Was easy and quickly.
But now I tried to connect it with BK map editor. It worked to find the data and select it. But its not running ingame. Did I made anything wrong?
How I told: I am absolutly new in that area with scripts for reinforcements. If the scripts all work on all maps, I will release it here on the forum.
Edit: I used now your Lua data for a map from me and that work very good. My data do not work.
|
|
|
Post by Quintaxel on Jul 18, 2018 15:12:45 GMT 1
You should see the message in the first DisplayTrace function. If not then the script is not linked or it has a bug. To link the map tor the Lua file. Both your map and Lua file must be in the folder <Maps> in the folder <data>. If the folder does not exist the you will have to create it. To link Lua file you need to open the map in the map editor. (see below) The map and Lua can have a different name but is good practice to use teh same name. eg. MyMap.bzm and MyMap.lua
|
|
|
Post by ranjid on Jul 18, 2018 15:53:58 GMT 1
Thanks! Now work my own file too!
Interesting would be to know how can I get more reinforcements in that game? For example I want reinforcements from 3 or 4 different points.
The single reinforcement work now pretty good with my own data.
|
|
|
Post by Quintaxel on Jul 18, 2018 16:11:52 GMT 1
Just create more reinforcement groups. You can call reinforcements with a simple BK function function Reinf()
LandReinforcement (500); -- Name of the reinforcement group Suicide();
end;
function Init() RunScript ("Reinf",600000); --The function Reinf() will run after 600000 miliseconds end;
This is very basic of course. It's better to link a condition to sending in reinforcements. For this you will have to master the very basics of BK Lua scripting. You could check out this thread. Basic BK lua functions are difficult to learn.
|
|
|
Post by ranjid on Jul 18, 2018 17:32:18 GMT 1
Thanks you very much! I send you a private message. Would be cool if you could give there a quick answer I made that now so but it didnt worked. Maybe there was something wrong? My log look now like that: I found that one here in your thread of basic Lua BK script:
I checked out that one too and I see there is timing reinforcements. At the moment I have some maps to make finish with that script.
Are maximum waves possible? For example let spawn a reinforcement only 5 times or so.
If I could make the maps finish with your help then I could release up to that sunday 6 or 7 maps for the community. There would be my own maps, 1 singleplayer map and some changed multiplayer maps from BK1 with different scneario.
|
|