Jump to content


Photo

Any mod patching creature to an area?


  • Please log in to reply
4 replies to this topic

#1 Creepin

Creepin
  • Administrator
  • 1676 posts

Posted 28 September 2013 - 11:37 PM

Good day.

Could anybody please let me know if there's any mod around which add creature to an area via tp2 dynamical patching routine instead of usual soiling of top of the area script? Just need it to shamelessly steal carefully learn this routine :)

Thanks in advance :)

The Old Gold - v0.2 WIP (mod for BGT/BWP/BWS)


#2 Mike1072

Mike1072
  • Modder
  • 539 posts

Posted 29 September 2013 - 10:20 PM

I did some of this in Shadow Hand.  I think Cam wrote some functions that were recently added to WeiDU that alter actors, but I'm not sure if that included a way to add or delete actors.
 
Anyway, here are the functions I used back then:
 
Spoiler

 
Then I could add an actor like this:
 
COPY_EXISTING ~k#0800.are~ ~override~
    LAUNCH_PATCH_FUNCTION ~ADD_ARE_ACTOR~
      INT_VAR mi_xpos = 1266  mi_ypos = 1450  mi_anim = 25344  mi_orientation = 3
      STR_VAR mi_name = ~Kifor~  mi_crefile = ~k#kifor~
    END

Edited by Mike1072, 30 September 2013 - 02:12 AM.


#3 -Miloch-

-Miloch-
  • Guest

Posted 30 September 2013 - 12:44 AM

Aurora's Shoes and Boots adds actors via the more flexible WeiDU function fj_add_are_structure, which can add any sort of structure to an area (including actors). This snippet adds two actors, a travel region and an entrance to an existing area.

COPY_EXISTING ar0500.are override //Bridge District
  PATCH_IF SOURCE_SIZE > 0x28f BEGIN
    LPF fj_add_are_structure
      INT_VAR
      fj_loc_x          = 3450
      fj_loc_y          = 636
      fj_dest_loc_x     = 3450
      fj_dest_loc_y     = 636
      fj_animation      = svda   //svirfneblin dark axe
      fj_orientation    = 1      //SSW
      STR_VAR
      fj_structure_type = actor
      fj_name           = ~Tomthal Harfurthock~
      fj_cre_resref     = agtomtha
    END
    LPF fj_add_are_structure
      INT_VAR
      fj_loc_x          = 2780
      fj_loc_y          = 1955
      fj_dest_loc_x     = 2780
      fj_dest_loc_y     = 1955
      fj_animation      = 0x6110 //fighter female human
      fj_orientation    = 15     //SSE
      STR_VAR
      fj_structure_type = actor
      fj_name           = Aurora
      fj_cre_resref     = agaurora
    END
    LPF fj_add_are_structure
      INT_VAR
      fj_type         = 2    //travel
      fj_box_left     = 3415
      fj_box_top      = 625
      fj_box_right    = 3450
      fj_box_bottom   = 700
      fj_cursor_index = 30   //door
      fj_vertex_0     = 3415 + (625 << 16)
      fj_vertex_1     = 3450 + (650 << 16)
      fj_vertex_2     = 3450 + (700 << 16)
      fj_vertex_3     = 3415 + (676 << 16)
      STR_VAR
      fj_structure_type   = region
      fj_name             = Tran0540
      fj_destination_area = ag0540
      fj_destination_name = Exit0500
    END
    LPF fj_add_are_structure
      INT_VAR
      fj_loc_x       = 3490
      fj_loc_y       = 655
      fj_orientation = 10   //NE
      STR_VAR
      fj_structure_type = entrance
      fj_name           = Exit0540
    END
  END
BUT_ONLY

 

 



#4 Roxanne

Roxanne

    Modder

  • Member
  • 3564 posts

Posted 30 September 2013 - 07:12 AM

Aurora's Shoes and Boots adds actors via the more flexible WeiDU function fj_add_are_structure, which can add any sort of structure to an area (including actors). This snippet adds two actors, a travel region and an entrance to an existing area.

COPY_EXISTING ar0500.are override //Bridge District
  PATCH_IF SOURCE_SIZE > 0x28f BEGIN
    LPF fj_add_are_structure
      INT_VAR
      fj_loc_x          = 3450
      fj_loc_y          = 636
      fj_dest_loc_x     = 3450
      fj_dest_loc_y     = 636
      fj_animation      = svda   //svirfneblin dark axe
      fj_orientation    = 1      //SSW
      STR_VAR
      fj_structure_type = actor
      fj_name           = ~Tomthal Harfurthock~
      fj_cre_resref     = agtomtha
    END
    LPF fj_add_are_structure
      INT_VAR
      fj_loc_x          = 2780
      fj_loc_y          = 1955
      fj_dest_loc_x     = 2780
      fj_dest_loc_y     = 1955
      fj_animation      = 0x6110 //fighter female human
      fj_orientation    = 15     //SSE
      STR_VAR
      fj_structure_type = actor
      fj_name           = Aurora
      fj_cre_resref     = agaurora
    END
    LPF fj_add_are_structure
      INT_VAR
      fj_type         = 2    //travel
      fj_box_left     = 3415
      fj_box_top      = 625
      fj_box_right    = 3450
      fj_box_bottom   = 700
      fj_cursor_index = 30   //door
      fj_vertex_0     = 3415 + (625 << 16)
      fj_vertex_1     = 3450 + (650 << 16)
      fj_vertex_2     = 3450 + (700 << 16)
      fj_vertex_3     = 3415 + (676 << 16)
      STR_VAR
      fj_structure_type   = region
      fj_name             = Tran0540
      fj_destination_area = ag0540
      fj_destination_name = Exit0500
    END
    LPF fj_add_are_structure
      INT_VAR
      fj_loc_x       = 3490
      fj_loc_y       = 655
      fj_orientation = 10   //NE
      STR_VAR
      fj_structure_type = entrance
      fj_name           = Exit0540
    END
  END
BUT_ONLY

I have successfully used the new WEIDU function to add travel triggers, entrances and animations to areas. I have not tried actors, as the ones I add always had a condition with them (ChapterGT...InParty("xxxc") etc


The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*

 


#5 Creepin

Creepin
  • Administrator
  • 1676 posts

Posted 30 September 2013 - 08:41 AM

Many thanks folks, your input is highly appreciated!

I wasn't even hoping for several solutions to learn and chose from, let alone having weidu doing all the dirty work for me :)

The Old Gold - v0.2 WIP (mod for BGT/BWP/BWS)