Jump to content


Photo

Question to adding actor to area: name from setup.tra?


10 replies to this topic

#1 jastey

jastey
  • Gibberlings
  • 6937 posts
  • Gender:Female

Posted 12 August 2017 - 08:21 AM

I don't add actors via tp2 into areas, so I have no experience with this. This is what Jarl's Adventure Pack does. My problem is: the name ~Gast~ would have to be ~Guest~ in English. But using the string from the setup.tra (I tried @2120 without quotation marks) doesn't work.

 

How would I do this?

COPY_EXISTING ~AR7227.ARE~ ~override~
PATCH_IF (SOURCE_SIZE > 0x11b) BEGIN         //Invalid file protection

  LAUNCH_PATCH_MACRO ~Q_ARE_InitVars~
  LAUNCH_PATCH_MACRO ~Q_AREAdd_InitVars~
  SET "Q_New_Actor" = 10
  SET "Q_New_Ambie" = 1
  SET "Q_New_Anima" = 8
  LAUNCH_PATCH_MACRO ~Q_AREAdd_Process~

// Add Actor 1
  WRITE_ASCII "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0)               ~Gast~      #32 // Name
  WRITE_ASCII "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x80        ~JA#DOPP0~         #8  // CRE
  WRITE_ASCII "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x48        ~JA#DOPP0~       #8  // DLG
  WRITE_LONG  "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x38        0xffffffff              // Unknown
  WRITE_SHORT "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x20        1103                     // Pos X
  WRITE_SHORT "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x22        587                    // Pos Y
  WRITE_SHORT "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x24        1103                       // Des X
  WRITE_SHORT "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x26        587                       // Des Y
  WRITE_SHORT "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x34        11                        // Orientation
  WRITE_LONG  "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x40        0x00ffffff             // Present
  WRITE_SHORT "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x28        1                       // Visible

(...)


#2 argent77

argent77
  • Modders
  • 730 posts
  • Gender:Male

Posted 12 August 2017 - 08:52 AM

I would advise against using a translation string for an ARE actor name. It's basically the ARE counterpart of a CRE script name for scripting purposes. If you're still willing to use a tra reference you can try SPRINT:

COPY_EXISTING ~ar7227.are~ ~override~
  SPRINT actorName @2120
  // ...
  WRITE_ASCIIE offset ~%actorName%~ #32

Btw, I would strongly recommend to use the WeiDU function fj_are_structure to add (or remove) all kinds of area structures, including actors. In your case it would look something like this:

COPY_EXISTING ~ar7227.are~ ~override~
  LPF fj_are_structure
  INT_VAR
    fj_loc_x          = 1103
    fj_loc_y          = 587
    fj_orientation    = 11
  STR_VAR
    fj_structure_type = "actor"
    fj_name           = "Gast"    // or use fj_name = EVAL "%actorName%" if you still want to use the tra reference from above
    fj_cre_resref     = "JA#DOPP0"
    fj_dlg_resref     = "JA#DOPP0"
  END

More info in the WeiDU docs.


Edited by argent77, 12 August 2017 - 08:58 AM.


#3 Gwendolyne

Gwendolyne
  • Members
  • 153 posts
  • Gender:Male
  • Location:France

Posted 12 August 2017 - 09:04 AM

Deleted.

 

Argent77 was faster.


Edited by Gwendolyne, 12 August 2017 - 09:06 AM.

CARPE DIEM...



In progress : Menace sur le Royaume de Diamant Éternel

#4 Roxanne

Roxanne

    Modder

  • Modders
  • 1633 posts
  • Gender:Female
  • Location:Auckland, NZ

Posted 12 August 2017 - 09:10 AM

 

I don't add actors via tp2 into areas, so I have no experience with this. This is what Jarl's Adventure Pack does. My problem is: the name ~Gast~ would have to be ~Guest~ in English. But using the string from the setup.tra (I tried @2120 without quotation marks) doesn't work.

 

How would I do this?

COPY_EXISTING ~AR7227.ARE~ ~override~
PATCH_IF (SOURCE_SIZE > 0x11b) BEGIN         //Invalid file protection

  LAUNCH_PATCH_MACRO ~Q_ARE_InitVars~
  LAUNCH_PATCH_MACRO ~Q_AREAdd_InitVars~
  SET "Q_New_Actor" = 10
  SET "Q_New_Ambie" = 1
  SET "Q_New_Anima" = 8
  LAUNCH_PATCH_MACRO ~Q_AREAdd_Process~

// Add Actor 1
  WRITE_ASCII "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0)               ~Gast~      #32 // Name
  WRITE_ASCII "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x80        ~JA#DOPP0~         #8  // CRE
  WRITE_ASCII "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x48        ~JA#DOPP0~       #8  // DLG
  WRITE_LONG  "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x38        0xffffffff              // Unknown
  WRITE_SHORT "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x20        1103                     // Pos X
  WRITE_SHORT "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x22        587                    // Pos Y
  WRITE_SHORT "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x24        1103                       // Des X
  WRITE_SHORT "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x26        587                       // Des Y
  WRITE_SHORT "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x34        11                        // Orientation
  WRITE_LONG  "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x40        0x00ffffff             // Present
  WRITE_SHORT "Q_NewOffset_Actor" + ("Q_Siz_Actor" * 0) + 0x28        1                       // Visible

(...)

Another mystery solved.

This is how the mod managed to create creatures on top of existing creatures to make the originals unusable. Using simple area scripts to create mod cretures would have prevented those bugs.

Hope if you now take care of Jarl's Incompatibility Pack, you also take care of these issues. Or the removal of vanilla NPCs from vanilla areas, which was another issue of this mod.


The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#5 jastey

jastey
  • Gibberlings
  • 6937 posts
  • Gender:Female

Posted 12 August 2017 - 09:36 AM

Thank you for the example code Argent (and Gwendolyne).
Roxanne: well, looking at the amount of work I am not sure what / how much I'll do, but I am looking at compatibility with bg1re and bg1npc currently at least.
The actors added to areas I *have* to do something about, because currently they have all German names.

#6 lynx

lynx
  • Modders
  • 3021 posts
  • Gender:Male
  • Location:Ljubljana, Slovenija

Posted 12 August 2017 - 09:42 AM

I think they were trying to say this isn't their short or long name, but the script name. So no need to translate this, but change the actual CREs it is referencing. Could likely cause problems in scripts and dialogs if they wouldn't be using the same thing.


GemRB - IE anywhere.
Mages needed! Looking for Planescape: Torment testers
Market android version IS NOT SUPPORTED ANYMORE: reported bugs will be ignored! Still looking for builders ...

#7 jastey

jastey
  • Gibberlings
  • 6937 posts
  • Gender:Female

Posted 12 August 2017 - 10:47 AM

You are right, it's not the name you see when meeting the creature ingame. But it isn't the script name, either. It's a name I see in NI when looking at the are file. Thank you for drawing my attention to this, because this I can ignore (and that saves me a *lot* of work.)



#8 Ardanis

Ardanis

    A very GAR character

  • Modders
  • 2557 posts
  • Gender:Male
  • Location:Saint-Petersburg, Russia

Posted 12 August 2017 - 12:17 PM

For containers, triggers, doors etc. "fj_name" is how you reference them with TriggerActivation(), OpenDoor() etc., so technically it is indeed a script name. The catch is that actor's .cre file may have their own, and by default is the one that game uses for script purposes. It's possible to have "fj_name" override it with BIT3 (?) flag, although I don't remember if it's EE-only feature or not.


"Uguu~ Boku Ayu."

Before you start breaking wall tiles with your bare fists, ask yourself first - do you truly need it?

#9 Roxanne

Roxanne

    Modder

  • Modders
  • 1633 posts
  • Gender:Female
  • Location:Auckland, NZ

Posted 12 August 2017 - 12:28 PM

For containers, triggers, doors etc. "fj_name" is how you reference them with TriggerActivation(), OpenDoor() etc., so technically it is indeed a script name. The catch is that actor's .cre file may have their own, and by default is the one that game uses for script purposes. It's possible to have "fj_name" override it with BIT3 (?) flag, although I don't remember if it's EE-only feature or not.

It is *Override Script Name*, Flag(3) in the are-file. If the flag is set, the name given in the are file (or the fj_name if the cre is added this way) becomes the script name (DV) regardless of what the cre-file has in that place. This may be intended in specific cases, but mostly is used when you want to give a generic creature a distinct script name for the one case in the one area.

Under *normal* circumstances, for creatures the fj_name may be just something like actor1, actor2 and the more important one would be fj_cre_resref  which is your creature-file (and which has all the other stuff like name, script name etc in it).


The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#10 Roxanne

Roxanne

    Modder

  • Modders
  • 1633 posts
  • Gender:Female
  • Location:Auckland, NZ

Posted 13 August 2017 - 08:46 AM

Just some hints concerning Jarl's Incompatibility Pack:

- check BWFixpack for a large number of fixes for the mod >>> Big World Fixpack/JA#BGT_AdvPack

- check also Area_Patcher for fixes to known issues with the mod

 

PS - a practical way could be to start work on a version you first patched with BWFixpack. https://github.com/B...hive/master.zip


Edited by Roxanne, 13 August 2017 - 08:49 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#11 jastey

jastey
  • Gibberlings
  • 6937 posts
  • Gender:Female

Posted 13 August 2017 - 10:45 AM

I integrated the BWPFixpack fixes already. Which Area_Patcher you are referring to?

 

EDIT: And would you please use the mod's name and not a mock name. I get it that you don't have a high opinion of the used coding but that's no reason for trolling.


Edited by jastey, 13 August 2017 - 10:47 AM.




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users