MadSmurf Posted May 19, 2010 Posted May 19, 2010 Hey all, Is there any way to disable and or limit respawns of airframes?. Via the editor for the mission I can uses flags to limit the number of airframes however it is not 100%. Via LUA so far have only found how to limit re-arm or increase the time taken to re-arm, however couldn't find anything in relation to respawning/repairing Have fun!... :joystick:
Case Posted May 19, 2010 Posted May 19, 2010 Is there any way to disable and or limit respawns of airframes?. Via the editor for the mission I can uses flags to limit the number of airframes however it is not 100%. Very interesting concept! If you are talking about this in the context of a multiplayer environment then it should be possible with triggers, but may be a bit hard to code. In pseudo code, it would probably look something like this: Test if a player selected a client slot (named Unit 1) and actually took off: SWITCHED CONDITION(Unit 1 Spawn) // UNIT INSIDE ZONE(Unit 1, Spawn Zone) && UNIT'S SPEED HIGHER THAN(Unit 1, 100) && FLAG IS FALSE(1) // SET FLAG(1) && SET FLAG(21) Use a trigger zone that encompasses the whole airfield the client spawns. Flag 1 is set to false by default, and will be true when a client is flying with the plane. Test if the player left or died: SWITCHED CONDITION(Unit 1 Dead) // UNIT DEAD(Unit 1) // CLEAR FLAG(1) Now you can use triggers to count how many times flag 21 is true, see this thread by 3Sqn_Grimes: http://forums.eagle.ru/showpost.php?p=902089&postcount=1 There are only 10 types of people in the world: Those who understand binary, and those who don't.
Grimes Posted May 19, 2010 Posted May 19, 2010 Is this for MP? I'm quite sure it is possible to accurately set a limit of how many airframes are allowed to be used.... it just takes way to many triggers. It could look something like this... For each aircraft that can die Switched Condition P1 Damage>Unit Damaged (P1) && Speed Greater than 1 > Set Flag 1 So that basically says, if they are moving and become damaged (missile hit) set flag 1 Switched Condition P1 Dead>Flag True (1) && Group Dead (P1s Group) > Set flag 99 So if they were previously moving and become dead all of a sudden, set the flag that counts "+1" to the airframe deaths Switched Condition P1 Legal Exit> Speed Less than 1 && Flag 1 is True && Group Dead> Clear Flag 1 if the player stops someplace and exits the game while they were damaged it "clears the damage" Obviously you could add a trigger zone for where they have to be in order to exit. Also the logic is missing regarding "repairs" so you would have to make assumptions about whether an aircraft has repaired or not. Then a counter would look something like this Switched Condition (0+1) > Flag is True (99) && Flag is True (100) > Set Flag 101, Clear Flag 99, Clear Flag 100 Switched Condition (1+1) > Flag is True (99) && Flag is True (101) > Set Flag 102, Clear Flag 99, Clear Flag 101 edit: ROFL. I suppose Case's method makes sense too. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
MadSmurf Posted May 20, 2010 Author Posted May 20, 2010 Yep I have tried with Conditions and flags a method close to Grimes's, however in testing it would not always trigger correctly 100% which was annoying. Went though the Logic and it all looked good. So it lead me to look at some other method via LUA's or something thats more reliable, i was thinking I could realtime track the logs from the server and monitor ejects/crashes etc and then push them back to spectators if all airframes are used, learning LUA slowly :(... Its more for a semi/auto campaign where there are limits on aircraft/units :pilotfly: It becomes pointless if people can just keep respawning when they die. Else I could just make it so if all units killed after say 2 deaths don't count and appear in next mission??.
Case Posted May 20, 2010 Posted May 20, 2010 There is another method, which may be easier. You can set mission goals, where by if some trigger is true, it can give a coalition points (see page 74 from the GUI manual). You could try to make a trigger that gives the opposing side a number of points each time a player dies. You can then use the MISSION SCORE HIGHER THAN condition to deactivate a spawn point. I can't test this myself now, but you may want to look into it. There are only 10 types of people in the world: Those who understand binary, and those who don't.
Grimes Posted May 20, 2010 Posted May 20, 2010 oh man, I wish we could load from mission to mission what is alive or dead. Having such an ability would make one project I'm working on totally epic, however currently I'm just limited to it being slightly epic. Case pointed me to where the mission editor code is located, suffice to say there are a few things that are very very high on my list of mission editor needs that I might have a crack at developing. Just wondering, how exactly doesn't it always trigger 100%? IMO, there are two ways to limit aircraft. 1. The annoying way 2. The correct way The annoying way simply entails checking if a player was in flight and if they died. Then if an airframe was lost keep disabling their aircraft if someone joins it. The correct way is the counting method. That way you allow peoples insecurities and need for respawn, but you still get the whole "You only have this many airframes to use" mechanic, which is what its really about. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Recommended Posts