I have an idea for a tool useful for scenarios.
A tool to implement airplanes numbers limitations and spawn rules.
Our scenarios are usually based on an honor system, enforced with closing field and penalty in scores.
I've elaborated a suggestion, maybe is a dumb idea, but i'll like HTC and CMs to look at it and say if it is feasible.
I am posting here in scenario forum, hoping is a good place to do it, but i'll post pointers in other forums aswell.
Premise
I assume that the server part of the game is a different application than the FE, dunno in wich language is written, but I guess there are databases, variables, and maybe an object/event oriented style of programming.
Looking at how arena setup works, i assume that there's a database linking the avalaibility of the plane types to the field, something like:
Field x + Kite model y = Active/Inactive (boolean, I guess)
everytime the FE ask for a Spawn event the DB is checked by the server for this variable, and if false the FE respond in "you cannot fly this plane... etc.", if true the FE spawn the plane and the server create the instance (or equivalent) of it.
Suggestion
In an horrible pseudo code ;)
Add a numeric variable to the above (imagined) Table/Array/whatever you call it, we can call it:
Field_Model_Number_Avail (x,y) = z
The 2 simple integration to the landing and spawn event/subroutines:
x = starting field
y = plane type
z = plane type number variable value
w = Landing field
Spawn
If Field_Model_Active(x,y)=False
No_soup_for_You_Message : Exit
Else if
Sub 1 to Field_Model_Number_Avail(x,y)
If Field_Model_Number_Avail(x,y)<=0
Set Field_Model_Active(x,y)=False
Set Field_Model_Number_Avail(x,y)=0 ' To avoid negative numbers bug ;)
End If
End If
Succesful Landing
Add 1 to Field_Model_Number_Avail(w,y)
If Field_Model_Active(w,y)=False
Set Field_Model_Active(w,y)=True
End If
With a modification to the FE (eventually) to show the numbers of planes available in the hangar interface.
And the possibility in the setup interface to activate (as already is) and indicate the number of planes to be Available in the field.
This tool can be useful to ease the work of the CMs during and after the frames, since is the server itself that control the spawning.
Plus can be used to field transfers, Kite lifes, forces distribution, and many other things, expecially in Niemen and Kurland type of scenarios.
Ah, I almost forget.
The function can be activated for the map like the Strat On/Off we already have, and as a plus:
Be set On/Off for ride type.
Be set On/Off for field or event.
Example:
In a Scenario we have Unlimited Vehicle life and 1 life for planes (Landing and exiting is similar as to die or disco).
Settings:
Arena
Plane counter = On
Field X settings
Ride (1.2.3 GV planeset) Counter off
Ride (5.7.9 Planes planeset) Counter On / Landing Off / Number=planeset
Another example:
A Scenario where you have 1 life in planes ..... ok, Niemen, or Kurland.
Arena
Plane counter = On
Field X settings
Ride (Planeset) Counter on / Number = Planeset
Make sense?
Opinions?
I think more powerfull tool could be done for scenario control.
Probably you want to enable 2-3 lifes for one side or sertain squadron etc.
Also what heppen if there are less players then defined? So someone will be able to take 2nd plane.
I think we need kind of script that CM can write and upload to server that will describe the behavior of life rules per player
Example
int glb_Max262Lives=8;
class PlayerLifes: public CPlayer {
int m_LivesPerVeicle;
int m_LivesPerFighter;
OnInit()
{
if(Squadron==Pyro || Squadron==HiTech)
{
m_LivesPerVeicle=3;
m_LivesPerFighter=1;
}
else if(country==0)
{
m_LivesPerVeicle=0;
m_LivesPerFighter=1;
}
else if(country==1)
{
m_LivesPerVeicle=0;
m_LivesPerFighter=2;
}
else
{
m_LivesPerVeicle=0;
m_LivesPerFighter=0;
}
};
bool OnEvent()
{
switch(Event){
case FLY:
if(VType==Viecle && m_LivesPerViecle){
return TRUE;
}
break;
............
case DEAD:
if(VType==Viecle){
m_LivesPerViecle--;
}
if(Aircraft=P_262){
glb_Max262Lives--;
}
.............
};
};
Of course scpirt I have written - is qute complex but the language itself can be simpler (not C like).
So CM upload scrpits that describe lifes behavior - in all cases.
Probably he can also describe much more things for viecles, and other rules.
Anyway - you have a class with data per player and per other fewchers. The procedures are interpreted each time any kind of event heppens and they describe the rules behavior.
Probably it is quite complex implementation but it can be extreemly powerfull tool.
EDIT:
I thought it could be actually little C++ file that can be compliled by HTC as .dll and loaded each time scenario begins like - terrains.