Qhimm.com Forums

Project forums => Q-Gears => Topic started by: Tom on 2014-11-15 07:39:08

Title: Q-Gears Field Module - Midgar Conversion Project [Replaced by Finishing Touch]
Post by: Tom on 2014-11-15 07:39:08
When I first downloaded Q-Gears 0.21 I was slightly disappointed that only the first 3 fields are playable, so I'm converting ff7 fields to Q-Gears fields so theres more to do in Q-Gears other than run around the train station and the bombing mission starting fields.

New Notice: The replacement project for this is Finishing Touch which you can find here: http://forums.qhimm.com/index.php?topic=16211.msg229368#msg229368
You can even download whatever progress is made and play it yourself, not just look at screenshots I upload :)

Notice: This project has been abandoned in favor of SUDM, the automatic Field Script decompiler you can find here:https://github.com/paulsapps/SUDM (https://github.com/paulsapps/SUDM) If you want to see the fields that were done up to this point you should download the Q-Gears repository and it will be in the output folder.  (Or download the q-gears-data repository and find them in maps/ffvii/ )

=[ Conversion Progress ]=
(Debug Room) startmap: Complete!
md1stin: Q-Gears
md1_1: Q-Gears
md1_2: Q-Gears
nrthmk: Complete!
nmkin_1: Imported, partial scripts
elevtr1: Complete!
nmkin_2: Complete!
nmkin_3: Imported, partial scripts
nmkin_4: Imported, no scripts
nmkin_5: Imported, no scripts
tin_3: Imported, no scripts


Here is what I got so far:
Images are 5000KB bitmaps so you might have to wait a while if you are on a slow line.
Start menu with shortcuts to the new fields
(http://i.imgur.com/hOQEwKd.png)
North Mako Reactor outside
(http://i.imgur.com/5ondmL4.png)
Now were inside the reactor, without even having to hack the gate codes.
(http://i.imgur.com/w9VyJ1c.png)
Looks like Cloud and Barret are stuck in the elevator!
(http://i.imgur.com/VXNhN84.png)
Cloud and Jessie head deeper into the reactor!
(http://i.imgur.com/SnHp2bp.png)
The train leaves at 00:00 Midgar Standard Time!
(http://i.imgur.com/NQfdhCT.png)

I hear you asking, how do we get these fields ingame!?
You can get them by downloading the github q-gears and compiling it.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2014-11-15 13:25:36
Quote
The hardest part in converting the fields is getting the field scripts to work.  Having slight trouble with the elevator scene because I do not know how to get the cloud model that has the elevator slam button animation working.  Any help would be appreciated  :)

Scripts exporting is a bit tricky because you need a bit of manual work to do it. In existed field files I already rename a lot of things to increase readability.

1) Scripts exported to text file (md1_1_script.txt)

There you will find raw script to lua conversion. Most of implemented functions ready to use when they converted. Others need to be reworked.



2) You need to cteate entity layout manually.

EntityContainer = {}

EntityContainer[ "entity_name_goes_here" ] = {
}

After export you get original entity name. They are abbreviated and may be different in different fields though they represent same model. That's why I renamed them.

Code: [Select]
cl
script_0:

became

Code: [Select]
EntityContainer[ "Cloud" ] = {


3)  First script ("script_0:")

In ffvii first script has two parts: initial and normal.

Code: [Select]
cl
script_0:
0441 (end 0441): -- assosiate entity with model (CHAR) argument doesn't matter
0443 (end 0443): set_entity_to_character( "cl", 0 );
0445 (end 0445): return
0446 (end 0446): cl:set_move_speed( 1.875 )
044a (end 044a): jumpto( 044a );

Everything before first return is initial script.

In qgears this is "on_start" script.

We need to initialize model for entity in qgears

Code: [Select]
        set_entity_to_character( "Cloud", "Cloud" )
        self.cloud = entity_manager:get_entity( "Cloud" )

In ffvii this is done with PC opcode wich translates to

Code: [Select]
0441 (end 0441): -- assosiate entity with model (CHAR) argument doesn't matter
0443 (end 0443): set_entity_to_character( "cl", 0 );

set_entity_to_character  is located in output\data\scripts\ffvii\field.lua

Code: [Select]
set_entity_to_character = function( entity_name, character_name )
    if character_name == FFVII.Party[ 1 ] and entity_name ~= "" then
        if System.MapChanger.point_name ~= "" then
            local point = entity_manager:get_entity_point( System.MapChanger.point_name )
            if point ~= nil then
                local x, y, z = point:get_position()
                local rotation = point:get_rotation()
                local player = entity_manager:get_entity( entity_name )
                player:set_position( x, y, z )
                player:set_rotation( rotation )
                player:set_solid( true )
                player:set_visible( true )
            end
        end

        entity_manager:set_player_entity( entity_name )
    end
end

It do basicly tha same thing that PC opcode do.

Next is self.cloud = entity_manager:get_entity( "Cloud" )

This finds entity with name Cloud which described in XML file and store referensce to it in local variable to get access to it.



That\s all for now. Try to look at exported script and existed script files to understand how it works. I can add more later.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: LeonhartGR on 2014-11-15 13:51:51
Keep it up folks! Thanks for the devotion in this project!
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2014-11-15 14:44:25
Is there some sort of reference that describes all the field commands and what their arguments/parameters are?
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2014-11-15 15:25:23
Is there some sort of reference that describes all the field commands and what their arguments/parameters are?

https://github.com/q-gears/q-gears-data/blob/master/documents/script_commands.ods

but this is for v0.20

All real methods for current version are here https://github.com/q-gears/q-gears/blob/master/QGearsMain/include/core/ScriptManagerBinds.h
sadly without comments.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2014-11-16 07:50:26
Is it possible to have entities on the field without models? I need to make a entity "ele" to use as an elevator button so when you press [OK] you activate the elevator push script.

If its not possible then Ill probably add a Shinra Guard as an elevator operator that you talk to and tell him to take you to the floors.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2014-11-16 08:16:55
Is it possible to have entities on the field without models? I need to make a entity "ele" to use as an elevator button so when you press [OK] you activate the elevator push script.

If its not possible then Ill probably add a Shinra Guard as an elevator operator that you talk to and tell him to take you to the floors.

In xml:
Code: [Select]
<entity_script name="Elevator" />
In lua;
Code: [Select]
EntityContainer[ "Elevator" ] = {
    on_start = function( self )
        return 0
    end,
}

Done. You can see entity Director in md1_1 as reference of entity script.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2014-11-16 10:12:53
Thanks,  how do I set it up to react to a button press at certain coordinates?  I have tried using on_talk but thats not working,  the original script checks if button [OK] is pressed once but I don't know which button [OK] is in Q-Gears I would guess its shift. However you never have to use [OK] in Q-Gears because there are no texts and the scene where Biggs asks you to say your name is done using walkmesh triangles.

Fixed some problems by downloading the latest Q-Gears source and compiling it. Q-Gears v0.23 (5th cool guys choose to fight)
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2014-11-16 17:33:22
Thanks,  how do I set it up to react to a button press at certain coordinates?  I have tried using on_talk but thats not working,  the original script checks if button [OK] is pressed once but I don't know which button [OK] is in Q-Gears I would guess its shift. However you never have to use [OK] in Q-Gears because there are no texts and the scene where Biggs asks you to say your name is done using walkmesh triangles.

Fixed some problems by downloading the latest Q-Gears source and compiling it. Q-Gears v0.23 (5th cool guys choose to fight)

There is an event called "on_button"

Code: [Select]
on_button = function( self, button, event )
You can find examples in main menu. It catches this buttons: Enter, Escape, Space, LCtrl, Left, Up, Down, Right.
Normally it's bad idea to use buttons directly, so you can create some bind list to associate actions with keys.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2014-11-16 17:41:08
Thanks, the elevator scene now works properly.  However since I upgraded to the newest Q-Gears I can no longer make shortcuts on the main menu that take me to fields, whenever I skip the opening scene I am unable to move in the fields. My coordinates are setup right
I have added these in the begin_menu and changed the corresponding files and all worked fine in 0.21 but in 0.23 it teleports me to the field but I am unable to move.  I get no walkmesh errors in the console and the player isn't locked, what could be causing this?
Code: [Select]
                elseif self.position == 6 then
                    load_field_map_request( "ffvii_nmkin_1", "" )
                    console( "camera_free false" )
                    console( "debug_walkmesh false" )
                    script:request_end_sync( Script.UI, "BeginMenu", "hide", 0 )
                    FFVII.MenuSettings.pause_available = true
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2014-11-16 18:36:24
Thanks, the elevator scene now works properly.  However since I upgraded to the newest Q-Gears I can no longer make shortcuts on the main menu that take me to fields, whenever I skip the opening scene I am unable to move in the fields. My coordinates are setup right
I have added these in the begin_menu and changed the corresponding files and all worked fine in 0.21 but in 0.23 it teleports me to the field but I am unable to move.  I get no walkmesh errors in the console and the player isn't locked, what could be causing this?
Code: [Select]
                elseif self.position == 6 then
                    load_field_map_request( "ffvii_nmkin_1", "" )
                    console( "camera_free false" )
                    console( "debug_walkmesh false" )
                    script:request_end_sync( Script.UI, "BeginMenu", "hide", 0 )
                    FFVII.MenuSettings.pause_available = true

What is version 0.23? Where can I find it?
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: KnifeTheSky77 on 2014-11-16 18:40:25
Is this where you pulled your source from? I believe this is the latest efforts

https://github.com/q-gears/q-gears (https://github.com/q-gears/q-gears)

Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2014-11-16 19:04:54
0.23 is the one with the latest commits, https://github.com/q-gears/q-gears/
It has battle 300 partially setup with the MP1 and MP2 entities
0.21 does not have any battles
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2014-11-17 16:45:35
nrthmk is now fully implemented, with all its scripts and functions!
Avalance runs into the reactor and Wedge ensures there is an escape route once the bomb is set!
(http://i.imgur.com/uePEHh6.png)

Ill make a list at the top post showing what fields have been loaded and what has been implemented.
I have been wondering for a while if we could have a countdown function, so when you set the bomb you have 10 minutes to get out.
Does field:lock_walkmesh( 37, true ); exist? It doesnt seem to work

Also, how do I set variables?  Like for storing the position of the elevator or for the activation of certain scripts?
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2014-11-17 18:44:16
Also, does field:lock_walkmesh( 37, true ); exist? It doesnt seem to work

Sadly this function not exported to Lua.


Add this to ScriptManagerCommands.h

Code: [Select]
    // walkmesh access
    luabind::module( m_LuaState )
    [
        luabind::class_< Walkmesh >( "Walkmesh" )
            .def( "lock_walkmesh", ( void( Walkmesh ::* )( unsigned int, bool ) ) &Walkmesh ::LockWalkmesh)
            .def( "is_locked", ( bool( Walkmesh ::* )( unsigned int ) ) &Walkmesh ::IsLocked)
    ];





    luabind::globals( m_LuaState )[ "walkmesh" ] = boost::ref( *( EntityManager::getSingletonPtr()->GetWalkmesh() ) );



Quote
Also, how do I set variables?  Like for storing the position of the elevator or for the activation of certain scripts?

You need to store it anywhere in lua where you want )
Luastate is not reloaded after map load. Only entity container reloaded. I created file output\data\scripts\ffvii\data.lua for all this variables.
You can store there like this FFVII.Data.progress_game = 7
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: WolfMan on 2014-11-17 19:04:35
Tom and Akari. I am extremely impressed with your knowledge and abilities. I really need to sit down and understand this project. I really am in the dark on what Q-Gears is.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: meesbaker on 2014-11-18 01:10:20
Tom and Akari. I am extremely impressed with your knowledge and abilities. I really need to sit down and understand this project. I really am in the dark on what Q-Gears is.

I also find this extremely impressive! As far as I understand it qgears is a selfmade executable that will run ff7 from the extracted files found on the psx ISO. That eliminates the need to play some pc port or using an emulator. Just extracting all the files, scripts, models and fields and qgears runs it like a pro ;)

At least that is the target and the progress seems very good so far. Keep it up guys :)
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: LeonhartGR on 2014-11-18 02:10:00
Smash the like button!
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: KnifeTheSky77 on 2014-11-18 02:29:55
Qgears is getting lonely Akari, please give it some love  :) :)

Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: WolfMan on 2014-11-18 12:44:50
Will it eventually be able to use mods? You can't import models into psx from my understanding.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2014-11-18 13:45:18
Figured out how to add Walkmesh management, turns out it wasn't ScriptManagerCommands.h but ScriptManagerBinds.h.  Now working on nmkin_1 field and will start nmkin_2
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paralleluniverse on 2014-11-18 17:52:13
This is pretty neat, lots of information in this topic :D
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2014-11-18 18:45:26
Akari, is it currently possible to easily show text on screen?  Like the dialogue ingame like: [Barret] Yo! Is this your first time in a reactor?
Actually I need the on_talk script to work, for biggs deciphering the codes on the doors when you talk to him.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2014-11-19 15:31:56
I add support for "on_interact" callback for entity-s and line triggers.
Could you compile changes and send me back? I don't have compiler here to do it myself. I can add dialog support but it will take a while.

http://vk.com/doc7350946_343148641
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: sithlord48 on 2014-11-19 20:42:58
additions to the source should be happening on the github repo. Do these new src files replace the exsisting copies. i can do that for you . if you dont have a github you should create one and ill add you to the project.

i have been a tad busy lately with stuff so i have been a bit slacking on my q-gears duty (sorry).
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: KnifeTheSky77 on 2014-11-20 04:17:36
Dialogue support would be pretty amazing, for some reason I thought most of that was already implemented in field
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2014-11-20 10:57:43
Dialogue support would be pretty amazing, for some reason I thought most of that was already implemented in field

It was implemented in 0.17 but after second complete rewritting of engine it is gone. I add it to current version as soon as i can.

By the way i believe current version should be 0.22. Last one I release was 0.21 and i see no release since then
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2014-11-20 19:41:36
Do you just want the q-gears.exe the compiler gives out or do you want the dll files too?  I don't know whats wrong but when I copy the q-gears I compiled to another computer it refuses to run with dll missing errors.  Works fine on my computer and the 0.21 you released works on all computers, what am I missing?

Progress on nmkin_1, its a very hard scene with complex code, 500+ lines are required to make it work.  Ive converted all the code to lua and now renaming stuff and trying to reverse what the variables do because alot of them are used in this scene

Cloud and Jessie during the bombing mission
(http://i.imgur.com/oW4USYF.png)

Apparently Cloud got into some Shinra loot!
(http://i.imgur.com/hV46aWB.png)

Heres a download of the entire build folder (350MB) http://www.mediafire.com/download/459z8x8zr4rkz0g/q-gears-build.zip
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2014-11-21 12:13:08
Are you making these changes from the github repo? If not then you might find you need to do a lot of reworking due to changes in the version you have.

Also the best course of action is to update the loaders so that the fields/scripts can be automagically loaded by qgears rather than needing manual edits/conversions.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2014-11-21 15:08:44
We don't want/need q-gears to load the proprietary/hard to use final fantasy field format.  We want them converted to lua which is a much better system overall.  Q-Gears will be used with non final fantasy data too
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2014-11-21 17:09:10
Yes but the conversion of FF data to QGears should not mean manually porting the scripts over by hand. Also the FF format loader should just convert to QGears LUA and load that internally.

The QGears format is only really useful for modding or optimizing the load times (since the game is so old this doesn't really matter at all at the moment, I can load the entire world map and get 1000fps).

P.S Are you in the irc channel? The constant down time on this forum is EXTREMELY annoying :@ :(
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: KnifeTheSky77 on 2014-11-21 18:33:34
How difficult would it be to get fields+battle running at 60fps, or 1000, whichever looks better :evil:
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2014-11-21 21:35:47
Oh, I was gettting an error on compile but wasn't noticing because the compiler window automatically closed once it was finished.  When I ran it from cmd.exe heres what I got:
Code: [Select]
qgears source is in: C:\QGEARS\q-gears-code\code
building with mingw
C:\QGEARS\q-gears-code\code\QGearsMain\src\core\Entity.cpp:1:20: fatal error: En
tity.h: No such file or directory
 #include "Entity.h"
                    ^
compilation terminated.
mingw32-make[2]: *** [QGearsMain/CMakeFiles/QGearsMain.dir/src/core/Entity.cpp.o
bj] Error 1
mingw32-make[1]: *** [QGearsMain/CMakeFiles/QGearsMain.dir/all] Error 2
mingw32-make: *** [all] Error 2
C:\QGEARS\q-gears-code\code\QGearsMain\src\core\Entity.cpp:1:20: fatal error: En
tity.h: No such file or directory
 #include "Entity.h"
                    ^
compilation terminated.
mingw32-make[2]: *** [QGearsMain/CMakeFiles/QGearsMain.dir/src/core/Entity.cpp.o
bj] Error 1
mingw32-make[1]: *** [QGearsMain/CMakeFiles/QGearsMain.dir/all] Error 2
mingw32-make: *** [all] Error 2

Entity.h actually does exist in C:\QGEARS\q-gears-code\code\QGearsMain\include\core
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2014-11-21 22:11:53
Oh, I was gettting an error on compile but wasn't noticing because the compiler window automatically closed once it was finished.  When I ran it from cmd.exe heres what I got:
Code: [Select]
qgears source is in: C:\QGEARS\q-gears-code\code
building with mingw
C:\QGEARS\q-gears-code\code\QGearsMain\src\core\Entity.cpp:1:20: fatal error: En
tity.h: No such file or directory
 #include "Entity.h"
                    ^
compilation terminated.
mingw32-make[2]: *** [QGearsMain/CMakeFiles/QGearsMain.dir/src/core/Entity.cpp.o
bj] Error 1
mingw32-make[1]: *** [QGearsMain/CMakeFiles/QGearsMain.dir/all] Error 2
mingw32-make: *** [all] Error 2
C:\QGEARS\q-gears-code\code\QGearsMain\src\core\Entity.cpp:1:20: fatal error: En
tity.h: No such file or directory
 #include "Entity.h"
                    ^
compilation terminated.
mingw32-make[2]: *** [QGearsMain/CMakeFiles/QGearsMain.dir/src/core/Entity.cpp.o
bj] Error 1
mingw32-make[1]: *** [QGearsMain/CMakeFiles/QGearsMain.dir/all] Error 2
mingw32-make: *** [all] Error 2

Entity.h actually does exist in C:\QGEARS\q-gears-code\code\QGearsMain\include\core

What generator did cmake use?

How difficult would it be to get fields+battle running at 60fps, or 1000, whichever looks better :evil:

Battle is a long way from working at all, field runs at 300fps on my computer. Field is far from optimized for speed though, but then again at 300fps it doesn't really need optimizing.

Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2014-11-22 07:52:10
EDIT: I got it all working with Ubuntu and the new build instructions at the qgears github page, go there if you are wondering how to build


Also KnifeTheSky77
It already runs as 1000 fps for me
(http://i.imgur.com/CFp5f6V.png)
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2014-11-28 10:13:11
Add basic dialog support for simple text dialogs (no styling or questions). Few more days to support all FFVII dialog features. It will work like in v0.17 with minimal changes. You can look syntaxis there. Stay tuned =)

Next I add ingame bindings (normal bindings works already for long time).

Do you need something ekse like fade to make all bombing mission work?
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: KnifeTheSky77 on 2014-11-28 17:01:06
That's awesome akari, have you been keeping up with the changes on github? I think battles remain pretty uncharted territory
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2014-11-29 12:45:41
Add basic dialog support for simple text dialogs (no styling or questions). Few more days to support all FFVII dialog features. It will work like in v0.17 with minimal changes. You can look syntaxis there. Stay tuned =)

Next I add ingame bindings (normal bindings works already for long time).

Do you need something ekse like fade to make all bombing mission work?

Awesome make a fork from https://github.com/q-gears/q-gears and create a pull request, I'll merge your changes in :).
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2014-11-29 22:19:27
The last part of the bombing mission is the countdown clock with the purple digits :D
I finished nmkin_2 and now working on nmkin_3 and ladders.  I have the original field command documentation but its a bit outdated, what would the equivalent of climb_to_position(const float x, const float y, const float z, const int triangle_id, const ClimbMovement climb_movement) be in 0.22 qgears.  I don't see that command in the ScriptManagerBinds file.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2014-11-30 06:04:52
The last part of the bombing mission is the countdown clock with the purple digits :D
I finished nmkin_2 and now working on nmkin_3 and ladders.  I have the original field command documentation but its a bit outdated, what would the equivalent of climb_to_position(const float x, const float y, const float z, const int triangle_id, const ClimbMovement climb_movement) be in 0.22 qgears.  I don't see that command in the ScriptManagerBinds file.

Code: [Select]
                -- move to up platform 1
                player:set_rotation( 180 )
                player:linear_to_position( -2, 3.5, 3, Entity.DOWN_TO_UP, "Climb" )
                player:linear_sync()

You can  look at the text_2.lua. This is testing ground for all ffvii movements.

Reverse FFVII dialogs render a bit and found few errors I didn't fix earlier about opening and closing dialog windows.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2014-12-01 17:52:45
Don't forget to send pull request so I can put it into main github repo :)
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2014-12-09 14:44:25
2014-12-09
----------
+ [Input] Add "bind_game_event" input command to create ingame command bindings. [Akari]
* [Entity] Entity now uses ingame bindings instead of button hardcode. [Akari]

2014-12-05
----------
+ [Dialogs] Add "hide" method to messages. [Akari]
+ [Dialogs] Add variables to text via "set_variable" method. [Akari]
+ [UI] Add variable support to textarea element. [Akari]
+ [UI] Add pause_ok and time pause to textarea. [Akari]

2014-12-02
----------
+ [UI] Add posibility to set animation keyframe time in percent. [Akari]

2014-12-01
----------
+ [Dialogs] Add base window with text. [Akari]
+ [UI] Add overflow, next page and related states. [Akari]
+ [UI] Add feature of printing text in textarea element. [Akari]
* [UI] Change widget "scissor" parameter to "scissor_area". Add this parameter as animatable. [Akari]



Current ingame bindings in config.cfg
Code: [Select]
bind_game_event Space "message_ok"
bind_game_event Up "message_up"
bind_game_event Down "message_down"

bind_game_event Space "interact"
bind_game_event LCtrl "run"
bind_game_event Up "walk_up"
bind_game_event Right "walk_right"
bind_game_event Down "walk_down"
bind_game_event Left "walk_left"


Test dialog
(http://cs423320.vk.me/u7350946/docs/c04bb7d5be84/2014-12_q-gears_v0_22d_01.jpg)
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2014-12-09 18:13:10
Where is this? Did you put it in the obsolete version of the code? :)

The latest version is here:

https://github.com/q-gears/q-gears

If you fork from this and push changes to your fork you can open a pull request. This then uses Travis-CI to check your changes build etc. This also has Ubuntu PPA that gets built daily too.

The old repos are way different than newest source, I fear it could much extra work to take your changes to the new code base if you're still using the old one?

Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2014-12-10 06:47:13
Where is this? Did you put it in the obsolete version of the code? :)

The latest version is here:

https://github.com/q-gears/q-gears

If you fork from this and push changes to your fork you can open a pull request. This then uses Travis-CI to check your changes build etc. This also has Ubuntu PPA that gets built daily too.

The old repos are way different than newest source, I fear it could much extra work to take your changes to the new code base if you're still using the old one?



I work with my old version without changes I don't like. You can merge it later. It's just few core files.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2014-12-10 17:57:34


I work with my old version without changes I don't like. You can merge it later. It's just few core files.

If you don't do it from a github fork it can't be merged, if you don't like the changes everyone else is making then everyone else might as well stop working on the project.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: KnifeTheSky77 on 2014-12-10 19:54:49
I would argue that a lot of the changes made were necessary in getting the thing to build on everyone's platforms and up to date dependencies like current ogre engine
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2014-12-10 19:56:22
Progress progress!
100% working nmkin_2 (All scripts)
50% working nmkin_3 (Ladders)

Cloud heads deeper into the reactor with Jessie:
(http://i.imgur.com/SnHp2bp.png)
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: zerotacg on 2014-12-11 06:07:44
If you don't do it from a github fork it can't be merged, if you don't like the changes everyone else is making then everyone else might as well stop working on the project.

behold the mighty power of hg-git, that is if akari does a push to the source forge repo [1] which seems to not have the mentioned changes by now

[1] http://sourceforge.net/p/q-gears/code/ci/default/tree/
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2014-12-11 11:42:02
It doesn't change the fact that everyone working on different versions of the code makes no sense. Anyone with a software engineering background knows this is insanity.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: sithlord48 on 2014-12-11 15:12:26
Akari you really should work with us on the github version of the codebase.. its gonna be much harder for us to track your changes. it can get much more complicated when were all working on seperated bases. not to mention the duplication of work and extra time to correctly merge the two code bases.

Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2014-12-12 21:25:17
A little treat  ;)

Hopefully this weekend ill finish some more scripts but for now enjoy the room everyone loves, the debug room :D
(http://i.imgur.com/N4G7rhp.png)

Cloud gets ontop of the pipe in nmkin_2
(http://i.imgur.com/GckKp0F.png)

And unlocks a new area!
(http://i.imgur.com/484068J.png)
Also Akari, hows progress on the Dialogue coming along,  its needed to finish the next fields of the bombing mission.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2014-12-13 15:47:27
I implementing text manager to work with localized dialogs now. After that i hope to add counter and it's done. I will add texts for first 3 location to test how it's work )
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: sithlord48 on 2014-12-13 16:30:14
will you be commiting these changes to our github . if not where can we find them?
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2014-12-13 19:15:59
will you be commiting these changes to our github . if not where can we find them?

I will commit when everything will be finished and tested.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: sithlord48 on 2014-12-14 14:14:15
just pm me your username on github so i can add you to the project team.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2014-12-14 18:40:46
Feel free to PM me too in case hes not online as I'll be able to add you too.

Also I'll explain how we split up the repo recently:

https://github.com/q-gears/q-gears

This contains only the engine code now, no binaries or data, not even in the history (to remove the copyrighted data which would end this project).

This repo has the following submodules:

https://github.com/q-gears/q-gears/tree/master/dependencies

To 3rd part things, finally there is one more:

https://github.com/q-gears/q-gears/tree/master/output

Which links to the data repo:

https://github.com/q-gears/data

Which contains all data to run qgears (and some copyrighted data too, I guess at some point we need an installer to generate this from the users installed copy of the game). The code and data repos weigh in at about 20MB.

And the other final repo is:

https://github.com/q-gears/q-gears-reversing-data

Which has everything that didn't fit in to either of the code or data repos. This one is huge (1GB) and still has full history too.

Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2014-12-15 07:07:39
I implementing text manager to work with localized dialogs now. After that i hope to add counter and it's done. I will add texts for first 3 location to test how it's work )

Text manager finished. Language changing finished. Now it's time for some variables in text (like names of characters)
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2014-12-15 15:50:37
I've updated the build to use CPack to build a DEB file if on Linux or build an MSI on windows. Still needs some work, license needs adding, MSI banner image, include the OGRE config for qgears.exe include OGRE DLLs on Windows etc.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: sithlord48 on 2014-12-15 18:37:48
I've updated the build to use CPack to build a DEB file if on Linux or build an MSI on windows. Still needs some work, license needs adding, MSI banner image, include the OGRE config for qgears.exe include OGRE DLLs on Windows etc.


cool i see you beat me to it lol
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2014-12-16 08:50:57
Text manager finished. Language changing finished. Now it's time for some variables in text (like names of characters)

Text includes finished. It include text in other text or dialog. Dialog is text with defined width and height of dialogbox. Because dialogs in different localization has different dialogbox size. This format used in xenogears and FFIX because it's more localization friendly.
Text includes can be used to include item names and character names in dialogs.

Example

Code: [Select]
    <text name="item_potion">Potion</text>
    <text name="item_potion">ポーション</text>

    <dialog name="receive_potion" width="138" height="25">Received “<include name="item_potion" />”!</dialog>
    <dialog name="receive_potion" width="164" height="25">『<include name="item_potion" />』を手にいれた!</dialog>

     message:show_dialog( 2 , "receive_potion", 200, 140 )
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: sithlord48 on 2014-12-16 13:00:47
i started to work more on cpack and noticed we are currently installing the lua stuff (lua submodule is using cmake to install as well) . i have added a check for arch so we can detect 32 or 64 bit.  also included the project icon and desktop file. hopefully i can have our debs being created with cpack correctly very soon .  mostly i need to figure out how not to package lua with q-gears.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: zerotacg on 2014-12-16 19:25:12
it seems lua is bundled due to the git submodule integration of it and using the complete source
you could remove that and extend the initial cmake script to find the lua library as well and then just link against it similar to [2]

[1] https://github.com/q-gears/q-gears/tree/master/dependencies
[2] https://github.com/q-gears/q-gears/blob/master/CMakeLists.txt#L48
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2014-12-16 23:14:41
Its possibly to specify which executables to include in the package too, if you do that LUA won't appear.

Edit: Saw what you guys where saying in IRC. I don't think we should use IS because it isn't free and isn't supported by CPack, we need anyone to be able to compile the installer and to only maintain one CPack script for all platforms. For NSIS VS WIX is more native than NSIS too, see:

http://stackoverflow.com/questions/1903145/nsis-vs-wix-vs-anyother-installation-package

unless there is some other reason to use NSIS over WIX? Also the intention is that the scripts will be converted automatically - without any goto's. I'm working on the script decompiler that should generate structured code (no goto's). It will be a while before this works though.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: sithlord48 on 2014-12-17 16:20:07
Its possibly to specify which executables to include in the package too, if you do that LUA won't appear.

Edit: Saw what you guys where saying in IRC. I don't think we should use IS because it isn't free and isn't supported by CPack, we need anyone to be able to compile the installer and to only maintain one CPack script for all platforms. For NSIS VS WIX is more native than NSIS too, see:

http://stackoverflow.com/questions/1903145/nsis-vs-wix-vs-anyother-installation-package

unless there is some other reason to use NSIS over WIX? Also the intention is that the scripts will be converted automatically - without any goto's. I'm working on the script decompiler that should generate structured code (no goto's). It will be a while before this works though.

i don't care how or what is used for the windows installer as long as it works with cpack and doesn't affect my ability to make a correct install for linux. as for the NSIS vs WIX i have personally only ever used NSIS to make installers and i know that does work with cpack.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2014-12-18 20:02:22
Installer update:
Ive built the dialogues and working functions (Enough to install qgears) now working on the background images.
Startup screen:
(http://i.imgur.com/fZyzzCT.png)
Component selection:
(http://i.imgur.com/uH2o8ff.png)
Install type selection:
(http://i.imgur.com/qxE5ShQ.png)
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: KnifeTheSky77 on 2014-12-19 04:46:47
It looks true to the original installer... very Windows 95, much nostalgia
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2014-12-19 20:25:15
Installer perfected
Will install Q-Gears into Program Files (x86)\Q-GEARS\q-gears
(http://i.imgur.com/DrOsvDl.png)

Akari how is dialog support coming along?
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2014-12-24 14:42:24
Akari how is dialog support coming along?

Working on inserting random image into text.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: KnifeTheSky77 on 2014-12-25 01:14:04
Edit: oh yes, pictures for the buttons end up in text boxes. Keep it up!  :mrgreen:
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2014-12-27 14:15:00
For the script decompiler I'll be using Michael Madsen's work from SCUMMVM. There will be a few extra bits required but at the moment its looking pretty simple to do.

The current test outputs this:

Code: [Select]
00000000: SETBYTE 80, 20, 66
00000004: SETBYTE 80, 21, 66
00000008: SETBYTE 80, 22, 66
0000000c: SETBYTE 80, 23, 255
00000010: RET
00000011: STPAL 0, 13, 0, 255
00000016: IFUB 80, 20, 98, 3, 38 (False target address: 0x41)
0000001c: PLUS 80, 20, 16
00000020: PLUS 80, 21, 16
00000024: PLUS 80, 22, 16
00000028: MPPAL2 0, 85, 80, 0, 16, 20, 21, 22, 255
00000032: WAIT 256
00000035: CPPAL 0, 0, 16, 0
0000003a: LDPAL 0, 16, 13, 255
0000003f: JMPB 41 (Jump target address: 0x16)
00000041: IFUB 80, 20, 4, 2, 38 (False target address: 0x6c)
00000047: MINUS 80, 20, 24
0000004b: MINUS 80, 21, 24
0000004f: MINUS 80, 22, 24
00000053: MPPAL2 0, 85, 80, 0, 16, 20, 21, 22, 255
0000005d: WAIT 256
00000060: CPPAL 0, 0, 16, 0
00000065: LDPAL 0, 16, 13, 255
0000006a: JMPB 41 (Jump target address: 0x41)
0000006c: JMPB 86 (Jump target address: 0x16)

Which decompiles to this

Quote
00000000: UnknownKernelFunction_128();
00000000: UnknownKernelFunction_128();
00000000: UnknownKernelFunction_128();
00000000: UnknownKernelFunction_128();
00000000: UnknownKernelFunction_0();
00000000: SetPalette();
00000016: do {
00000016:   while (!foo) {
0000001C:     UnknownKernelFunction_234();
0000001C:     UnknownKernelFunction_36();
0000001C:     UnknownKernelFunction_231();
0000001C:     UnknownKernelFunction_230();
00000041:   }
00000041:   while (!foo) {
00000047:     UnknownKernelFunction_135();
00000047:     UnknownKernelFunction_135();
00000047:     UnknownKernelFunction_135();
00000047:     UnknownKernelFunction_234();
00000047:     UnknownKernelFunction_36();
00000047:     UnknownKernelFunction_231();
00000047:     UnknownKernelFunction_230();
0000006C:   }
0000006C: } while(true);

The code is here:

https://github.com/paulsapps/SUDM

Apart from a few minor fixes the only code I had to add to make this work is here:

https://github.com/paulsapps/SUDM/tree/master/decompiler/ff7_field

The CFG:

(http://s10.postimg.org/72emmmpl5/graph.png)
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: KnifeTheSky77 on 2014-12-27 16:52:28
Brilliant! How far off is it from spitting out usable LUA scripts?
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2014-12-27 17:09:56
Depends how many more bugs or issues I find in its output, feel free to chip in though ;)

Field script output
Code: [Select]
var_80_20=66;
var_80_21=66;
var_80_22=66;
var_80_23=255;
return;
SetPalette(0,13,0,255);
do {
  while (var_80_20 < 98) {
    var_80_20 += 16
    var_80_21 += 16
    var_80_22 += 16
    MulitplyPallete();
    Wait(256);
    CopyPallete();
    LoadPallete();
  }
  while (var_80_20 > 4) {
    var_80_20 -= 24
    var_80_21 -= 24
    var_80_22 -= 24
    MulitplyPallete();
    Wait(256);
    CopyPallete();
    LoadPallete();
  }
} while(true);

World map script progress
Code: [Select]
00000202: reset stack (0)
00000203: push byte from bank 0 897 (2)
00000205: jump if false 25 (0)
00000207: reset stack (0)
00000208: push byte from bank 0 897 (2)
0000020a: push byte from bank 0 897 (2)
0000020c: push constant 1 (2)
0000020e: push sub (2)
0000020f: write bank (0)
00000210: reset stack (0)
00000211: push byte from bank 0 897 (2)
00000213: push constant 0 (2)
00000215: push equal (2)
00000216: jump if false 25 (0)
00000218: unknown 320 (0)
00000219: return (0)

00000203: if (!897) {
00000211:   if (!897  0) {
00000218:     kernel_unknown_800();
00000219:   }
00000219: }
00000219: return;

And all of wm0.ev:

http://pastebin.com/Gqq7M111
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2015-01-09 17:29:29
Surprise surprise :D  Cloud riding the Midgar Train
New ways to reach levels:
(http://i.imgur.com/TMEsvSq.png)

Cloud taking the Midnight Midgar Train
(http://i.imgur.com/NQfdhCT.png)

Weird to have a walkmesh on the seats!?
(http://i.imgur.com/ktsFTjd.png)

Akari: Have you progressed with dialogue support?
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2015-01-12 12:15:42
Quote
Akari: Have you progressed with dialogue support?

Finish with button image exporting and inserting. Now fixing small bug with clipping during dialog closing (image not clipped).

Next target will be timer.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2015-01-12 13:13:11
Are the dialogs rendered properly without the pixel bug? Currently there is a bug with the way windows are displayed explained in the images below:

Example bugged dialogue:
(http://i.imgur.com/1hZsD0O.png)

The bug shown up close:
(http://i.imgur.com/qXo1AHc.png)

The dialogs normally have rounded corners, straight lines and nicer fonts like shown here:
(http://i.imgur.com/HJPiHAE.jpg)
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Kaldarasha on 2015-01-13 12:11:57
I wouldn't say it's buggy it simply looks like that the menu use the low res font sheet.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2015-01-17 16:55:45
Decompiler update:

Code: [Select]
00000602: class zizizi {
00000602:   void init() {
00000602:     return;
00000602:   }
00000603:
00000603:   void main() {
00000603:     return;
00000603:   }
00000604:
00000604:   void script_1() {
00000604:     temp5_25 = 0;
00000608:     temp5_26 = rand();
0000060B:     temp5_26 = temp5_26 % 4;
0000060B:     if (temp5_26 == 0) {
00000615:       temp5_26 = 1;
00000619:     }
00000619:     while (temp5_25 < temp5_26) {
0000061F:       backgroundOn(temp5_27, 1);
00000623:       wait(1);
00000626:       backgroundOff(temp5_27, 1);
0000062A:       wait(1);
0000062D:       backgroundOn(3, 1);
00000631:       wait(1);
00000634:       backgroundOff(3, 1);
00000638:       wait(1);
0000063B:       temp5_25++;
00000640:     }
00000640:     return;
00000640:   }
00000640: };

Still a lot to do before the output is usable.

Edit: And now almost valid LUA being generated:

Code: [Select]
EntityContainer[ "dir" ] = {
  dir = nil

  init = function( self )
    self.dir = entity_manager:get_entity("dir")
    BTLMD(32)
    MUSIC(0)
    setMapName(2)
  end,

  main = function( self )
    repeat
      getEntityTriangleId(temp6_0, 1);
    until (true)
  end,

  script_1 = function( self )
  end,
}

EntityContainer[ "cl" ] = {
  cl = nil

  init = function( self )
    self.cl = entity_manager:get_entity("cl")
    Char(0)
    setPlayableChar(0)
  end,

  main = function( self )
  end,

  script_1 = function( self )
  end,
}

EntityContainer[ "av_b" ] = {
  av_b = nil

  init = function( self )
    self.av_b = entity_manager:get_entity("av_b")
    Char(1)
    placeObject(0, 0, 3437, 31524, 642)
    self.av_b:set_solid(true)
    if (2_0 >= 8) {
      self.av_b:set_talkable(true)
      self.av_b:set_solid(true)
      self.av_b:set_visible(false)
    }
  end,

  main = function( self )
    if (2_0 < 8) {
      self.av_b:set_move_auto_speed(0, 4096)
      move(0, 3646, 31219)
      2_0 = 8;
      playBlockingAnimation(3, 1)
      move(0, 4277, 31259)
      move(0, 4364, 32052)
      move(0, 3381, 32313)
      move(0, 3010, 32350)
      self.av_b:set_talkable(true)
      self.av_b:set_solid(true)
      self.av_b:set_visible(false)
    }
  end,

  script_1 = function( self )
  end,
}
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2015-01-21 12:41:30
fixing small bug with clipping during dialog closing (image not clipped).

Done. Clipping fixed.

Now it's time for timer =)
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2015-01-21 16:43:29
Akari:

Quote
We need to initialize model for entity in qgears

Code: [Select]
        set_entity_to_character( "Cloud", "Cloud" )
        self.cloud = entity_manager:get_entity( "Cloud" )

In ffvii this is done with PC opcode wich translates to

Code: [Select]
0441 (end 0441): -- assosiate entity with model (CHAR) argument doesn't matter
0443 (end 0443): set_entity_to_character( "cl", 0 );

Does this mean that opcode PC N will always become set_entity_to_character( "current_entity", "current_entity" )? What are the 2 parameters meaning here?
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2015-01-22 07:15:40
Akari:

Does this mean that opcode PC N will always become set_entity_to_character( "current_entity", "current_entity" )? What are the 2 parameters meaning here?


Look at file .\data\scripts\ffvii\field.lua - you find a lof of interesting in this file and directory.

Code: [Select]
set_entity_to_character = function( entity_name, character_name )
    if character_name == FFVII.Party[ 1 ] and entity_name ~= "" then
        if System.MapChanger.point_name ~= "" then
            local point = entity_manager:get_entity_point( System.MapChanger.point_name )
            if point ~= nil then
                local x, y, z = point:get_position()
                local rotation = point:get_rotation()
                local player = entity_manager:get_entity( entity_name )
                player:set_position( x, y, z )
                player:set_rotation( rotation )
                player:set_solid( true )
                player:set_visible( true )
            end
        end

        entity_manager:set_player_entity( entity_name )
    end
end
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2015-01-27 19:28:30
Decompiler now generates "parseable" Lua :)

Tom is working on a script that uses all opcodes to implement/test all FF7 field opcodes.

My next task is to allow feeding in metadata to replace "cl" with "Cloud" or to auto generate the gateway data/script.

sithlord48 is busy breaking the build and then running away.

Code: [Select]
EntityContainer[ "dir" ] = {
  dir = nil,

  init = function( self )
    self.dir = entity_manager:get_entity("dir")
    BTLMD(32)
    MUSIC(0)
    setMapName(2)
  end,

  main = function( self )
    repeat
      getEntityTriangleId(temp6_0, 1);
    until (true)
  end,

  script_1 = function( self )
  end,
}

EntityContainer[ "cl" ] = {
  cl = nil,

  init = function( self )
    self.cl = entity_manager:get_entity("cl")
    Char(0)
    setPlayableChar(0)
  end,

  main = function( self )
  end,

  script_1 = function( self )
  end,
}

EntityContainer[ "av_b" ] = {
  av_b = nil,

  init = function( self )
    self.av_b = entity_manager:get_entity("av_b")
    Char(1)
    placeObject(0, 0, 3437, 31524, 642)
    self.av_b:set_solid(true)
    if (var_2_0 >= 8) then
      self.av_b:set_talkable(true)
      self.av_b:set_solid(true)
      self.av_b:set_visible(false)
    end
  end,

  main = function( self )
    if (var_2_0 < 8) then
      self.av_b:set_move_auto_speed(0, 4096)
      move(0, 3646, 31219)
      var_2_0 = 8
      playBlockingAnimation(3, 1)
      move(0, 4277, 31259)
      move(0, 4364, 32052)
      move(0, 3381, 32313)
      move(0, 3010, 32350)
      self.av_b:set_talkable(true)
      self.av_b:set_solid(true)
      self.av_b:set_visible(false)
    end
  end,

  script_1 = function( self )
  end,
}

EntityContainer[ "av_c" ] = {
  av_c = nil,

  init = function( self )
    self.av_c = entity_manager:get_entity("av_c")
    Char(2)
    playAnimationLoop(3, 1)
    self.av_c:set_move_auto_speed(0, 4096)
    turnToEntity(0, 252)
    placeObject(0, 0, 3574, 32483, 636)
    self.av_c:set_solid(true)
    if (var_2_0 >= 8) then
      self.av_c:set_talkable(true)
      self.av_c:set_solid(true)
      self.av_c:set_visible(false)
    end
  end,

  main = function( self )
    if (var_2_0 < 8) then
      script:wait(8.500000)
      move(0, 3381, 32313)
      move(0, 3010, 32350)
      self.av_c:set_talkable(true)
      self.av_c:set_solid(true)
      self.av_c:set_visible(false)
    end
  end,

  script_1 = function( self )
  end,
}

EntityContainer[ "av_w" ] = {
  av_w = nil,

  init = function( self )
    self.av_w = entity_manager:get_entity("av_w")
    Char(3)
    playAnimationLoop(3, 1)
    self.av_w:set_move_auto_speed(0, 4096)
    turnToEntity(0, 252)
    placeObject(0, 0, 4356, 31678, 652)
    self.av_w:set_solid(true)
    if (var_2_0 >= 8) then
      self.av_w:set_talkable(true)
      self.av_w:set_solid(true)
      self.av_w:set_visible(false)
    end
  end,

  main = function( self )
    if (var_2_0 < 8) then
      script:wait(4.266667)
      move(0, 4312, 32085)
      move(0, 3381, 32313)
      move(0, 3010, 32350)
      self.av_w:set_talkable(true)
      self.av_w:set_solid(true)
      self.av_w:set_visible(false)
    end
  end,

  script_1 = function( self )
  end,
}

EntityContainer[ "light0" ] = {
  light0 = nil,

  init = function( self )
    self.light0 = entity_manager:get_entity("light0")
    temp5_28 = 0
    temp5_31 = 255
  end,

  main = function( self )
    STPLS()
    ::label_0x46C::
    while (temp5_28 == 0) do
      if (temp5_31 > 250) then
        temp5_31 = temp5_31 - 1
        break
      end
      temp5_28 = 1
      script:wait(0.133333)
    end
    if (temp5_28 == 1) then
      if (temp5_31 < 255) then
        temp5_31 = temp5_31 + 1
       else
        temp5_28 = 0
        script:wait(0.133333)
      end
    end
    ADPAL()
    LDPLS()
    script:wait(0.066667)
    goto label_0x46C
  end,
}

EntityContainer[ "light1" ] = {
  light1 = nil,

  init = function( self )
    self.light1 = entity_manager:get_entity("light1")
    temp5_29 = 0
    temp5_32 = 255
  end,

  main = function( self )
    setPalette(0, 14, 34, 31)
    script:wait(0.133333)
    ::label_0x4C2::
    while (temp5_29 == 0) do
      if (temp5_32 > 250) then
        temp5_32 = temp5_32 - 1
        break
      end
      temp5_29 = 1
      script:wait(0.133333)
    end
    if (temp5_29 == 1) then
      if (temp5_32 < 255) then
        temp5_32 = temp5_32 + 1
       else
        temp5_29 = 0
        script:wait(0.133333)
      end
    end
    ADPAL()
    loadPallete()
    script:wait(0.066667)
    goto label_0x4C2
  end,
}

EntityContainer[ "light2" ] = {
  light2 = nil,

  init = function( self )
    self.light2 = entity_manager:get_entity("light2")
    backgroundClear(0, 2)
    backgroundOn(0, 2);
    temp5_33 = 255
  end,

  main = function( self )
    STPLS()
    ::label_0x518::
    temp5_33 = 255
    while (temp5_33 > 252) do
      ADPAL()
      LDPLS()
      temp5_33 = temp5_33 - 1
      script:wait(0.066667)
    end
    LDPLS()
    temp5_33 = rand()
    temp5_33 = temp5_33 % 3
    temp5_33 = temp5_33 + 1
    while (temp5_33 > 0) do
      backgroundOff(0, 2);
      script:wait(0.033333)
      backgroundOn(0, 2);
      temp5_33 = temp5_33 - 1
    end
    script:wait(2.000000)
    goto label_0x518
  end,
}

EntityContainer[ "warning" ] = {
  warning = nil,

  init = function( self )
    self.warning = entity_manager:get_entity("warning")
    backgroundClear(0, 1)
    backgroundOff(0, 1);
    temp5_24 = 0
    temp5_27 = 255
  end,

  main = function( self )
    setPalette(0, 11, 0, 255)
    repeat
      temp5_27 = temp5_27 + 1
      while (temp5_27 > 2) do
        temp5_27 = 0
      end
      callScriptBlocking()
      backgroundOn(temp5_27, 1);
      callScriptBlocking()
      loadPallete()
      script:wait(0.033333)
      callScriptBlocking()
      loadPallete()
      script:wait(0.033333)
      callScriptBlocking()
      backgroundOff(temp5_27, 1);
      loadPallete()
      script:wait(0.033333)
    until (true)
  end,
}

EntityContainer[ "light" ] = {
  light = nil,

  init = function( self )
    self.light = entity_manager:get_entity("light")
  end,

  main = function( self )
  end,

  script_1 = function( self )
    temp5_24 = 66
    while (temp5_24 < 98) do
      temp5_24 = temp5_24 + 16
      mulitplyPallete()
      copyPallete()
      loadPallete()
      script:wait(0.066667)
    end
    while (temp5_24 > 4) do
      temp5_24 = temp5_24 - 24
      mulitplyPallete()
      copyPallete()
      loadPallete()
      script:wait(0.066667)
    end
  end,
}

EntityContainer[ "zizizi" ] = {
  zizizi = nil,

  init = function( self )
    self.zizizi = entity_manager:get_entity("zizizi")
  end,

  main = function( self )
  end,

  script_1 = function( self )
    temp5_25 = 0
    temp5_26 = rand()
    temp5_26 = temp5_26 % 4
    if (temp5_26 == 0) then
      temp5_26 = 1
    end
    while (temp5_25 < temp5_26) do
      backgroundOn(temp5_27, 1);
      script:wait(0.033333)
      backgroundOff(temp5_27, 1);
      script:wait(0.033333)
      backgroundOn(3, 1);
      script:wait(0.033333)
      backgroundOff(3, 1);
      script:wait(0.033333)
      temp5_25 = temp5_25 + 1
    end
  end,
}
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2015-01-28 18:56:41
Added new fields into the game! Currently I only know how to do it with single layer backgrounds, so no walking behind objects  :D

Here is what I have been working on:
(http://i.imgur.com/73UGNpy.png)

(http://i.imgur.com/M1XAc6b.png)

The field is 1920 x 1080 so HighRes backgrounds are compatible and functional!

(http://i.imgur.com/AhnrNn2.png)
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: KnifeTheSky77 on 2015-01-28 20:26:04
Awesome work tom! Is this field going up on the /q-gears/data repo?
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2015-01-30 08:05:54
Save slot Menu added!
(http://i.imgur.com/c6IIrq4.png)

Update: Font debug menu, debug menu and more rooms! Also, I'm making a high(er) res font from a low res render of Verdana so we can achieve the FF7 look, with the lines on the C and the jagged edges on the letters.  Also reworked the digits!
(http://i.imgur.com/TpM0Z1M.png)

And heres the debug menu Select'o'Thing you always wanted :)
(http://i.imgur.com/WTRKma3.png)


Akari have you added the countdown timer?
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2015-02-09 12:22:05
Akari I see you're still not using a Github fork.. please, pleaseeeeee could you create one so your code is always backed up and its easy to sync/see what everyone is up to :)

BTW I noticed you used Code::Blocks IDE, you can tell CMake to generate code blocks IDE files:

http://www.cmake.org/cmake/help/v3.0/generator/CodeBlocks.html

If there is any other issue you have that prevents you using github let me know so I can fix. On github we also have issue/task lists so dialog task could be assigned to you. When you make pull request travis will check Linux and OSX compiling too (unit tests will run soon too).
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2015-02-16 12:29:33
I finished Dialog system and time down counter. This is more than enough for Bombing Mission. I didn't create usual counter, but It not used until later in game.
I tried to text it and find all bugs, but I failed and you find few of them when you will try to add new dialogs.

I used all source to implement all this features (based on 0.21). I'll try use new github source next time.
I don't know how to build all that stuff in repository now. I think it will be faster if I send my sources to you and you merge them yourself.

And I add new features to dat and font exporters. So they needs to be updated too.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2015-02-16 12:47:08
Cool - if you come in IRC I can provide help to get you running on github sources version.

Dat exporter had some big changes in github version to fixing compling in MSVC, the if/else chain on opcode had to be changed to switch/case. We also have SUDM that will decompile FF7 script to structured LUA, don't know if you've seen this work yet.

Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2015-02-19 19:22:26
Have you sent/uploaded your changes so we can start adding some content?  This is just what we need to make some custom content.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Akari on 2015-02-22 17:04:11
http://vk.com/doc7350946_369185797
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2015-02-23 20:01:44
Downloaded and fired it up.  4rth alpha talking bombing mission works great :)  Amazing work with the dialogues, nice to see the text appears gradually one lettter at a time.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2015-02-28 00:01:18
Update:

Bgroff is integrating Akari's dialog changes - but Akari will be using github from now on so this should be easy in future (right Akari? Don't make me have to kill you ;)).
Basic data installer/converter added.
SUDM is integrated into QGears data installer.
Started conversion of PC field to QGears format, some files remain todo.
Quite a bit of work left on SUDM before QGears can use what it outputs (support for renaming vars via metadata, renaming functions, dropping functions, inserting function block comments).

Once this work is completed a lot more fields will automagically work after being "installed".

Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2015-04-06 08:00:59
I have been testing out some new HD fields (nrthmk) and they work perfectly.
Also been playing with the dialogue implementation

(http://i.imgur.com/oPK1zLS.png)
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Hellbringer616 on 2015-04-07 13:38:57
Is this a still image, or an ingame (in engine?) rendering? Because live 3d field scenes would be amazing (actually scaling with my resolution!)
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: paul on 2015-04-07 16:57:31
I think its rendered but you can use real time 3d models since thats how Xeongears fields work
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2015-04-24 05:41:23
It is rendered but its ingame.  Because I couldn't get a walkmesh to adapt exactly ill have to make a new walkmesh.  Thats why there are no characters or walkmesh grid available.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Ultroman on 2015-04-24 15:16:42
You guys are doing amazing work! Keep it up! I'd wish I could program C++, because I'd love to help. I only have experience with Java and C#, and a packed life as it is, though. This will definitely be my go-to project, if I find some extra time.
Title: Re: Q-Gears Field Module - Midgar Conversion Project
Post by: Tom on 2015-04-25 13:54:37
You don't have to know how to program C++ to help with Q-Gears   :)  The Field Script programming language is LUA which is very easy to learn and understand.  Just have a look at the already existing fields like nrthmk.lua to get a feel for how it is. 

The full amount of commands you can use in the field are 246 and can be found with a detailed description here http://wiki.qhimm.com/view/FF7/Field/Script/Opcodes

And the commands implemented in Q-Gears are listed here:
https://github.com/q-gears

You can also help with making 3D Scenes with a 3D CAD tool (Like blender or 3d studio Max) or you can help with our wiki and documenting the field commands.