Home   Help Search Login Register  

Author Topic: Fwatch 1.13 for CWA in action  (Read 7355 times)

0 Members and 1 Guest are viewing this topic.

Offline SoldierEPilot

  • Members
  • *
Re: Fwatch 1.13 for CWA in action
« Reply #15 on: 31 Jan 2015, 17:55:41 »
@Faguss is right. It's strange, but "forEach" actualy can resize argument length  "on the fly".

About current mission path search - I working on it, beta version probably will be posted next week.

Offline SoldierEPilot

  • Members
  • *
Re: Fwatch 1.13 for CWA in action
« Reply #16 on: 08 Feb 2015, 14:03:22 »
Problem with ":exe unpbo" implementation.

This code works in OFP 1.96 just fine:
Code: [Select]
ok = call loadFile ":exe unpbo -F mission.sqm Missions\01takethecar.abel.pbo"
I have used the same test missionette and the same "takethecar" mission in CWA.
Still no error info (ok select 0 is "true"), but 0 files were unpacked to ..\fwatch\tmp  >:(
Any ideas?

Offline faguss

  • Members
  • *
    • Faguss' Website
Re: Fwatch 1.13 for CWA in action
« Reply #17 on: 08 Feb 2015, 18:58:38 »
Fixed. Redownload.

For unpacking please use the code I've posted instead of coming up with your own. I've added example mission to the archive.
« Last Edit: 08 Feb 2015, 19:02:54 by faguss »

Offline SoldierEPilot

  • Members
  • *
Re: Fwatch 1.13 for CWA in action
« Reply #18 on: 14 Feb 2015, 14:42:29 »
I trying to unpbo campaign with spaces in the name -  "test campaign (packed).pbo".
It can be either in ..\Campaigns or in ..\@experimental\Campaigns.
As I understand properly, stringification needed here, but I can't make it work anyhow.

@Faguss, could u show, how to unpbo campaign with stringification?


Offline faguss

  • Members
  • *
    • Faguss' Website
Re: Fwatch 1.13 for CWA in action
« Reply #19 on: 14 Feb 2015, 16:30:38 »
Fixed. Redownload. Added second example.

Unpacking original campaign on my older computer takes 25 seconds but if you specify the file then only 5 seconds. Interestingly extractpbo.exe doesn't care for internal paths and will extract all mission.sqm from all subdirectories.
« Last Edit: 14 Feb 2015, 18:34:50 by faguss »

Offline Wiineri

  • Members
  • *
Re: Fwatch 1.13 for CWA in action
« Reply #20 on: 15 Mar 2015, 18:00:37 »
To check if currently running an instance of the actual mission or a cutscene (intro, outro win or outro loose):

Code: [Select]
if (format["%1", player] == "<NULL-object>")
then
{
    // Cutscene
}
else
{
    // Mission
};

This unfortunately doesn't determine if the cutscene is intro or one of the outros. Properties of the intro and the outros (start time for example) could be compared to that of the current instance using ':class token', but that won't work if the compared properties are exactly the same in different cutscenes.

For the mod that I'm developing, I was able to determine reliably if the user is playing a single mission or a campaign, and if the user is in SP mission editor or playing in MP, by adding additional actions to menu buttons in the mod's resource.cpp file. For instance, when user clicks the 'Mission Editor' button, a script opens and calls fwatch to write this into a file: "MissionEditor=1". Then the script checks if player presses 'ESC' or clicks the 'Cancel' button. If that happens, it writes: "MissionEditor=0". Same thing is done to 'Single Missions' and 'Campaigns' folders. That file is then read in-game to check what the user is playing.

I'm still using Fwatch 1.13, will move to 1.14 when it is completed. I have created an external launcher for my mod, which extracts mission.sqm files from single missions, mp missions and campaigns to a folder, from which they can be easily accessed without knowing the exact path to the actual mission in-game.

Offline SoldierEPilot

  • Members
  • *
Re: Fwatch 1.13 for CWA in action
« Reply #21 on: 23 Mar 2015, 18:20:10 »
To @Wiineri: glad to see someone else works in this field.
And I don't thought about cut-scene problem before.
Keep going man!

///////////////////////////////////////////////////////////////////

I have a dream...to parse SQF code and to interpret it like CSharp-like OOP language :hmmm:
2 functions to be developed:

1) OOP_Create: define new class with props, default values and methods.
All objects are arrays with "type" (0th element == case-sensitive class name)
Object itself is always  mentioned as 0th argument in all methods.
Methods and props are stored in "parallel" global arrays with class types array.

For example: lets suppose I already created 2 classes:

OOP_Types array: ["Line","Circle"]
OOP_Props array:
[
   ["start","end"],
   ["centre","radius"]
]

OOP_MethodNames array:
[
   ["Angle","CheckDotSide","Rotate","Shift"],
   ["Rotate","Shift","Area","HasPoint","IntersLine"]
]

OOP_Methods array:
[
   ["code3","code4","code5","code6"],
   ["code7","code8","code9","code10","code11"]
]

Code: [Select]
_sh={
private["_p", "_x", "_y"];
_p=_this select 0;
_x=_this select 1;
_y=_this select 2;
_p set [1, _x+(_this select 1)];
_p set [2, _y+(_this select 2)];
};

Creating another one:
Code: [Select]
"Point(x,y): {x=0, y=0, Shift(a,b)=_sh}" call OOP_Create;
So now:

OOP_Types: ["Line","Circle","Point"]
OOP_Props:
[
   ["start", "end"],
   ["centre", "radius"],
   ["x", "y"]
]

OOP_MethodNames:
[
   ["Angle","CheckDotSide","Rotate","Shift"],
   ["Rotate","Shift","Area","HasPoint","IntersLine"],
   ["Shift"]
]

OOP_Methods:
[
   ["code3","code4","code5","code6"],
   ["code7","code8","code9","code10","code11"],
   [_sh]
]

2) OOP_Run: actions with created instances.
"()" brackets and word "new" are reserved 4 correct interpretation

Code: [Select]
{
_p=new Point (2000, 3000);     
_p.Shift(100,-200) ; 
} call OOP_Run;

Bad: Fwatch character number limitations + speed lost on "interpretation"
Good: nothing wrong happens if we will use OOP_Run for shorter "OOP-code" sets.

Like that:
Code: [Select]
{_such_a_big_point=new Point (2000, 3000)} call OOP_Run;   
{_such_a_big_point.Shift(100,-200)} call OOP_Run;

This code must return: ["Point", 2100, 2800]
Code: [Select]
hint format["Point: %1", _such_a_big_point];
//////////////////////////////////////////////////

Any ideas, propositions, wishes, warnings, critical notes?

Offline faguss

  • Members
  • *
    • Faguss' Website
Re: Fwatch 1.13 for CWA in action
« Reply #22 on: 16 Apr 2015, 02:52:02 »
I was able to implement mission type detection internally. Updated files under the same link. Here's an example:

Code: [Select]
_id = call loadfile "..\fwatch\data\path.sqf"
? _id==0 : hint "MP Mission Editor"
? _id==1 : hint "MP PBO"
? _id==2 : hint "MP folder"
? _id==3 : hint "SP Mission Editor unsaved"
? _id==4 : hint "SP Mission Editor"
? _id==5 : hint "SP PBO"
? _id==6 : hint "SP folder"
? _id==7 : hint "Campaign"

Quote
intro, outro win or outro loose

I was unsuccessful in finding a way (through Fwatch) to distinguish between those.

Quote
critical notes

I don't see the point. You're still limited by OFP scripting language.
« Last Edit: 16 Apr 2015, 02:55:41 by faguss »