|
Post by Quintaxel on Jul 18, 2018 21:20:28 GMT 1
Yes, it is possible to limit the number of reinforcement waves. I'll try to write a demo for that, maybe tomorrow. I could help you with the scripting but you would have to be patient because I'm a bit busy. If you could make the single player map and then tell me exactly what you want to do then this would making the scripting easier for me. Let's maybe start with a single map and see where that leads us.
|
|
|
Post by ranjid on Jul 19, 2018 8:19:58 GMT 1
Yes, it is possible to limit the number of reinforcement waves. I'll try to write a demo for that, maybe tomorrow. I could help you with the scripting but you would have to be patient because I'm a bit busy. If you could make the single player map and then tell me exactly what you want to do then this would making the scripting easier for me. Let's maybe start with a single map and see where that leads us.
I make that more easier. I send you the singleplayer map to you. Its not finished yet, but far enough to insert the reinforcements. You got a download link on private message.
|
|
|
Post by ranjid on Jul 22, 2018 10:59:01 GMT 1
I checked out some of the guides and at the moment I can make only the unlimited reinforcement for 1 reinforcement group with unlimited numbers of units. The rest I checked now for over 4 hours and have still many issuse to bring a second "command" in the Lua file incl different "commands". How are working multiple "commands" in a Lua file? How I said I checked that out for over 4 hours.
|
|
|
Post by ranjid on Jul 26, 2018 21:58:00 GMT 1
Quintaxel Now I need to check how work the maximum wave code. For example I want an attack on a special position but only with a limited of waves. For example we have now 2 positions. Position 1 and Position 2. Position 1 get attacks by 5 waves limited. The first spawn/appear would be after 2 minutes (what I already know how work that) and the next 4 of them every 3 minutes for example. Position 2 get attacks by 5 waves too. That time only if every soldier die at this wave. If everything is defeat then will be next respawn. I know you send me already a demo version of that but I have some issuse with that. Would be interested to see the code of the first and the second one. (maybe as demo for both?)
|
|
|
Post by Quintaxel on Jul 27, 2018 10:01:05 GMT 1
Just limit the number of times that the function Reinf () runs. You do this in the RunScript function
RunScript("SupportPlayer1Nr1",2*60000,5);
Also leave out the Suicide () function
function Reinf() LandReinforcement (100); end;
function Init() RunScript("SupportPlayer1Nr1",2*60000,5); end;
|
|
|
Post by ranjid on Jul 27, 2018 10:16:05 GMT 1
Ok thanks! I will try out that now and will let you know that work or not!
|
|
|
Post by ranjid on Jul 27, 2018 11:01:06 GMT 1
Thanks! It work very well! I will edit today it in the multiplayer.
How would look then unlimited? For the Singleplayer mission would be that a bi more complex but I guess step by step is better.
|
|
|
Post by Quintaxel on Jul 27, 2018 11:57:30 GMT 1
To have unlimited reinforcements you just have to leave out the Suicide() function in the function for getting reinforcements.
function Reinf()
LandReinforcement (100); --Suicide (); -- No Suicide () function, otherwise the function will run only once!! end;
function Init()
RunScript("SupportPlayer1Nr1",2*60000); --function will run every minute end;
For Single player games this should also work, however it's not good practice to run all functions from the function Init(). For simple scripts this should not be an issue.
|
|
|
Post by ranjid on Jul 27, 2018 12:03:41 GMT 1
To have unlimited reinforcements you just have to leave out the Suicide() function in the function for getting reinforcements. function Reinf()
LandReinforcement (100); --Suicide (); -- No Suicide () function, otherwise the function will run only once!! end;
function Init()
RunScript("SupportPlayer1Nr1",2*60000); --function will run every minute end;
For Single player games this should also work, however it's not good practice to run all functions from the function Init(). For simple scripts this should not be an issue. Thanks! I need to change it obly to "no suicide"? Thats all? I think I understand now a bit more lua. First time was really hard to understand. Now its much better.
|
|
|
Post by Quintaxel on Jul 27, 2018 12:39:27 GMT 1
Yes, just leave out the Suicide(). The Suicide() function stops the function it is called in.
|
|
|
Post by ranjid on Jul 27, 2018 14:17:53 GMT 1
EDIT: I fixed it!
So: I have now 3 kind of reinforcements.
1. that reinforcement come only 5 times every 1 minute
2. unlimited reinforcement what come every 2 minutes
3. limited reinforcement what come only once
That code do not work. I changed it back to the standart what I did at the others but still do not work. Did I made anything wrong there or looks ok?
|
|
|
Post by Quintaxel on Jul 27, 2018 14:51:33 GMT 1
No Suicide(); is not a valid syntax. Just remove the line. When you see -- in front of a line of script then this is interpreted as a comment, it will be ignored in the script. examples: Suicide (); --this line will be processed in Lua -- Suicide () This line will be ignored, it is read as a comment. DisplayTrace ("Hello there %g", f); -- f = %g is used to display a variable in the string shown by the DisplayTrace function. -- is often used to comment the script. Very interesting if you want other people to understand the script or for later reference.
|
|
|
Post by ranjid on Jul 28, 2018 10:18:40 GMT 1
For example I want not a units what appear after 2 minutes with the code
But I want the next appear/spawn after 1 minutes. How would work that?
|
|
|
Post by Quintaxel on Jul 28, 2018 13:02:20 GMT 1
You can make all possible combinations with the script below but you need to understand how it works.
RunScript("SupportPlayer0Nr1",1*60000,5);
This will run the function "SupportPlayer0Nr1" with intervals of 1 x 60000 milliseconds or each minute. This will be done 5 times and then stop.
The 60000 milliseconds is the equivalent of 60 seconds or 1 minute. So just multiply this number with the time you want between each respawn. If you want 1 minute then you multiply by one. RunScript("SupportPlayer0Nr1",1*60000);
No if you want to run a function at minute 1 and minute 3, then once more at 8 minutes the script would be like this;
function Init()
RunScript("SupportPlayer0Nr1",1*60000,1);
RunScript("SupportPlayer0Nr1",3*60000,1); RunScript("SupportPlayer0Nr1",8*60000,1);
end
I hope I understood your question correctly.
|
|
|
Post by ranjid on Jul 28, 2018 13:33:06 GMT 1
Thanks! Thats answered my question! I will check out that later. Check out please the other thread. Let me klow there if that to complex or not.
|
|