target_object procedure
target_object procedure
Anyone know what procedure "target_object" is doing in fallout script files ?
-
- Scarf-wearing n00b
- Posts: 33
- Joined: Tue May 28, 2002 12:44 pm
- Location: Krasnoyarsk, Russian Wasteland
- Contact:
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
then it can be used on other items or creatures and will display the name of that object.
Code: Select all
function use_obj_on_p_proc;
begin
write ('The item is used on '+GetName(target_object));
end;
-
- Scarf-wearing n00b
- Posts: 33
- Joined: Tue May 28, 2002 12:44 pm
- Location: Krasnoyarsk, Russian Wasteland
- Contact:
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:
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: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: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 areand some other.
Also there are SfxBuildCharName and RegAnimPlaySfx opcodes that allow to add sound effects to actions.
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 (2, <critter1_addr>); { Exact purpose is unknown, }
RegAnimFunc (1, 1); { but this is how the animation is made in FO scripts. }
RegAnimAnimate (<critter1_addr>, <action1_id>, -1); { Critter1 does Action1 }
RegAnimAnimate (<critter1_addr>, <action2_id>, -1); { Critter1 does Action2 }
... and so on ...
RegAnimAnimate (<critter1_addr>, <actionN_id>, -1); { Critter1 does ActionN }
RegAnimFunc (3, 0); { This is also a standard call. }
{ Sequencing Critter2: }
RegAnimFunc (2, <critter2_addr>);
RegAnimFunc (1, 1);
RegAnimAnimate (<critter2_addr>, <actionI_id>, -1);
RegAnimAnimate (<critter2_addr>, <actionJ_id>, -1);
...
RegAnimAnimate (<critter2_addr>, <actionK_id>, -1);
RegAnimFunc (3, 0);
{ Sequencing Critter3: }
...
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
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 (2, Player);
RegAnimFunc (1, 1);
RegAnimAnimate (Player, 16, -1); { *** from table: 16 = AQ *** }
RegAnimFunc (3, 0);
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 (<critter_addr>, <tile_number>, -1); - walking to specified tile
RegAnimObjRunToTile (<critter_addr>, <tile_number>, -1); - running to a tile
RegAnimAnimateReverse (<critter_addr>, <action_id>, -1); - reverse animation for an action
Also there are SfxBuildCharName and RegAnimPlaySfx opcodes that allow to add sound effects to actions.