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 - general discussions —› Please help to solve errors in X-scripts

Autor Mitteilung
verfasst am: 05.07.2008, 11:50
Programming

Registrierdatum: 01.07.2008, 07:53

 Beiträge: 109
Good day, all.
I tried to make simple X-script and obtain a strange error:

program IncResTime;
procedure StartMission;
var
  Project : TResearchProject;
  PrID : LongWord;
begin
    PrID:=1561985023;
    science_api_ActivateProject(PrID);
    Project:=science_api_GetProjectByID(PrID);
    game_api_messagebox(Project.Name);
end;

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


As default, MEdit used galwar.pak and default.pak
I take ID from default.pak

If PrID:= 2916937537 (Nickel Alphatron Accu) - "Projekt mit ID -1378029759 nicht gefunden" (Project not found?)
If PrID:= 1561985023 (Tscharkow 7.62 Uranium) - "Projekt mit ID 1561985023 nicht gefunden"
(anytime if PrID > 2147483647 it wrote a strange negative number (7FFFFFFF, signed/unsigned longword error?))

And on any PrID if cut "science_api_ActivateProject(PrID);"
it write "Assertion fehlges H:XF-Quellcode..apiforsch_api.pas, Zeile 324" (???)

If i use "...GetByIndex()" all work correct, but i don't now indexes.

Now i can't access to any ..._api_Get...ByID() without similar errors (on version >0910). Tried 0911,0912,0912f02,0915a2 on two computer (Win98 and winXP)

Please help understood, what i do wrong?

Thanks in advise
verfasst am: 05.07.2008, 12:43
Spielsatz Darkage

Registrierdatum: 01.03.2005, 13:47

 Beiträge: 1846
Zitat: gnfalex
As default, MEdit used galwar.pak and default.pak

Only one is used at a time. You have to change the standard to default.pak (possibly in medit AND edit)

"nicht gefunden" means "not found", yes.

try it with science_api_ActivateProject(2916937537);
verfasst am: 06.07.2008, 18:10
Programming

Registrierdatum: 01.07.2008, 07:53

 Beiträge: 109
Thanks, LennStar.
Sorry i didn't see this option :-( I take look into file activity and see access to two modpack. I think that they both is loading.

Now in 0912 all work fine but in 0915 same script show error :
"Laufzeitfehler in Zeile 9 aufgetreten:
Zugriffsverletzung bei Adresse 00404F26 in Modul 'MEDIT.EXE'. Lesen von Adresse ... (changing value, 3 examples: 8CFFFFF8 ; 5A5FFFF8 ; 5CC33F4)"

In game script work normally.

Great thanks for help
verfasst am: 06.07.2008, 20:29
Programmierer

Registrierdatum: 23.08.2003, 19:16

 Beiträge: 2261
Zitat: gnfalex
Now in 0912 all work fine but in 0915 same script show error :
Please open a ticket in Bug-Tracker attach the complete script. thx.
verfasst am: 10.07.2008, 10:15
Programming

Registrierdatum: 01.07.2008, 07:53

 Beiträge: 109
Respects
I post this problem [bug]http://bugs.xforce-online.de/view.php?id=1960[/bug]. Sorry for mistake.

Question: is exist way to change project propeties "on fly" i.e. via X-Script during game? I find only science_api_ChangeActiveState().

Thanks
verfasst am: 10.07.2008, 12:28
Programmierer, allgemeines

Registrierdatum: 06.06.2004, 17:19

 Beiträge: 3186
Zitat: gnfalex


Question: is exist way to change project propeties "on fly" i.e. via X-Script during game? I find only science_api_ChangeActiveState().

Sorry, thats all you can do for now. But it is planed more for comming versions.
verfasst am: 24.07.2008, 12:09
Programming

Registrierdatum: 01.07.2008, 07:53

 Beiträge: 109
Greetings.

Stupid question: why in script
program YourName;
procedure StartMission;
 var
  Target:TFloatPoint;
begin
  Target:=floatpoint(25,25);
  Target.x:=((random(100)-50)/50)+Target.x;
  Target.y:=Target.y+((random(100)-50)/50);
  game_api_messagebox('X:'+floattostr(Target.x)+'  Y:'+floattostr(Target.y));
end;
begin
  MissionName := 'YourName';
  MissionType := mzObjects;
end.



Target.x is changing beetwin 24 and 26, but Target.y is still 25?


And second question... Did anyone see that if alien got granates, he does't got armor? I.E. on corpses may be only or granates or armor? This is happened in version =>0912... But I don't now, that is in mod properties or in game...

Thanks.
verfasst am: 24.07.2008, 15:47
Spielsatz Darkage

Registrierdatum: 01.03.2005, 13:47

 Beiträge: 1846
Zitat: gnfalex
Target.x is changing beetwin 24 and 26, but Target.y is still 25?

rounding?
You say, it must get a number between -1 and 1, and perhaps for x you first decide the number (and so have one even if its 0,02) and for y you have one and than change it (and only in 2/100 cases you change the number because of the 0,xx)
Try it with switched x and y. If I'm right, that will switsch, too.

2.Q: armors can be made undroppable. If there is anything grenades/armor I cant tell.
verfasst am: 24.07.2008, 17:45
Programming

Registrierdatum: 01.07.2008, 07:53

 Beiträge: 109
Thanks, LennStar

1. No, not rounding. It use "double" not "int"/ And value can be 24,48 for example.
Problem that a+b and b+a give a different results (where a='((random(100)-50)/50)' and b='Target'). Target.x and y is examples. 'a+random=a', but 'random+a'='random+a' I can't understood this.



2. I check this in first place :-( i create a testmod and bugreport 1970
verfasst am: 24.07.2008, 19:42
Programmierer

Registrierdatum: 23.08.2003, 19:16

 Beiträge: 2261
It seems to be a bug in script engine.

Target.y:=((random(100)-50)/50)+Target.y;


works correct.

I posted 1971
verfasst am: 24.07.2008, 21:00 · Edited by: LennStar
Spielsatz Darkage

Registrierdatum: 01.03.2005, 13:47

 Beiträge: 1846
@gnfalex: 1971 solved for 0915a3
verfasst am: 24.07.2008, 21:19
Admin, Spielsatz GalWar

Registrierdatum: 31.08.2005, 21:51

 Beiträge: 5596
no, it's solved for 915a4 which is not yet online (and probably won't be for some time)



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

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