Banner left   Banner center   Banner right

Germanenglish Home · News · Diary · Screenshots · Documentation (Wiki) · Downloads · Guestbook · Forum

Home · Benutzer registrieren · Suchen · Statistik · FAQ · Benutzerliste

Zur Zeit online: keiner ausser dir

 X-Force - Fight For Destiny - Forum —› English - gamesets —› The Federation gameset

Seite: 1 [2] >>

Autor Mitteilung
verfasst am: 27.11.2011, 18:32 · Edited by: Painkiller347
Registrierdatum: 27.11.2011, 18:08

 Beiträge: 20
Hallo, I am making my own gameset named The Federation. The gameset is now only in testing version and without some story. I made a little research capacities for the beginning and some scripts for generating a groung missions randomly.
Aliens are only in test vesrion, but It could be the first one, they are stupid but tough.

I have got a big problem, I have made some nice pictures in tileset, but I dont know how to set what tile means "the door(walkable), window, half-wall(visible as window, non walkable ground)". Could someone help me?
(I saw in screenshots that some newer tile editor exists, but could I download it from somewhere? I am using BETA 0.915V4B)
NEW EDIT - I found the setup for version 917A03...I feel a little more busy in making the gameset, reading almost everywhere about new version and dont look at the download for it, it could solve the problem I think.

Later I will upload it somewhere and post here the link for some advices what can be made better.
verfasst am: 27.11.2011, 18:35 · Edited by: Natter
Programmierer, allgemeines

Registrierdatum: 06.06.2004, 17:19

 Beiträge: 3186
You should create/edit your Gameset with v0.917a03. Old Maps are not compatible with the new formats.
verfasst am: 27.11.2011, 18:43
Registrierdatum: 27.11.2011, 18:08

 Beiträge: 20
Yes I already downloaded new version right now, but thanks for answer anyway x)
verfasst am: 29.11.2011, 19:30
Registrierdatum: 27.11.2011, 18:08

 Beiträge: 20
I need to ask, if I can make an animation for alien, and how I can add it?

I found only that animations are stored in models.pak, but I cant open this filetype.
verfasst am: 30.11.2011, 10:30
Admin, Spielsatz GalWar

Registrierdatum: 31.08.2005, 21:51

 Beiträge: 5595
There are other programs needed to make an alien animation, but those programs are not yet public.

We have been planning to make those public, but there are a few problems with the save process and the formats.
A few days ago JohnS (who made several of the current animations) gave me the specific data I didn't have and I plan to put everything together for the first part publication, but I'm currently low on time and it will be between 2 and 4 weeks before the XAN-Compiler and its description can be published.

After that anyone can make an X-Force-Animation file and send it to us for inclusion into models.pak

However it's currently not yet possible to publish the modelstudio itself (the program needed to combine the animation with the game data and put it into the models.pak.

The reason for that is the saving method for those animations - they can't be stored in the gameset (yet), and if gameset creators start to produces their own models.pak-files, we will have a lot of incompatible versions (happened to the tilesets in the old format before Natter wrote a new tileset editor, I don't want the same problems again with the models...)
verfasst am: 30.11.2011, 15:26
Registrierdatum: 27.11.2011, 18:08

 Beiträge: 20
OK, I understand..that will be fine. I am really enjoying in both, playing and creating the gamesets with so many editors, so I will wait...
And continue creating and balacing first part of my gameset, but now in the newer version 917a3.
So good luck in programming.
verfasst am: 02.12.2011, 17:44 · Edited by: Painkiller347
Registrierdatum: 27.11.2011, 18:08

 Beiträge: 20
I want to use in game "stamina" for all soldiers in the ground missions. Stamina will be 0 to max 10. At start of every mission it will be randomly set to 4-8. Stamina will change the TimeUnits of every soldier, at start of player round, by this rule >>
TimeUnit = TimeUnit + ((stamina-5)*3) For example:
stamina-5 = 3 => +9 TU
stamina-5 = -4 => -12 TU
I need an advice how to set stamina at every start of ground mission, actually I written this code, but dont know if it works (Syntax checked with no errors) >
program util_Stamina;
var
  st : Integer;
  stamina : Array of Integer;
  GMission : TObject;
  
procedure StaminaReset(Sender: TObject);
var
  Ground: TGround;
  i : Integer;
begin
  Ground:=TGround(Sender);
  for i:=0 to 10 do   //NULL stamina array
  stamina[i] := 4 + random(4);
end;

procedure StaminaChange(Sender: TObject);
var
  Figure : TGameFigure;
  Figures : TAIGroup;
  i : Integer;
begin
  Figures := groundAI_api_GetEnemyAIGroup;     
  for i := 0 to Figures.EnemyCount - 1 do      //set every single unit
  begin
    Figure := Figures.GetEnemy(i);
    if(Figure.TimeUnits >round(Figure.TimeUnits/2)) then  //stamina modification (when soldier dont use all TimeUnits stamina will be increashed)
    begin
      if(stamina[i] < 10) then
      stamina[i] := stamina[i] + 1;     
    end else
    begin
      if (stamina[i] > 0) then
      stamina[i] := stamina[i] - 1;
    end;
  end;
end;

procedure StaminaUse(Sender: TObject);
var
  Figure : TGameFigure;
  Figures : TAIGroup;
  i : Integer;
begin
  Figures := groundAI_api_GetEnemyAIGroup;     
  for i := 0 to Figures.EnemyCount - 1 do      //set every single unit
  begin
    Figure := Figures.GetEnemy(i);
    st := (stamina[i] - 5) * 3;                 //1 stamina = 3 TU
    Figure.TimeUnits := Figure.MaxTimeUnits + st;
    Figure.Name := Figure.Name + ' ST:' + IntToStr(stamina[i]);   //show actual stamina behind the name
  end;
end;

procedure StartMission;
var
  i : Integer;
begin
  SetLength(stamina,11);
  for i:=0 to 10 do   //NULL stamina array
  stamina[i] := 4 + random(4);
  register_event(@StaminaReset,GMission ,EVENT_ONGROUNDFINISHED);
  register_special_event(@StaminaUse, EVENT_SPECIAL_ONNEWPLAYERROUND);
  register_special_event(@StaminaChange, EVENT_SPECIAL_ONNEWALIENROUND);
end;

begin
  MissionName := 'util_Stamina';
  MissionType := mzUser;
end.


Could the "StaminaReset" been done in all scripts which contains creation of ground missions or how can I solve it?

(And after that I want to make an effect, when soldier is hit, his stamina will be reduced depends on the power of weapon)

-------------------------------------------------
I already tried to run it, but it dont looks to be working. And error was accured in AI - The aliens was acting weirdly..they almost cant attack...so there must be somethink wrong, I need a help with that script, have someone a time?
verfasst am: 02.12.2011, 19:24
Registrierdatum: 22.08.2008, 15:51

 Beiträge: 403
There are two ways, depending on what you want to achive. Do you want to set the stamina each ROUND, proceed to number two, if you want to set the stamina for each GROUNDMISSION, proceed to number one.

1) You could rename the to "GroundAI_default". In that case, you overwrite the standardscript, which is called at the begin of a each groundmission. Remark that you get a warning message that the standardscript is overwritten (but that's of course something you want) and that if you change the standardscript of a groundmission you have to call your stamina script manually. And you should end your script properly by using the the line
mission_win;

in the Reset-function.

2) You can change the standard-startup-conditions to "on startup" and let it run forever. I don't know if everything in the editor is already in english, so I give you short description:
-)double click your script
-)click on Bedingungen/conditions
-)check the radiobox einmalig/one time (or something like that)
-)click on the button Neue Bedingung/new Condtion
-)choose Spielstart/Gamestart in the dropdown list

Good Luck!
verfasst am: 02.12.2011, 20:29 · Edited by: Painkiller347
Registrierdatum: 27.11.2011, 18:08

 Beiträge: 20
Stamina should be set randomly at the start of each ground mission. After it, all next rounds it will be modified
(if unit remains TU more than 50% of MaxTU, stamina will be increased by 1 - it is happening during the alien turn - else stamina will be decreased by 1)
I repaired the script so it is funcional now, only one thing and that is the Names of Soldiers, I want to write behind all names the actual stamina "SP:XX" => [Sp] Soldier Name SP:6

procedure StaminaUse(Sender: TObject);
var
  Figure : TGameFigure;
  Figures : TAIGroup;
  i : Integer;
begin
  Figures := groundAI_api_GetEnemyAIGroup;     
  for i := 0 to Figures.EnemyCount - 1 do      //Set every unit..
  begin
    Figure := Figures.GetEnemy(i);
    st := (stamina[i] - 5) * 3;                 //1 stamina = 3 TU
    Figure.TimeUnits := Figure.MaxTimeUnits + st;
    Figure.Name := Figure.Name + ' ST:' + IntToStr(stamina[i]);  // !!Here is the problem !!
  end;
end;
I am thinking about loading the Names into the Array of String and then reload it every time while rewriting the name + add "SP:XX", or any other possibilities? ---------------------------------------------------LAST EDIT--------------------------------------------------------- I tried to load Names of soldiers into the TStrings, dont know how to take Names back from that hell thing... I tried to load Names in to the Array of String, result was "Out of range" when I used it that way:
fnames : Array of String; //was declared for all procedures in the script,
                          //I has been loaded by the Names of soldiers
procedure StaminaUse(Sender: TObject);
var
  Figure : TGameFigure;
  Figures : TAIGroup;
  i : Integer;
begin
  Figures := groundAI_api_GetEnemyAIGroup;     
  for i := 0 to Figures.EnemyCount - 1 do      //Set every unit..
  begin
    Figure := Figures.GetEnemy(i);
    st := (stamina[i] - 5) * 3;                 //1 stamina = 3 TU
    Figure.TimeUnits := Figure.MaxTimeUnits + st;
    Figure.Name := fnames[i] + ' ST:' + IntToStr(stamina[i]);  // !! << Out of Range!!
  end;
end;

It is getting impossible for me to only load Strins to some indexed list and them tak simle Strings from the list by index. Please help..%)
verfasst am: 02.12.2011, 23:19
Admin, Spielsatz GalWar

Registrierdatum: 31.08.2005, 21:51

 Beiträge: 5595
You need to set the lenght of the array (the number of strings in it) before using it the first time.
That should be done in this case as a dynamic array, using the setlenght command
verfasst am: 03.12.2011, 01:25 · Edited by: Kamor
Registrierdatum: 20.07.2005, 00:01

 Beiträge: 203
Here is the way i reach my soldiers onfirstround in a ground mission. cause there is no event on first round i use the onnewround event and a flag to only work one time, i reset the flag then with the ongroundfinished event, so next ground mission this script works again.

With Figure.SetAIScript('UnitAI'); i load every firstround my own scripts 'unitai' for the soldiers and send also a 'human' string to this. The send string is only to see, that you can comunicate between two scripts, the setaiscript is to see, that you can change the ai-scripts for units in groundevent and in this script i do this every first round of a ground event. You can remove the send string and the setaiscript and put there your stamina change. But when i read Kreks statement, my solution is not the best way, also it works fine for me.

program OnFirstRound;

var FirstRound : Boolean;
mission : TMission;

procedure Groundfinished(Sender: TObject);

begin
  FirstRound := false;
end;

procedure NewPlayerRound(Sender: TObject);
var i : integer;
var Figure : TGameFigure;
var Ground : TGround;

begin
  if (FirstRound=false) then
  begin
    FirstRound:=true;
     Ground := groundAI_api_GetRunningGround;
     if (Ground=Nil) then
     begin
       game_api_MessageBox('Warning: No RunningGround for NewplayerRound-Script');
     end
     else
     begin
       // game_api_MessageBox('FirstplayerRound');
       if (groundAI_api_GetEnemyAIGroup.EnemyCount)>0 then
       begin
         for i:=groundAI_api_GetEnemyAIGroup.EnemyCount-1 downto 0 do
         begin
           Figure := groundAI_api_GetEnemyAIGroup.GetEnemy(i);
           Figure.SetAIScript('UnitAI');
           
           mission := Figure.AIMission;
           if (isobject(mission)) then
           begin
             mission.CallProcedure('ScriptCommand',['human']);
           end
           else
           begin
             game_api_MessageBox('Error: Unitmission not exists');
           end;
         end;
       end;
       register_event(@Groundfinished,Ground,EVENT_ONGROUNDFINISHED);
     end;
  end;
end;

procedure StartMission;
begin
  FirstRound := false;
  register_special_event(@NewPlayerRound,EVENT_SPECIAL_ONNEWPLAYERROUND) ;
end;

begin
  MissionName:='OnFirstRound';
  MissionType:=mzUser;
end.



Edit:

Here you find the syntax of this GroundAI_default Kreks is speaking from.

https://xforceffd.svn.sourceforge.net/svnroot/xforceffd/branches/V915t urbo2006/game/bin/settings/Scripts/GroundAI_default.xms
verfasst am: 03.12.2011, 15:41 · Edited by: Painkiller347
Registrierdatum: 27.11.2011, 18:08

 Beiträge: 20
Really Thanks for help, I now understand where is the problem.
1. The Script loads the number of soldiers before the mission start (=0)
2. In mission it call Out of range because now it will count the units on the ground

So I will use the part of Kamor's code, to load the names and random stamina at start of the ground mission...I will write If it works, and then I have got more ideas how to modificate the soldiers condition in the ground fight.
EDIT>
Great, it works now. But there is another small problem, if I killed the first soldier, his name and stamina owns the second soldier at the next turn...there is the code (firstset is set as false [at end of mission] in another script which uses this script)
Unit util_Stamina;
var
  st : Integer;
  firstset : Boolean;
  stamina : Array of Integer;
  fnames : Array of String;

procedure StaminaChange(Sender: TObject);
var
  Figure : TGameFigure;
  Figures : TAIGroup;
  i : Integer;
begin
  Figures := groundAI_api_GetEnemyAIGroup;     //Nacteni vsech jednotek
  for i := 0 to Figures.EnemyCount - 1 do      //Projeti vsech jednotek na mape
  begin
    Figure := Figures.GetEnemy(i);
    if(Figure.TimeUnits >round(Figure.MaxTimeUnits/2)) then  //modifikace staminy
    begin
      if(stamina[i] < 10) then
      stamina[i] := stamina[i] + 1;
    end else
    begin
      if (stamina[i] > 0) then
      stamina[i] := stamina[i] - 1;
    end;
  end;
end;

procedure StaminaUse(Sender: TObject);
var
  Figure : TGameFigure;
  Figures : TAIGroup;
  i : Integer;
begin
  Figures := groundAI_api_GetEnemyAIGroup;     //Nacteni vsech jednotek

  if (firstset) then
  begin
   for i := 0 to Figures.EnemyCount - 1 do      //Modifikace staminy na zacatku tahu
   begin
    Figure := Figures.GetEnemy(i);
    st := (stamina[i] - 5) * 3;                 //1 bod staminy = 3 TU
    Figure.TimeUnits := Figure.MaxTimeUnits + st;
    Figure.Name := fnames[i]+' ST:'+IntToStr(stamina[i]);
   end;
  end else
  begin
   firstset := true;
   SetLength(stamina,Figures.EnemyCount);
   for i:=0 to Figures.EnemyCount -1 do   //NULL stamina array
    stamina[i] := 4 + random(4);

   SetLength(fnames,Figures.EnemyCount);
   for i:=0 to Figures.EnemyCount -1 do   //Names of soldiers
    begin
    Figure := Figures.GetEnemy(i);
    fnames[i] := Figure.Name;
    end;
  end;
end;

procedure StartMission1;
begin
  firstset := false;
  register_special_event(@StaminaUse, EVENT_SPECIAL_ONNEWPLAYERROUND);
  register_special_event(@StaminaChange, EVENT_SPECIAL_ONNEWALIENROUND);
end;

begin

end.

2) And how can I remove from names first 4 letters?
Because when I save the name into the Array it is saved with e.g. "[Sp]Soldier Name" and in mission the name looks like "[Sp][Sp]Soldier Name ST:5"
verfasst am: 03.12.2011, 16:49 · Edited by: Kamor
Registrierdatum: 20.07.2005, 00:01

 Beiträge: 203
If a soldier is killed in ground mission the groundAI_api_GetEnemyAIGroup is changed also.

Enemycount goes one down and all the higher indexed soldier from the one who is killed are sorted one index down i think? this is also the reason my loops goes from highest to lowest to avoid errors later.

so u need also to react in your fnames array then.
perhaps you try the EVENT_FIGURE_ONDIE
to react in script?

stringoperations?
perhaps you try it on this way
get the stringlenght with
length

and then count from 4 to length-1
use then
StrGet and add these chars to an new string

perhaps there is also an easier way, when u speak to the string like an array of chars, some languages can do this, dont know if x-script can do this too?

perhaps u can fix both problems, if u change a little your style.

in the beginning, copy the names of the soldiers also to a array with the same indexes as your stamina array?

if u have this strings copied u need no stringmanipulation to cut the one [Sp] out there and with the name of the current soldier u can always get the right value of your stamina array.
verfasst am: 03.12.2011, 17:08
Registrierdatum: 27.11.2011, 18:08

 Beiträge: 20
I will look on that tomorrow, it looks complicated, I have no time yet...
verfasst am: 03.12.2011, 18:43 · Edited by: Kamor
Registrierdatum: 20.07.2005, 00:01

 Beiträge: 203
i found some better solution for your stringproblem

delete

perhaps

var temp : String;
...
temp := fnames[i]+' ST:'+IntToStr(stamina[i]);
figure.Name := delete(temp ,0, 4);
for the other problem you could try this: In your StaminaChange(Sender: TObject); remember there the enemycount like
Enemycount:=Figures.EnemyCount
then u can ignore the ranking and amount later in the taigroup. change the loop there from
for i := 0 to Figures.EnemyCount - 1 do
to
for i := 0 to EnemyCount - 1 do
finally u need to check, if your enemy is still alive, perhaps by looking for his name? cause u also manipulate the name, this could be a little tricky. something like
function (nameisinaigroup : string) : boolean;
... at this position i miss a pointer on the aigroup, so would be the easiest atm when u remember the aigroup also in your staminachange or make the Figures : TAIGroup; declaration global and put it before the staminachangeprocedre. finaly you need a loop, to check if the name exists like
function (nameisinaigroup : string) : boolean;
var i : LongInt;

begin

  result := false;
  if (Figures.EnemyCount>0) then
  begin
    for i:=Figures.EnemyCount -1 downto 1 do
    begin
      if (nameisinaigroup=Figures.GetEnemy(i).name) then
        begin
          result := true;
          break;
        end;
    end;
  end;
end;
i forget to give back a pointer on the tfigure you finaly want to change, perhaps you change then the function to
function (nameisinaigroup : string) : Tgamefigure;
and try
result := NIL; // cant say if NIL works on Tgamefigure?
result := Figures.GetEnemy(i)


this should be work, perhaps u need another compare instead of string=string cause of your namemanipulations before?

the other way is a litte more tricky, as a said a posting before, you can react on a unitdead and rework then your extended playerinformations (stringarrays)

Perhaps there are better solutions, but these are two ways i would try it.
verfasst am: 04.12.2011, 17:53
Registrierdatum: 27.11.2011, 18:08

 Beiträge: 20
Thanks for ideas how to solve this problem, this was help for my tries and after (maybe) 30 tests in game it is working correctly now. I modified the code and result is that I can now write after name more information and it still should work. Just look at the code...[only if soldiers will have the same names it wouldnt work, but I dont think it can happen..]
Unit util_Stamina;
var
  st,death,count : Integer;
  firstset : Boolean;
  stamina : Array of Integer;
  fnames : Array of String;
  
  Figures : TAIGroup;

procedure StaminaChange(Sender: TObject);
var
  Figure : TGameFigure;
  i,len : Integer;
  temp : String;
begin
  death := 0;
  for i := 0 to count do      //Projeti vsech jednotek na mape
  begin
    Figure := Figures.GetEnemy(i-death);
    temp := Figure.Name;
    Delete(temp,1,5); //[XY]_ Removed
    len := Length(temp) - Length(fnames[i]);
    Delete(temp,Length(fnames[i])+1,len);
    if (temp = fnames[i]) then
    begin
     if(Figure.TimeUnits >round(Figure.MaxTimeUnits/2)) then  //modifikace staminy
     begin
       if(stamina[i] < 10) then
       stamina[i] := stamina[i] + 1;
     end else
     begin
       if (stamina[i] > 0) then
       stamina[i] := stamina[i] - 1;
     end;
    end else death := death +1;
  end;
end;

procedure StaminaUse(Sender: TObject);
var
  Figure : TGameFigure;
  i,len : Integer;
  temp : String;
begin

  if not (firstset) then
  begin
   firstset := true;
   Figures := groundAI_api_GetEnemyAIGroup;
   count := Figures.EnemyCount -1;
   SetLength(stamina,Figures.EnemyCount);
   for i:=0 to count do   //Random stamina at start of every round
    stamina[i] := 4 + random(4);

   SetLength(fnames,Figures.EnemyCount);
   for i:=0 to count do   //Load cleared names of soldiers
    begin
    Figure := Figures.GetEnemy(i);
    temp := Figure.Name;          //>> "[Sp] Soldier Name"
    Delete(temp,1,5);             //>> "Soldier Name"
    fnames[i] := temp;            //>> Saved into the array
    temp := fnames[i]+' ST:'+IntToStr(stamina[i]);
    Figure.Name := temp;
    end;
  end else
  begin
   death := 0;
   for i := 0 to count do      //Stamina modification
   begin
    Figure := Figures.GetEnemy(i-death);  //if stats are from dead soldier
    temp := Figure.Name;                  //soldier will be tested again(and again..)
    Delete(temp,1,5); //[XY]_ Removed
    len := Length(temp) - Length(fnames[i]);  //Length of added string (" SP:XX")
    Delete(temp,Length(fnames[i])+1,len);     //Clear added from temp
    if (temp = fnames[i]) then                //Test
    begin
    st := (stamina[i] - 5) * 3;                 //1 stamina = 3 TU
    Figure.TimeUnits := Figure.MaxTimeUnits + st;
    Figure.Name := fnames[i]+' ST:'+IntToStr(stamina[i]);
    end else death := death +1;            //if stats are from dead soldier
   end;
  end;
end;

procedure StartMission1;
begin
  firstset := false;
  register_special_event(@StaminaUse, EVENT_SPECIAL_ONNEWPLAYERROUND);
  register_special_event(@StaminaChange, EVENT_SPECIAL_ONNEWALIENROUND);
end;

begin

end.

It just need to be "used" in all scripts with maps and with reseting the firstset in EVENT_ONGROUNDFINISHED
Now I can continue on my work, I will write if I need another help.
verfasst am: 04.12.2011, 19:44 · Edited by: Kamor
Registrierdatum: 20.07.2005, 00:01

 Beiträge: 203
Nice, you could also think about giving each soldier a personalscript.

Instead of one script, which handles your arrays and must react on dying soldiers, you can launch on groundmissionstart one script for each soldier. If a soldier dies there, his personal script will automatical die to. You dont need then the names to identify dead soldiers. In this personal scripts you can change your arrays to a single soldier stamina value. This is only for you to see another way, perhaps interesting for you for future scripts.
verfasst am: 04.12.2011, 20:07
Registrierdatum: 27.11.2011, 18:08

 Beiträge: 20
Maybe I will try to use that another way anytime, but now I am happy that it is wokring. I can now easily replicate the script, change in it some speciffic conditions for different missions.
For example
In the cave will be soldiers sight reduced,
in the swamp they will not recover stamina,
in poisoned area they will loose health randomly...a lot of ideas are now possible.
I am planning to add maximum stamina count modified by type of armor. But at first I should make more maps for ground misssions.
verfasst am: 12.12.2011, 21:42
Registrierdatum: 27.11.2011, 18:08

 Beiträge: 20
Progress report - I am now learning Blender 2.6 for making new UFOpedia images. I learned the basics actually, tutorials in youtube are really good.
Otherwise I am using Photoshop CS3. I want nice images in my gameset. It will take some time, but I will try my best.
verfasst am: 13.12.2011, 16:41
Grafiker

Registrierdatum: 06.03.2005, 16:04

 Beiträge: 460
Yes, Youtube -> big help.
Many People looking for good pictures, gamesets, tiles, ufopedia - needed all.
I link some new *.blend in future - easy setup your blender (different setups for groundtiles, object-tiles ...) to speed up your creating of pics.
watch this thread Thread

Keep in mind, background = pink (rgb 255,0,255), AntiAliasing = off or you must work hard with Photoshop to fix the pictures.

Good Luck !

Seite: 1 [2] >>




Du musst dich registrieren um auf dieses Thema zu antworten.
Login :: » Name » Passwort

Ladezeit (sec.): 0.021 · Powered by miniBB 1.6 with parts of 1.7 © 2001-2003