|
Post by keepitsimple on Dec 12, 2011 19:49:30 GMT 1
Unit calls are great . You don't need no script to get AI units to act. So far my tips ;D Now the problems There seems to be a limit to the number of unit calls you can give at any given time . To many unit calls leads to memory problems/crashes of the game. Does anyone know how many unit calls you can use and any given time? Given the problem of to many unit calls, the solution seems simple. Delete a number of the unit calls by removing them with several units. I did this, save the map. Reloading the map and found that all unit calls that I though I had removed where back . Question how come? The one way to solve this problem I can think off is: Remove the unit with unit call and replacing it by a new copy of the unit. Is there a simpler (less work involved) solution?
|
|
bb
General
Blitzkrieg junkie (tried to quit several times).
Posts: 1,362
|
Post by bb on Dec 13, 2011 4:21:11 GMT 1
Hi keep, unit calls is the start commands? If yes, there is a very easy way to give commands in the script which is lot better... I can tell you about if you want. R. BB
|
|
|
Post by LouisXIV on Dec 13, 2011 13:10:48 GMT 1
There seems to be a limit to the number of unit calls you can give at any given time . Too many unit calls leads to memory problems/crashes of the game. Does anyone know how many unit calls you can use at any given time? If you are talking about Start Commands, I have never encountered any limit on them. I can't say as how I've used hundreds at a time, but I have used somewhere approaching a hundred without problems. Given the problem of too many unit calls, the solution seems simple. Delete a number of the unit calls by removing them with several units. I did this, save the map. Reloading the map and found that all unit calls that I though I had removed where back . Question how come? That sounds familiar. Do you have the Windows Vista or Windows 7 Operating System? If so, it does that often. If you make frequent changes to a file, the O/S decides that you are a virus trying to harm the files.
I have an older computer with Windows XP basically dedicated to developing BK missions because of that problem, although developing your missions on a Windows 7 computer on an external H/D or USB memory stick seems to take care of the problem ... sometimes.
|
|
|
Post by keepitsimple on Dec 13, 2011 18:09:21 GMT 1
Read: Start commands where stated: unit call ;D Thanks Vista for protecting me from harm With regard to the number of start commands: around 80 (double this number if you need to included later to appear reinforcements).
|
|
|
Post by finlander on Dec 13, 2011 18:30:53 GMT 1
Ok, if this is my balaton map we are talking about..i am very curious. I use XP, and first when i tested this map it crashed on me at the very beginning.. Now, i have had these memory errors almost every time i test a map.. usually it comes only once..but in this case it appeared every time at the same place..could it be the start commands or something else with the script..? Well me and Keep will solve this somehow..
|
|
kaoz
General
inter faesces et urinam nascimur
Posts: 1,112
|
Post by kaoz on Dec 13, 2011 22:08:43 GMT 1
I never encountered too many start commands either, but i might have not pushed it to the limit yet, althought it seems odd.
About the use, i think you should/could mix both start commands and script. In some cases you will have to. There do happen a lot of flaws in the sequence when using start commands and i have seem them a lot during testing. The benefits using script are mainly in the fact that you have more control over when these actions will take place (f.e. when troops X are in area Y).
In both cases, you should set the ChangeWarFog(1); so you can clearly see the start commands and script behavior (of the enemy units) while you test the map.
|
|
bb
General
Blitzkrieg junkie (tried to quit several times).
Posts: 1,362
|
Post by bb on Dec 14, 2011 23:14:05 GMT 1
Well, I almost dont use start commands (just to replenish ammo and units) because it usually causes issues. For example, if you give some start commands for a group of units and wants to delete one of the commands for one particular unit you will see that's impossible (you delete it, but once you click in the unit again the command will be back). Other problem, once you want to change a unit for another (this specailly important in map convertions), you will need to change all the start commands again.
Giving commands to a map coordinate is also very bad. If you give the command for a group of units they probably will be stuck in some place of the map, also you will need to check the coordinate several times, etc.
The best solution to give commands to units is use this very simple script command:
Cmd(3, 16, GetScriptAreaParams("toco1"))
The 3 is the "swarm to" command, the 16 is the number of unit and the "toco1" is the script area to be attacked. This script runs wells with all commands ("move to", swarm to") and I use it even to call the planes.
But be carefull to do not extend the script area over the map borders or the map will crash when you call the script.
|
|
|
Post by Major Pain on Dec 15, 2011 5:48:28 GMT 1
Let me add...
If you give commands to units which are reinforcements which appear after another action or trigger, you will suffer crash issues. This is a bug in the game engine which attempts to execute the unit before totally populated by the reinforce command.
This is also a common issue with scripted move or swarm commands. It's a good idea to "check" the script ID 'number of units' or simply put a pause or 'counter' between the reinforce and move command. OR... You can also set the move function to fire several seconds or minutes after the 'populate' to ensure they all land.
I had a map that always crashed at the same time and place. After I changed the FOW and watched it closely, I finally spotted a unit had landed on a tile that was not intended. When I went back to the map, I found the tile had a no movement value. In this case, Swamp. The tile was not where I had placed the unit on the mapeditor.... it had been moved due to the priority value versus other units in that particular script ID. In other words, it was moved to the best location possible within the spacing parameter; referred to as the AABB or the bump parameter. This is what prevents objects from passing through other objects.
You will see this in towed artillery and their tow vehicle. Something has to move for the 'hook' to take place. If it is too close to the border, it may try to put it outside of the map parameters. Keep in mind that the 'gun' takes priority over the tow vehicle... although if you don't rotate the gun the correct direction, the game will do so in relation to the hook location based on the tow vehicle direction.
I don't know if this is your issue... but it is worth considering.
I only use scripts for all move or deploy commands. It is much easier to control and repair when issues show up.
In most cases I assign reinforcements as neutral (Player2) to ensure they are landed without harrassment, then execute a move command to a location where it is then turned over to AI or player control with the ChangePlayer command.
Why? Well the AI cheats. There is nothing worse than a scout plane flying around and spotting the units when populating, then long range guns open up before you can get them the hell out of the way...
Another aspect of this is to randomize where the reinforcements show up. This a mere slight of hand trick accomplished by either of two methods:
Land them, move them to a specific location, and then activate them at that location...
or
Land them based on a condition based on players actions. This a bit trickier but very effective when you want the player to not know exactly where those guys are coming from.
The LUA script language is very robust at handling the very easy as well as very complex functions. It is just a matter of logic and math... If you like algebra... you'll love LUA.
hope it helps...
|
|
Folgore
General
(Once) BK Translator
Posts: 1,431
|
Post by Folgore on Dec 15, 2011 10:34:15 GMT 1
... If you like algebra... you'll love LUA. So I'm cut off. I was just enough in maths although I was quite good in greek and latin. Sorry for off topic, i couldn't resist
|
|
|
Post by LouisXIV on Dec 15, 2011 12:51:04 GMT 1
If you give commands to units which are reinforcements which appear after another action or trigger, you will suffer crash issues. This is a bug in the game engine which attempts to execute the unit before totally populated by the reinforce command. The Major is back!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - I've said it elsewhere and it bears repeating. When I land reinforcements and want them to do something right away, I put it as two separate paragraphs in the script file. I land the reinforcements, then call the action paragraph with a delay of 5 to 9 seconds. It takes about 4 seconds for all the units to land, and possibly a little more on really big groups.
Conversely, if I use Start Commands to cause the action - say I want the units to swarm to a particular location - Then all I have to do is land the reinforcements in the script as a matter of timing. The script LandReinforcement and the Start Commands Move, Swarm and Entrench Self (and others) work quite well together. The Start Command doesn't kick in until all the reinforcements have landed.
So if I have a town with 5 infantry squads defending it (ScriptID 2000) - plus other hardware - then I put a counterattack unit as a reinforcement behind the town (ScriptID 2010), and find coordinates that will make it counterattack through the town itself. Then I script it as follows:
function ResponseWon() if GetNUnitsInScriptGroup(2000,1) <= 4 then LandReinforcement(2010); RunScript(ActionPhaseI,9000); Suicide(); end; end;
function ActionPhaseI() GiveCommand(3,2010,4058,12009); Suicide(); end;
The reinforcements are not on the map until needed, so they won't get bombed or shelled into oblivion before they even have a chance to prove themselves.
However, if you use Start Commands on a reinforcement group (2010), then you can use the first paragraph only and skip the RunScript line in it.
As far as replacing units that have Start Commands, it's usually "easy." Save the mission map in xml format and do a search-and-replace (Ctrl-H). All Start Commands are transferred to the replacement unit. Save the map, then call it up in the MapEd and save it again as .bzm format.
If you want to delete a unit that is part of a group with a common Start Command, try [BKP]'s map modifier software - I do believe it will do the trick. Or make a habit of using Start Commands on groups of no more than three (squads or tanks.) It's more work, but your attack/move will go better without bunching, and it's easier to modify/remove units.
|
|