|
Post by Jagged Steel on Jun 9, 2010 0:40:07 GMT 1
Thanks for looking into this runrum. All of the multiplayer maps start with that message, and none of them (with the possible exception of Lost Victory) actually do what that states. Acording to the .lua script guide, the FlagReinforcment function is checked every cycle, but it doesn't indicate that any running tally of the actual flag point count is being kept. Do you think this event triggers only every 150 Flag points? Most multiplayer maps apply reinforcements by timed event only.
P.S. My interest is not in the intricacies of the random equations in the Lost Victory script, but rather in whether it is possible to check the flag point totals in a script and use these values to determine reinforcements. I thought that the LostVictory script did just this, but it appears that it only checks whether each party has at least one flag and then randomly awards reinforcements.
|
|
runrum
Zastavnik 1. klase
Posts: 85
|
Post by runrum on Jun 9, 2010 21:03:01 GMT 1
Thanks for looking into this runrum. All of the multiplayer maps start with that message, and none of them (with the possible exception of Lost Victory) actually do what that states. Acording to the .lua script guide, the FlagReinforcment function is checked every cycle, but it doesn't indicate that any running tally of the actual flag point count is being kept. Do you think this event triggers only every 150 Flag points? Well, please take a look at these youtube links that I found: (This is a MK Multiplayer Game (Map name "Mission Kursk 5"; bzm name "Mp_test"/lua name "MK_flag_3")) www.youtube.com/watch?v=yegAz8pGRV8www.youtube.com/watch?v=9A7264JLgmAwww.youtube.com/watch?v=8PAd9ESsoloI checked the script and checked the script IDs in the mapeditor. Well map runs exatcly as it should - the video proves it. This is from ActiveGaming about MK Multiplayer Patch 1.4/1.5 activegaming.proboards.com/index.cgi?board=GeneralKursk&action=sendtopic&thread=409activegaming.proboards.com/index.cgi?board=mpkursk&action=display&thread=513Well I'm not exactly sure what you mean. I couldn't find any lines in MP scripts like' RunScript("ReinforceTanks", 60000+RandomInt(60000))' Reinforcement are triggered by "FlagReinforcemnet" command as you mentioned before. You posted the excerpt from Calvin yourself. Calvin's Lua guide once again: This function is called in a multiplayer game just after a flag has been captured, and regularly until at less a flag (personal note:I guess it should mean "until at least one flag...") is still captured by the nParty team. · To use this command insert the following lines in your scriptSo like discussed: In a flagcontrol map the message pop ups where it is said the player gets for flag AND time points. And the points 150 trigger the Reinforcement.
|
|
runrum
Zastavnik 1. klase
Posts: 85
|
Post by runrum on Jun 9, 2010 21:10:58 GMT 1
P.S. My interest is not in the intricacies of the random equations in the Lost Victory script, but rather in whether it is possible to check the flag point totals in a script and use these values to determine reinforcements. I thought that the LostVictory script did just this, but it appears that it only checks whether each party has at least one flag and then randomly awards reinforcements. General remark: I've read your postings (edited version too) several times and I'm still not sure If I did understand you correctly. Because I checked German BK forum if there are mentioned any problems with Multiplayer maps - BK or MK. But couldnt't find any complains.. About "check flag points total in a script": There are only four directly to multiplayer related commands in Calvin's guide. I don't see how this should be done with one of those commands... But maybe I'm wrong here and someone else could step in.
|
|
|
Post by Jagged Steel on Jun 9, 2010 21:23:18 GMT 1
Thanks again for your insight into this runrum.I don't have MK and havn't seen any scripts, but of ALL of the 200 or so regular BK Multiplayer maps/scripts that I have the only one that I know of that actually uses the "Flag Reinforcement" command is Lost Victory. The message about awarding reinforcements every 150 flag points before all Multiplayer Flag Control games isn't quite accurate. This is a generic message that appears on all Flag Control missions. You would receive reinforcements every minute or two by this method of "every 150 flag points". Are you sure that the "FlagReinforcment" is triggered every 150 points? If so I can see a way to make reinforcements occur at larger intervals by using a variable and adding to it every time this is triggered, then having a reinforcement event trigger when that variable reaches a certain amount. I was actually trying to find a way to write a script that would award reinforcements based on reaching Flag point scores, making holding flags a much more important part of the game. It appears that this might actually nor be possible, as there is no command to access the flag point score.
|
|
runrum
Zastavnik 1. klase
Posts: 85
|
Post by runrum on Jun 9, 2010 21:32:46 GMT 1
As for my own 'question', what is making the script in this mission not work? www.mediafire.com/?zmym3moroyqThe script is quite simple and straightforward, but some part of it causes it to not run. I'm really stuck here, any clues would be much appreciated. Well checked your script and couldn't find any errors. Run it with the editor, no error message either (and Exit code:0). So your script seems to be fine. ---------------------------- Included on purpose an error (removed a bracket) ---> error message (red) + exit code is set 1 ---------------------------- Added bracket again --> run ---> exitcode:0 included some errors and removed them again --> finally exit code is set 0 again. ------------------------------------ So whatever it is I'd guess it's not your script what is causing problems.
|
|
|
Post by Jagged Steel on Jun 9, 2010 21:58:01 GMT 1
Here is an example of a typical Multiplayer BK script. This one is from "Operation Bagration", probably the most popular user made BK Multiplayer map of all time. Nearly all Multiplayer scripts use timed reinforcements,(except LostVictory), and these functions are typical of the 200 or so maps that I have:
Code: function Beginn() DisplayTrace ("Welcome to the Westfront 1944"); DisplayTrace ("reinforcements are about 5 x every 10 minutes"); DisplayTrace ("created by"); DisplayTrace ("Oltjef") end;
function Beginnend() KillScript("Beginn"); end;
function support1() LandReinforcement(101); Suicide(); end;
function support2() LandReinforcement(102); Suicide(); end;
function support3() LandReinforcement(103); Suicide(); end;
function support4() LandReinforcement(104); Suicide(); end;
function support5() LandReinforcement(105); Suicide(); end;
function Init() SwitchWeatherAutomatic (3); RunScript("Beginn", 1200); RunScript("Beginnend",4000); RunScript("support1",600000); RunScript("support2",1200000); RunScript("support3",1800000); RunScript("support4",2400000); RunScript("support5",3000000); end;
|
|
runrum
Zastavnik 1. klase
Posts: 85
|
Post by runrum on Jun 9, 2010 22:10:33 GMT 1
Here is an example of a typical Multiplayer BK script. This one is from "Operation Bagration", probably the most popular user made BK Multiplayer map of all time. Nearly all Multiplayer scripts use timed reinforcements,(except LostVictory), and these functions are typical of the 200 or so maps that I have: Ok, sorry my mistake. I checked only those three available MK multiplayer flag scripts. And all three are scripted with FlagReinforcement ... as your example "lost victory".. so I assumed this is the standard .. At least now I understand what you mean... Hm...
|
|
|
Post by Jagged Steel on Jun 9, 2010 22:17:54 GMT 1
I guess my exact question is: Does the FLagReinforcement function ONLY trigger every 150 flag points? If it does, I think it is possible to use a variable and give reinforcements every 600 points or so, instead of every 150, which is way too fast(it is hard to deal with new units every minute when in multiplayer-every 10 minutes is about right). The idea is to make holding territory(Flags) give you rewards- holding more flags give faster reinforcements, rather than the standard way of giving each side the same amount, at the exact same times, regardless of whether any flags are being held.
|
|
runrum
Zastavnik 1. klase
Posts: 85
|
Post by runrum on Jun 9, 2010 22:42:47 GMT 1
I guess my exact question is: Does the FLagReinforcement function ONLY trigger every 150 flag points? Like I mentioned in my first posting regarding this topic. Never ever played a MP map so I have absolutely no "feeling" for MP maps. So I only can describe what I can see from the script, the mapeditor and quote what this pop up message said. If you say Reinforce aren't triggered exactly after counted 150 points , well then... Unfortunately I don't have a second computer available otherwise I would play a MP map by LAN. It would help me tremendously having at least played one MP map. Edit: Well, did you check the youtube links? Part 3 ~ 5.40 min. The stats say playing time was ~ 25min. And there were quite a few reinforcements landed. You've to count the bomber and scout planes too as "Reinforcments" as their enablment is triggered by the initial FlagReinforcement command. excerp: if ((n == 8) and (GetIGlobalVar( "GerBombers", 0) == 0)) then EnableAviation(0, 3); SetIGlobalVar( "GerBombers", 1); Suicide(); end; if ((n == 9) and (GetIGlobalVar( "GerScout", 0) == 0)) then EnableAviation(0, 0); SetIGlobalVar( "GerScout", 1); Suicide(); end; so doing some math considering points for time and flag holding... : playing time 25min , let's say approx. 10+ reinforcments for player (0)... well..hm...
|
|
runrum
Zastavnik 1. klase
Posts: 85
|
Post by runrum on Jun 9, 2010 23:22:57 GMT 1
The idea is to make holding territory(Flags) give you rewards- holding more flags give faster reinforcements, . Well I've got to admit I'm a little confused now. Using FlagReinforcement command and considering the aforementioned pop up message you should get this effect... excerp: Every captured flag is rewarded with one point per second holding this flag. Additionally you got one extra point per second, no matter how much flags you're holding.As far as I can see you got this effect by using your posted standard mp script example. but not by using FlagReinforcement like in "lost victory" or the mentioned three MK multiplayer maps. (Btw is there a possibility that there is something wrong with the "lost victory" script? and therefore it's not running correctly? )
|
|
runrum
Zastavnik 1. klase
Posts: 85
|
Post by runrum on Jun 10, 2010 0:25:04 GMT 1
This is an excerpt from your posted script/operation "Bagration":
LandReinforcment is triggered after 10 min, 20min, 30min, 40min, 50min.. no matter what happens with your flags because in this script there is NO FlagReinforcement command. ---------
This is the script from the MK MP map whose youtube links I've posted:
Do you see the difference?
There is no immediate time related trigger to run the LandReinforcment blocks. It's triggered by FlagReinforcement.
Additionally there is a restriction included. (see first lines) It only lands reinforcement if the total number of units (separately for both sides player(0) and player (1)) on the map is less than/equal 30.
Once more I quote Calvin:
FlagReinforcement(nParty) · This function is called in a multiplayer game just after a flag has been captured, and regularly until at less a flag is still captured by the nParty team.
|
|
|
Post by Jagged Steel on Jun 10, 2010 1:18:40 GMT 1
I don't think you understand what I am seeking runrum. I see how these scripts use the FlagReinf function and then randomize and limit reinforcements, but these scripts give reinforcements every 150 flag points? In most situations this means reinforcements more than once every minute: 60 flags per minute+say 2 flags(120 flags pm) = 180 flag points per minute- meaning you would have reinforcements every 45 seconds- this is not desirable.This is why nobody plays the Lost Victory map- it is chaos. Most maps have several flags- and you can get 150 flag points in about 10 seconds- this would be bonkers. My purpose of asking about this was to find out if there was a way to use the Flag reinforcement function to trigger reinforcements at larger intervals by having a variable that you would add to every time the flagreinf function triggered(every 150 flag points). So, rather than awarding 1 unit every 150 Flag points(less than every minute like LostVictory), you would award a whole group of units about every 1200 or 2400 Flag points.This would make reinforcements in groups spaced several minutes apart, and yet the player holding more terrain would get his reinforcements faster. Getting reinforcements one by one makes it hard to concentrate on the battle(especially in larger maps), and is universally hated in the Multiplayer community. In your example from the MK script, you figure reinforcements at a minimum of every 2,5 minutes- and this would really be more like once per minute- because you usually are holding at least one flag at all times(or you lose).
|
|
|
Post by Jagged Steel on Jun 10, 2010 4:56:32 GMT 1
From what runrum says and what is in Calvins guide, this "FlagReinf" function should run every 150 flag points. Can I remove the "RunScript" function and replace with one that adds to a variable, followed by a query that will trigger at specified sums in this variable? Something like this : 150 flag points have been earned by player1 AND he holds at least one flag. The FlagReinforcement (1) function for player one should trigger during this cycle, which then instructs that 150 be added to "variable1", keeping it the same as the flag point score shown in the game at that point. A following function would check "variable1" and would trigger a reinforcement event at certain point levels like 2400, 4800- etc etc flag points.If this will work, it solves the problem of the reinforcements arriving "every 150 points" which is a really short period of time. function FlagReinforcement( nParty ) if ((nParty == 0) and (GetNUnitsInPlayerUF(0) <= 30)) then RunScript( "FlagReinf0", 1000); end; if ((nParty == 1) and (GetNUnitsInPlayerUF(1) <= 30)) then RunScript( "FlagReinf1", 1000); end; end;
|
|
|
Post by Jagged Steel on Jun 10, 2010 14:50:53 GMT 1
Well, back to my original script project I had asked about here, it is now done! This script is for a map that I had made several years ago that I had used an existing script for, and never quite completed. Now I have finalized the map and have this "fancy" ( for me anyways) new script tailored for it. I discovered that when you "SwitchWeather(1)" to make the weather "bad", the weather cycle continues and will turn back to "good" in a random amount of time. The minimum time this occurs seems to be in 1minute20seconds so, I made a series of weather changes @ 1 minute intervals to make sure that the storm continues for at least 5 minutes. A big thank you to runrum and Wespex for helping me put this together! I am currently re-doing several not quite finished maps that I had done in the past that had all used borrowed or slightly modified exisitng scripts. I want to finalize these and make a fresh script for each of them. For my next script I want to try implementing a Flag Point based reinforcement system. Here is the final version of the script for "Bigtime in the Desert": Script: function text1() DisplayTrace ("We have made Enemy contact in the village ahead Commander!"); DisplayTrace ("Seize the Water and Fuel facilities to maintain supply for your men."); DisplayTrace ("The rest of our column will arrive via the Tre Capuzzo road."); DisplayTrace ("The last units should arrive within an hour."); DisplayTrace ("Your forces include captured and repaired enemy equipment."); DisplayTrace ("Supplies are limited, your orders are to salvage what you can from the battlefield."); SwitchWeather(1); Suicide(); end; function text2() DisplayTrace ("When the weather clears you will have the support of our airforce"); DisplayTrace ("Capture all flags to win the battle. Good Luck!"); DisplayTrace ("A map by Jagged Steel. Check out my new (Free!) Missione Africa Multiplayer Mod @ blitzsrbija.proboards.com"); DisplayTrace ("Dozens of new units including a complete Italian roster with Italian voices!"); Suicide(); end; function StartingUnits() LandReinforcement(100); Suicide(); end;
function support101() LandReinforcement(101); DisplayTrace ("Our AAA has arrived! Deploy it at once, the weather may clear soon!"); Suicide(); end;
function support102() LandReinforcement(102); Suicide(); end;
function support103() LandReinforcement(103); Suicide(); end;
function support104() LandReinforcement(104); Suicide(); end;
function support105() LandReinforcement(105); Suicide(); end;
function support106() LandReinforcement(106); Suicide(); end; function Stormover() SwitchWeatherAutomatic(1); Suicide(); end; function minute1() SwitchWeather(1); Suicide(); end; function minute2() DisplayTrace ("The Havarre continues Commander!"); SwitchWeather(1); Suicide(); end; function minute3() SwitchWeather(1); Suicide(); end; function minute4() SwitchWeather(1); Suicide(); end;
function Init() RunScript("text1",120); RunScript("text2",6000); RunScript("StartingUnits",120); RunScript("support101",240000); RunScript("support102",600000); RunScript("support103",1200000); RunScript("support104",1800000); RunScript("support105",2400000); RunScript("support106",3000000); RunScript("Stormover",300000); RunScript("minute1",60000); RunScript("minute2",120000); RunScript("minute3",180000); RunScript("minute4",240000); end;
Thanks again everyone, I couldn't have stumbled through this by myself! Look for this map on Gamespy this weekend!! P.S. Runrum: You can play BK Multiplayer by clicking on the "Gamespy" option in the BK Multiplayer menu- this is a free service and generally the best way to get a game going. When you install the Gamespy software, they try to get you to pay for expanded services, but very few people do this, the free option works fine except for a wonky chat setup.
|
|
|
Post by danzig70 on Jun 10, 2010 17:01:13 GMT 1
I always include a mission timer function. It was posted either here or BKHQ or BKP, I cant remember. Then I can use it to time events in the script. I will post it here this afternoon.
Take a look at the help file in the map editor. It lists several lua script commands. One of them is the switch weather automatic. You can use it after the switch weather command so it wont change back until you want it to. ( I see this has been mentioned earlier in the thread)
function FlagReinforcement (nParty) if ( (nParty == 0) and (GetNUnitsInPartyUF(0) < 18)) then RunScript("Flag0", 100); end; if ( (nParty == 1) and (GetNUnitsInPartyUF(1) < 18)) then [glow=red,2,300]RunScript("Flag1", 100);[/glow] end; end;
The Flag0 and Flag1 scripts are run every 100 ms? That seems odd to me. I see this was changed to 1000 in a later post. Did this have any effect?
UPDATE:
Here is the Mission Timer function I use:
function MissionTimer() local minutes, seconds; minutes = GetIGlobalVar("TimerMinutes", 0); seconds = (10 + GetIGlobalVar("TimerSeconds", 0)); if(seconds == 60) then seconds = 0; minutes = 1 + minutes; SetIGlobalVar("TimerMinutes", minutes); end; SetIGlobalVar("TimerSeconds", seconds); -- if(seconds == 0) then -- DisplayTrace("Mission Time: %g:00", minutes, seconds); -- else -- DisplayTrace("Mission Time: %g:%g", minutes, seconds); -- end; end;
This way you can call the global variables when you need to time something. I commented out the display of the time.
|
|