Author Topic: Q-Gears Field Module - Midgar Conversion Project [Replaced by Finishing Touch]  (Read 76136 times)

Kaldarasha

  • *
  • Posts: 2449
  • Prince of Model Editing
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #75 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.

paul

  • Moderator
  • *
  • Posts: 179
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #76 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,
}
« Last Edit: 2015-01-20 22:36:38 by paul »

Akari

  • Moderator
  • *
  • Posts: 766
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #77 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 =)

paul

  • Moderator
  • *
  • Posts: 179
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #78 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?

Akari

  • Moderator
  • *
  • Posts: 766
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #79 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

paul

  • Moderator
  • *
  • Posts: 179
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #80 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,
}

Tom

  • Moderator
  • *
  • Posts: 207
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #81 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:




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

« Last Edit: 2015-01-30 08:04:37 by Tom »

KnifeTheSky77

  • *
  • Posts: 548
  • Somnambulistic Paraphile
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #82 on: 2015-01-28 20:26:04 »
Awesome work tom! Is this field going up on the /q-gears/data repo?

Tom

  • Moderator
  • *
  • Posts: 207
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #83 on: 2015-01-30 08:05:54 »
Save slot Menu added!


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!


And heres the debug menu Select'o'Thing you always wanted :)



Akari have you added the countdown timer?
« Last Edit: 2015-02-07 10:22:34 by Tom »

paul

  • Moderator
  • *
  • Posts: 179
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #84 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).

Akari

  • Moderator
  • *
  • Posts: 766
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #85 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.

paul

  • Moderator
  • *
  • Posts: 179
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #86 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.


Tom

  • Moderator
  • *
  • Posts: 207
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #87 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.

Akari

  • Moderator
  • *
  • Posts: 766
    • View Profile

Tom

  • Moderator
  • *
  • Posts: 207
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #89 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.

paul

  • Moderator
  • *
  • Posts: 179
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #90 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".


Tom

  • Moderator
  • *
  • Posts: 207
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #91 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


Hellbringer616

  • *
  • Posts: 1913
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #92 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!)

paul

  • Moderator
  • *
  • Posts: 179
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #93 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

Tom

  • Moderator
  • *
  • Posts: 207
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #94 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.

Ultroman

  • *
  • Posts: 23
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #95 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.

Tom

  • Moderator
  • *
  • Posts: 207
    • View Profile
Re: Q-Gears Field Module - Midgar Conversion Project
« Reply #96 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.