AIP (Artificial Intelligence Program)

Tools for osRose and osiRose will be placed in here, as well as Rose file formats.

Please PM rl2171 or lmame to get them added to the list.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

AIP (Artificial Intelligence Program)

Postby PurpleYouko on Mon Aug 12, 2013 2:09 pm

All credits for the formats in this thread go to Exjam, Xadet and Brett

AIP
  1.  
  2. DWORD trigger_count
  3. DWORD idle_check
  4. DWORD damage_check
  5. LSTR title
  6.  
  7. :FOREACH( trigger_count )
  8.     FSTR[0x20] trigger_name
  9.     DWORD block_count
  10.     :FOREACH( block_count )
  11.         FSTR[0x20] block_name
  12.         DWORD condition_count
  13.         :FOREACH( condition_count )
  14.             DWORD part_size
  15.             DWORD part_cmd
  16.  
  17.             :PACK[4]
  18.             :IF( partcmd == E[conditions].RECVDAMAGE )
  19.                 DWORD damage
  20.                 BYTE recvorgive
  21.             :ELSEIF( partcmd == E[conditions].FINDOBJECT1 )
  22.                 DWORD distance
  23.                 BYTE isallied
  24.                 WORD levelmin
  25.                 WORD levelmax
  26.                 WORD charnum
  27.             :ELSEIF( partcmd == E[conditions].SPAWNDISTANCE )
  28.                 DWORD distance
  29.             :ELSEIF( partcmd == E[conditions].TARGETDISTANCE )
  30.                 DWORD distance
  31.                 BYTE moreorless
  32.             :ELSEIF( partcmd == E[conditions].TARGETABILITY )
  33.                 BYTE abilitytype
  34.                 DWORD difference
  35.                 BYTE moreorless
  36.             :ELSEIF( partcmd == E[conditions].HPPERCENT )
  37.                 DWORD hp
  38.                 BYTE moreorless
  39.             :ELSEIF( partcmd == E[conditions].RANDOMCHANCE )
  40.                 BYTE percent
  41.             :ELSEIF( partcmd == E[conditions].FINDOBJECT2 )
  42.                 DWORD distance
  43.                 WORD levelmin
  44.                 WORD levelmax
  45.                 BYTE isallied
  46.             :ELSEIF( partcmd == E[conditions].TARGETDESTCHECK )
  47.             :ELSEIF( partcmd == E[conditions].TARGETDESTABILITY )
  48.                 BYTE abilitytype
  49.                 BYTE moreorless
  50.             :ELSEIF( partcmd == E[conditions].DESTABILITY )
  51.                 BYTE abilitytype
  52.                 DWORD value
  53.                 BYTE moreorless
  54.             :ELSEIF( partcmd == E[conditions].DAYNIGHT )
  55.                 BYTE when
  56.             :ELSEIF( partcmd == E[conditions].TARGETMAGICSTATUS )
  57.                 BYTE checktarget
  58.                 BYTE statustype
  59.                 BYTE hasstatus
  60.             :ELSEIF( partcmd == E[conditions].OBJECTVAR )
  61.                 BYTE varindex
  62.                 DWORD value
  63.                 BYTE operator
  64.             :ELSEIF( partcmd == E[conditions].WORLDVAR )
  65.                 BYTE varindex
  66.                 DWORD value
  67.                 BYTE operator
  68.             :ELSEIF( partcmd == E[conditions].ECONOMYVAR )
  69.                 BYTE varindex
  70.                 DWORD value
  71.                 BYTE operator
  72.             :ELSEIF( partcmd == E[conditions].SELECTNPC )
  73.                 DWORD npcid
  74.             :ELSEIF( partcmd == E[conditions].OWNERDISTANCE )
  75.                 DWORD distance
  76.                 BYTE operator
  77.             :ELSEIF( partcmd == E[conditions].ZONETIME )
  78.                 DWORD starttime
  79.                 DWORD endtime
  80.             :ELSEIF( partcmd == E[conditions].ABILITY )
  81.                 BYTE abilitytype
  82.                 DWORD value
  83.                 BYTE operator
  84.             :ELSEIF( partcmd == E[conditions].OWNEREXISTS )
  85.             :ELSEIF( partcmd == E[conditions].OWNERHASTARGET )
  86.             :ELSEIF( partcmd == E[conditions].WORLDTIME )
  87.                 DWORD starttime
  88.                 DWORD endtime
  89.             :ELSEIF( partcmd == E[conditions].LOCALTIMEDATE )
  90.                 BYTE date
  91.                 BYTE hour1
  92.                 BYTE min1
  93.                 BYTE hour2
  94.                 BYTE min2
  95.             :ELSEIF( partcmd == E[conditions].LOCALTIMEDAY )
  96.                 BYTE weekday
  97.                 BYTE hour1
  98.                 BYTE min1
  99.                 BYTE hour2
  100.                 BYTE min2
  101.             :ELSEIF( partcmd == E[conditions].CHECKCHANNEL )
  102.                 WORD min
  103.                 WORD max
  104.             :ELSEIF( partcmd == E[conditions].FINDOBJECT3 )
  105.                 DWORD distance
  106.                 BYTE isallied
  107.                 WORD levelmin
  108.                 WORD levelmax
  109.                 WORD charnum
  110.                 BYTE operator
  111.             :ELSEIF( partcmd == E[conditions].AIVARIABLE )
  112.                 WORD varindex
  113.                 BYTE operator
  114.                 DWORD value
  115.             :ENDIF
  116.         :ENDFOR
  117.         :PACK[1]
  118.        
  119.         DWORD action_count
  120.         :FOREACH( action_count )
  121.             DWORD part_size
  122.             DWORD part_cmd
  123.  
  124.             -- NOT DONE
  125.  
  126.         :ENDFOR
  127.     :ENDFOR
  128. :ENDFOR
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

CHR (Character Model Data)

Postby PurpleYouko on Mon Aug 12, 2013 2:10 pm

CHR
  1.  
  2. WORD meshcount
  3. :FOREACH( meshcount )
  4.   ZSTR path
  5. :ENDFOR
  6. WORD motioncount
  7. :FOREACH( motioncount )
  8.   ZSTR path
  9. :ENDFOR
  10. WORD effectcount
  11. :FOREACH( effectcount )
  12.   ZSTR path
  13. :ENDFOR
  14. WORD charactercount
  15. :FOREACH( charactercount )
  16.   BYTE isactive
  17.   :IF( isactive )
  18.     WORD boneid
  19.     ZSTR name
  20.     WORD meshcount
  21.     :FOREACH( meshcount )
  22.       WORD meshid  // Links to an "object" from the ZSC file
  23.     :ENDFOR
  24.     WORD motioncount
  25.     :FOREACH( motioncount )
  26.       WORD id
  27.       WORD motionid
  28.     :ENDFOR
  29.     WORD effectcount
  30.     :FOREACH( effectcount )
  31.       WORD id
  32.       WORD effectid
  33.     :ENDFOR
  34.   :ENDIF
  35. :ENDFOR
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

CON (Conversation in NPC Dialogs)

Postby PurpleYouko on Mon Aug 12, 2013 2:13 pm

CON
  1.  
  2. DWORD event_mask
  3.      
  4.     :FOREACH( 16 )
  5.         FSTR[0x20] load_function
  6.     :ENDFOR
  7.      
  8.     DWORD block_offset
  9.     DWORD lua_offset
  10.      
  11.     DWORD init_count
  12.     DWORD init_offset
  13.     DWORD dialog_count
  14.     DWORD dialog_offset
  15.      
  16.     :SEEK[SET] 0x20c + init_offset
  17.      
  18.     :FOREACH( init_count )
  19.         DWORD init_dataoffset
  20.     :ENDFOR
  21.     :FOREACH( init_count )
  22.         DWORD entry_id
  23.         DWORD command
  24.         DWORD data
  25.         FSTR[0x20] condition_function
  26.         FSTR[0x20] reward_function
  27.         DWORD str_id
  28.     :ENDFOR
  29.      
  30.     :SEEK[SET] 0x20c + dialog_offset
  31.     :FOREACH( block_count )
  32.         DWORD block_dataoffset
  33.     :ENDFOR
  34.     :FOREACH( block_count )
  35.         DWORD block_size
  36.         DWORD entry_count
  37.         :XOR( ( (BYTE)entry_count & 1 ) ? (BYTE)entry_count : (BYTE)block_size)
  38.             DWORD[entry_count] entry_lookuptable
  39.             :FOREACH( entry_count )
  40.                 DWORD entry_id
  41.                 E[dialog_command] command
  42.                 DWORD data
  43.                 FSTR[0x20] condition_function
  44.                 FSTR[0x20] reward_function
  45.                 DWORD str_id
  46.             :ENDFOR
  47.         :ENDXOR
  48.     :ENDFOR
  49.      
  50.     DWORD code_len
  51.     :XOR( ( (BYTE)code_len & 1 ) ? (BYTE)code_len : (BYTE){FILE_SIZE} )
  52.         BYTE[code_len] lua_data
  53.     :ENDXOR
  54.      
  55.     --
  56.      
  57.     :ENUM dialog_command
  58.         CLOSE = 0
  59.         NEXTMSG = 1
  60.         NPCSAY = 2
  61.         PLAYERSELECT = 3
  62.         JUMPSELECT = 4
  63.     :ENUM
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

EFT (Effect)

Postby PurpleYouko on Mon Aug 12, 2013 2:14 pm

EFT
  1. LSTR name
  2.     DWORD use_sound_file
  3.     LSTR sound_file_name
  4.     DWORD sound_loop_count
  5.      
  6.     DWORD system_count
  7.     :FOREACH( system_count )
  8.         LSTR name
  9.         LSTR unique_name
  10.         DWORD stb_index
  11.         LSTR ptl_file
  12.         DWORD use_animation
  13.         LSTR zmo_file
  14.         DWORD animation_loop_count
  15.         DWORD animation_stb_index
  16.         VECTOR3 position
  17.         QUARTERNION rotation
  18.         DWORD delay
  19.         DWORD is_linked
  20.     :ENDFOR
  21.      
  22.     DWORD animation_count
  23.     :FOREACH( animation_count )
  24.         LSTR name
  25.         LSTR unique_name
  26.         DWORD stb_index
  27.         LSTR zms_file
  28.         LSTR zmo_file
  29.         LSTR dds_file
  30.         DWORD alpha_enabled
  31.         DWORD two_sided
  32.         DWORD alpha_test_enabled
  33.         DWORD ztest_enabled
  34.         DWORD zwrite_enabled
  35.         E[blend_mode] source_blend
  36.         E[blend_mode] destination_blend
  37.         E[blendop_type] blend_op
  38.         DWORD use_animation
  39.         LSTR animation_name
  40.         DWORD animation_loop_count
  41.         DWORD animation_stb_index
  42.         VECTOR3 position
  43.         QUARTERNION rotation
  44.         DWORD delay
  45.         DWORD repeat_count
  46.         DWORD is_linked
  47.     :ENDFOR( animation count )
  48.      
  49.     --
  50.      
  51.     :ENUM[DWORD] blend_mode
  52.         ZERO = 1
  53.         ONE = 2
  54.         SRCCOLOR = 3
  55.         INVSRCCOLOR = 4
  56.         SRCALPHA = 5
  57.         INVSRCALPHA = 6
  58.         DESTALPHA = 7
  59.         INVDESTALPHA = 8
  60.         DESTCOLO = 9
  61.         INVDESTCOLOR = 10
  62.         SRCALPHASAT = 11
  63.         BOTHSRCALPHA = 12
  64.         BOTHINVSRCALPHA = 13
  65.         BLENDFACTOR = 14
  66.         INVBLENDFACTOR = 15
  67.         SRCCOLOR2 = 16
  68.         INVSRCCOLOR2 = 17
  69.     :ENDENUM
  70.      
  71.     :ENUM[DWORD] blendop_type
  72.         ADD = 1
  73.         SUBTRACT = 2
  74.         REVSUBTRACT = 3
  75.         MIN = 4
  76.         MAX = 5
  77.     :ENDENUM
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

HIM (Hightmap)

Postby PurpleYouko on Mon Aug 12, 2013 2:18 pm

HIM
  1.  
  2. DWORD width
  3.     DWORD height
  4.     DWORD grid_count
  5.     FLOAT grid_size
  6.     :FOREACH( width )
  7.         :FOREACH( height )
  8.             FLOAT height
  9.         :ENDFOR
  10.     :ENDFOR
  11.      
  12.     E[collision_type] collision_type
  13.     DWORD quadentry_count
  14.     :FOREACH( quadentry_count )
  15.         FLOAT minZ
  16.         FLOAT maxZ
  17.     :ENDFOR
  18.      
  19.     :DEFINE quadtree_count = 1 + 4 + 16 + 32
  20.     DWORD quadtree_count
  21.     :CALL writequadnode( 256 )
  22.     :CALL writequadnode( 128 )
  23.     :CALL writequadnode( 64 )
  24.     :CALL writequadnode( 32 )
  25.      
  26.     --
  27.      
  28.     :FUNCTION writequadnode( divisonsize )
  29.         // I can't really write the pseudo-format for this, but basically, it writes
  30.         //     the min and max heights for each quadratic division of the map quadtree
  31.     :ENDFUNCTION
  32.      
  33.     :ENUM[BSTR] collision_type
  34.         QUAD = "QUAD"
  35.     :ENDENUM
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

HLP(Exjam)

Postby PurpleYouko on Mon Aug 12, 2013 2:19 pm

HLP
  1.  
  2. BSTR version
  3.      
  4.     DWORD root_count // Must be 1
  5.     BSTR root_node_name
  6.      
  7.     DWORD node_count
  8.     :FOREACH( node_count )
  9.         :CALL read_node
  10.     :ENDFOR
  11.      
  12.     DWORD page_count
  13.     :FOREACH( page_count )
  14.         BSTR page_title
  15.         BSTR page_content
  16.     :ENDFOR
  17.      
  18.     --
  19.      
  20.     :FUNCTION read_node
  21.         BSTR node_name
  22.      
  23.         DWORD subnode_count
  24.         :FOREACH( subnode_count )
  25.             :CALL read_node
  26.         :ENDFOR
  27.     :ENDFUNCTION
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

IDX (Index)

Postby PurpleYouko on Mon Aug 12, 2013 2:20 pm

IDX
  1.  
  2. DWORD base_version
  3.     DWORD current_version
  4.     DWORD vfs_count
  5.     :FOREACH( vfs_count )
  6.         SSTR vfs_path
  7.         DWORD data_offset
  8.     :ENDFOR
  9.      
  10.     :FOREACH( vfs_count )
  11.         :SEEK[SET] data_offset
  12.         DWORD file_count
  13.         DWORD delete_count
  14.         DWORD start_offset
  15.         :FOREACH file_count
  16.             SSTR file_path
  17.             DWORD offset
  18.             DWORD file_length
  19.             DWORD block_size
  20.             BYTE deleted
  21.             BYTE compressed_type
  22.             BYTE encryption_type
  23.             DWORD version
  24.             DWORD checksum
  25.         :ENDFOR
  26.     :ENDFOR
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

IFO (Terrain Information) (Exjam)

Postby PurpleYouko on Mon Aug 12, 2013 2:21 pm

IFO
  1.  
  2. DWORD block_count
  3.     :FOREACH( block_count )
  4.         E[block_type] block_type
  5.         DWORD block_offset
  6.     :ENDFOR
  7.      
  8.     :FOREACH( block_count )
  9.         :SEEK( block_offset )
  10.      
  11.         :IF( block_type == E[block_type].ECONOMYDATA )
  12.             DWORD width
  13.             DWORD height
  14.             DWORD map_cell_x
  15.             DWORD map_cell_y
  16.             MATRIX4X4 unused
  17.             BSTR block_name
  18.         :ENDIF
  19.      
  20.         :IF( block_type == E[block_type].DECORATIONS )
  21.             :CALL readbasictype
  22.         :ENDIF
  23.      
  24.         :IF( block_type == E[block_type].NPCLOCATIONS )
  25.             :CALL readbasictype
  26.             DWORD ai_pattern_index
  27.             BSTR con_file
  28.         :ENDIF
  29.      
  30.         :IF( block_type == E[block_type].BUILDINGS )
  31.             :CALL readbasictype
  32.         :ENDIF
  33.      
  34.         :IF( block_type == E[block_type].SOUNDEFFECTS )
  35.             :CALL readbasictype
  36.             BSTR path
  37.             DWORD range
  38.             DWORD interval
  39.         :ENDIF
  40.      
  41.         :IF( block_type == E[block_type].EFFECTS )
  42.             :CALL readbasictype
  43.             BSTR path
  44.         :ENDIF
  45.      
  46.         :IF( block_type == E[block_type].ANIMATABLES )
  47.             :CALL readbasictype
  48.         :ENDIF
  49.      
  50.         :IF( block_type == E[block_type].WATERBIG )
  51.             DWORD x_count
  52.             DWORD y_count
  53.             :FOREACH( x_count )
  54.                 :FOREACH( y_count )
  55.                     BYTE use
  56.                     FLOAT height
  57.                     DWORD water_type
  58.                     DWORD water_index
  59.                     DWORD reserved
  60.                 :ENDFOR
  61.             :ENDFOR
  62.             :GOTO NEXT BLOCK!
  63.         :ENDIF
  64.      
  65.         :IF( block_type == E[block_type].MONSTERSPAWNS )
  66.             :CALL readbasictype
  67.             DWORD spawn_count
  68.             :FOREACH( spawn_count )
  69.                 BSTR spawn_name
  70.                 DWORD basicmob_count
  71.                 :FOREACH( basicmob_count )
  72.                     BSTR mob_name
  73.                     DWORD monster_id
  74.                     DWORD amount
  75.                 :ENDFOR
  76.                 DWORD tacticmob_count
  77.                 :FOREACH( tacticmob_count )
  78.                     BSTR mob_name
  79.                     DWORD monster_id
  80.                     DWORD amount
  81.                 :ENDFOR
  82.                 DWORD interval
  83.                 DWORD limit_count
  84.                 DWORD range
  85.                 DWORD tactic_points
  86.             :ENDFOR
  87.         :ENDIF
  88.      
  89.         :IF( block_type == E[block_type].WATERPLANES )
  90.             DWORD entry_count
  91.             :FOREACH( entry_count )
  92.                 VECTOR3 start
  93.                 VECTOR3 end
  94.             :ENDFOR
  95.         :ENDIF
  96.      
  97.         :IF( block_type == E[block_type].WARPGATES )
  98.             :CALL readbasictype
  99.         :ENDIF
  100.      
  101.         :IF( block_type == E[block_type].COLLISIONBLOCK )
  102.             :CALL readbasictype
  103.         :ENDIF
  104.      
  105.         :IF( block_type == E[block_type].TRIGGERS )
  106.             :CALL readbasictype
  107.             BSTR qsd_trigger
  108.             BSTR lua_trigger
  109.         :ENDIF
  110.     :ENDFOR
  111.      
  112.     --
  113.      
  114.     :FUNCTION readbasictype
  115.         DWORD entry_count
  116.         :FOREACH( entry_count )
  117.             BSTR str_data
  118.             WORD warp_id
  119.             WORD event_id
  120.             WORD obj_type
  121.             WORD obj_id
  122.             WORD map_pos_x
  123.             WORD map_pos_y
  124.             QUARTERNION rotation
  125.             VECTOR3 position
  126.             VECTOR3 scale
  127.         :ENDFOR
  128.     :ENDFUNCTION
  129.      
  130.     :ENUM block_type
  131.         ECONOMYDATA = 0
  132.         DECORATIONS = 1
  133.         NPCSPAWNS = 2
  134.         BUILDINGS = 3
  135.         SOUNDEFFECTS = 4
  136.         EFFECTS = 5
  137.         ANIMATABLES = 6
  138.         WATERBIG = 7
  139.         MONSTERSPAWNS = 8
  140.         WATERPLANES = 9
  141.         WARPGATES = 10
  142.         COLLISIONBLOCK = 11
  143.         TRIGGERS = 12
  144.     :ENDENUM
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

LIT (Lightmap)

Postby PurpleYouko on Mon Aug 12, 2013 2:22 pm

LIT
  1.  
  2. DWORD obj_count
  3.     :FOREACH obj_count
  4.         DWORD part_count
  5.         DWORD objid
  6.         :FOREACH part_count
  7.             BSTR originalname
  8.             DWORD part_id
  9.             BSTR ddsname
  10.             DWORD dds_id
  11.             DWORD dds_division_size
  12.             DWORD dds_division_count
  13.             DWORD dds_part_id
  14.         :ENDFOR
  15.     :ENDFOR
  16.     DWORD dds_count
  17.     :FOREACH dds_count
  18.         BSTR ddsname
  19.     :ENDFOR
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

LOD (Level of Detail)

Postby PurpleYouko on Mon Aug 12, 2013 2:23 pm

LOD
  1.  
  2. ZSTR name
  3.     :FOREACH( 0x1F )
  4.         :FOREACH( 0x1F )
  5.             DWORD detaillevel
  6.         :ENDFOR
  7.     :ENDFOR
  8.  
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Next

Return to Tools and File Format

Who is online

Users browsing this forum: No registered users and 4 guests

cron