target_object procedure

Discuss the creation and scripting of new fan-made games and mods for the Fallout series of games.
Post Reply
Jargo
Respected
Respected
Posts: 85
Joined: Fri Dec 27, 2002 6:17 pm
Location: FMC (Poland)
Contact:

target_object procedure

Post by Jargo »

Anyone know what procedure "target_object" is doing in fallout script files ?
ABel
Scarf-wearing n00b
Scarf-wearing n00b
Posts: 33
Joined: Tue May 28, 2002 12:44 pm
Location: Krasnoyarsk, Russian Wasteland
Contact:

Post by ABel »

target_object is used in standard event-handlers pickup_p_proc, use_obj_on_p_proc and others. It indicates the object being affected by an action. For example, if your item-script contains

Code: Select all

function use_obj_on_p_proc;
begin
     write ('The item is used on '+GetName(target_object));
end;
then it can be used on other items or creatures and will display the name of that object.
Jargo
Respected
Respected
Posts: 85
Joined: Fri Dec 27, 2002 6:17 pm
Location: FMC (Poland)
Contact:

Post by Jargo »

Biiiig Thx ABel :D It will help me alot.

Then mayby you known parameters of this functions:
RegAnimFunc()
RegAnimAnimate()
Anim();
ABel
Scarf-wearing n00b
Scarf-wearing n00b
Posts: 33
Joined: Tue May 28, 2002 12:44 pm
Location: Krasnoyarsk, Russian Wasteland
Contact:

Post by ABel »

This article is based on "Script Animation-1" document by Communist.

To animate some action of a critter (punching, falling, running etc) it is sufficient to use the following sequence of commands:

Code: Select all

   { Sequencing Critter1 to make some actions: }
   RegAnimFunc &#40;2, <critter1_addr>&#41;; &#123; Exact purpose is unknown, &#125;
   RegAnimFunc &#40;1, 1&#41;; &#123; but this is how the animation is made in FO scripts. &#125;
   RegAnimAnimate &#40;<critter1_addr>, <action1_id>, -1&#41;; &#123; Critter1 does Action1 &#125;
   RegAnimAnimate &#40;<critter1_addr>, <action2_id>, -1&#41;; &#123; Critter1 does Action2 &#125;
   ... and so on ...
   RegAnimAnimate &#40;<critter1_addr>, <actionN_id>, -1&#41;; &#123; Critter1 does ActionN &#125;
   RegAnimFunc &#40;3, 0&#41;; &#123; This is also a standard call. &#125;

   &#123; Sequencing Critter2&#58; &#125;
   RegAnimFunc &#40;2, <critter2_addr>&#41;;
   RegAnimFunc &#40;1, 1&#41;;
   RegAnimAnimate &#40;<critter2_addr>, <actionI_id>, -1&#41;;
   RegAnimAnimate &#40;<critter2_addr>, <actionJ_id>, -1&#41;;
   ...
   RegAnimAnimate &#40;<critter2_addr>, <actionK_id>, -1&#41;;
   RegAnimFunc &#40;3, 0&#41;;

   &#123; Sequencing Critter3&#58; &#125;
   ...
In the above fragment, critter_addr is the address of any critter, for example, it could be Player (to make Chosen One dance), Self (in some creature's script) and so on.
Action_ids are determined from the following table:

Code: Select all

  AA  0     AK  10     BA  20     BK  30
  AB  1     AL  11     BB  21     BL  31
  AC  2     AM  12     BC  22     BM  32
  AD  3     AN  13     BD  23     BN  33
  AE  4     AO  14     BE  24     BO  34
  AF  5     AP  15     BF  25     BP  35
  AG  6     AQ  16     BG  26     CH  36
  AH  7     AR  17     BH  27     CJ  37
  AI  8     AS  18     BI  28     GC  38
  AJ  9     AT  19     BJ  29
The two letters here correspond to the suffix of a critter's FRM file, which visualizes the action.
Number in the second column is action_id of that action. For example, to show a punching Chosen One, the following code can be used:

Code: Select all

   RegAnimFunc &#40;2, Player&#41;;
   RegAnimFunc &#40;1, 1&#41;;
   RegAnimAnimate &#40;Player, 16, -1&#41;; &#123; *** from table&#58; 16 = AQ *** &#125;
   RegAnimFunc &#40;3, 0&#41;;
FRM file with punching tribal is called "HMWARRAQ.FRM", where HMWARR means "a tribal", and AQ - "punching". This is why 16 is used in this fragment.

When RegAnim* code is executed, all the critters in question start to make specified actions at the same time.
For example, critter1 is punching, and critter2 is evading meanwhile.
But separate actions are made by any given critter strictly successive.

In addition to RegAnimAnimate opcode there are

Code: Select all

   RegAnimObjMoveToTile &#40;<critter_addr>, <tile_number>, -1&#41;; - walking to specified tile
   RegAnimObjRunToTile &#40;<critter_addr>, <tile_number>, -1&#41;; - running to a tile
   RegAnimAnimateReverse &#40;<critter_addr>, <action_id>, -1&#41;; - reverse animation for an action
and some other.
Also there are SfxBuildCharName and RegAnimPlaySfx opcodes that allow to add sound effects to actions.
Jargo
Respected
Respected
Posts: 85
Joined: Fri Dec 27, 2002 6:17 pm
Location: FMC (Poland)
Contact:

Post by Jargo »

Super !!!!
You re de best ABel :)
Is this document "Script Animation-1" by Communist on site of TeamX or on other site ?
ABel
Scarf-wearing n00b
Scarf-wearing n00b
Posts: 33
Joined: Tue May 28, 2002 12:44 pm
Location: Krasnoyarsk, Russian Wasteland
Contact:

Post by ABel »

This document is still not finished. The translation I posted is the only accessible version of this info.
Our Host!
Post Reply