Armed Critters

dude_obj

Vault Senior Citizen
Moderator
I was testing my mod, and I had placed a punch dagger on the ground in toxic caves (as loot to be found). I was surprised to find that a gecko picked up the weapon and used it! The gecko has a punch attack and it is an punching weapon, but I didn't know critters like geckos could do this.

I had another situation where I had placed a gold nugget hidden in the last room of the temple of trials (more loot). When I started to fight cameron, he ran over and grabbed the gold nugget and threw it at me.

Ever seen any non-humanoid critters pick up weapons and use them? It seems like the game engine has generic code that makes a critter pick up any weapon it can use if doesn't have one already. If this is the case then the critter scripts should probably be changed to not allow this (could be done by forcing them to drop weapons they pick up).

Funny, I made a punch gun earlier that used shotgun shells, didn't put it in my mod, but if it was there then the gecko could unload 12-guage shells into you at short range.

Forget the right to bear arms, I think we should have the right to arm bears :lol:
 
Mod Whore said:
hey dude any idea how far along are ya now in terms of releasing this mod?

My version number is alpha 7-1. It could be released now as beta but I don't want to piss people off with bugs. We made some significant changes recently and I don't like the idea of release without at least initial testing. The following seems to be working already:

80+ new weapons
- inventory and ground images from FoT
- projectile animations from FoT (boomerangs, throwing stars etc)
- explosion animations from FoT
- real gun sounds extracted from videos of actual guns firing
- new weapon calibers
- new ammo types

13 new critters including cockroaches, wasp, sewer rat, gila monster lizard, dog, wolf, cyborg, 4 new bots, and the FO1 lieutenant model
- cockroaches have spit projectile
- lootable hides: lizard, wasp stinger, roach guts, plus fire gecko pelts
- new critters play stand (fidget) and walk sounds when roaming before they see you, and they play their run sound on their combat turn. This adds a really cool effect in areas and in combat!
- kill type counters changed to be more generic to accomodate the new critters (reptiles, rodents, etc)
- new called shot body part names and critical hit messages for new critters
- new AI packets for new critters
- all original critters have double their HP and more AP

New world map is real satellite image of northern california
- Future version will include the southern half with aged FO1 locations
- Entirely new random encounters
- Every random encounter has changed except special ones
- Critters in encounters use new weapons
- New critters show up in many encounters
- Caravans and patrol have dogs and trained wolves on their team

- Changes to almost all original maps
- Almost everyone in the game has a new weapon
- Different loot all over the place
- New critters all over like wasps flying around cities

Since there are so many changes I've been hesitant to release anything, even though the game is definitely playable already. Fixing some minor bugs at the moment, but probably will be releasing a beta within a week, maybe two. I am looking for beta testers to give feedback on strange behavior and bugs.
 
dude_obj said:
I was testing my mod, and I had placed a punch dagger on the ground in toxic caves (as loot to be found). I was surprised to find that a gecko picked up the weapon and used it! The gecko has a punch attack and it is an punching weapon, but I didn't know critters like geckos could do this.

Maybe after seven years the geckos evolved and learned to use tools? :D

Anyhow, I suppose a critter will use any weapon that it has anims for, and unarmed weapons require no additional anims beyound the standard one. I didn't know, however, that geckos had anims for picking up stuff.

It must be random, I was always annoyed at NPC's not picking up their Spears after being thrown etc.

dude_obj said:
Forget the right to bear arms, I think we should have the right to arm bears :lol:

:lol:
 
Silencer said:
I didn't know, however, that geckos had anims for picking up stuff.

I have a spreadsheet with all of the available animations. The "magic hands ground" animation is the one for picking things up. These non-humanoid critters have that animation: geckos, deathclaws, super mutants, cyberdog, brainbot. Then of the FoT critters that wild_qwerty converted, these also have it: scurry, security, and behemoth robots, cyborg, and what was supposed to be deathclaws.

The gecko with the punch dagger reminded me of the old sylvester the cat cartoon where he's showing his son how to catch mice but runs into a kangeroo (hippity hopper) with boxing gloves:

http://home.wi.rr.com/tatay/cartoons/hippety087.jpg

Oh father, I'm so ashamed ...
 
Uh, if the mod is gonna have over 80 new weapons and new critters, shouldn´t it make the infamous "too many items" bug happen more often?
 
Skynet said:
Uh, if the mod is gonna have over 80 new weapons and new critters, shouldn´t it make the infamous "too many items" bug happen more often?

Well most of the restocking scripts have been changed, and stores do not have all of the items, there is a chance they will have an item, and there is also randomization of which weapon of a type (SMG etc) will be restocked. So far I have not run into the "too many items" bug, but it has been suggested by corpse that I change the restocking scripts further to delete stuff from store inventories periodically. I will probably add the item destroying changes in the 1.0 version after beta testing. The new critters should not be a problem because they all get destroyed as you play through the areas.
 
just make sure the scripts do not delete quest items. It would suck if someone sold a quest item and then the shop deleted it...
 
Wild_qwerty said:
just make sure the scripts do not delete quest items. It would suck if someone sold a quest item and then the shop deleted it...

Okay I have this figured out ... how to get rid of all items in store inventory but quest items ... then run the restocking commands. I made a new command objpid_is_quest_item and added it to the command.h header. Then in the store script, before restocking, I do this:

// Destroy all non quest items
pid_counter:=0;
while (pid_counter < 1000) do begin
pid_counter := pid_counter + 1;
if not objpid_is_quest_item(pid_counter) then begin
item_qty := obj_is_carrying_obj_pid(self_obj, pid_counter);
if (item_qty) then begin
item_ptr := obj_carrying_pid_obj(self_obj, pid_counter);
removed_qty := rm_mult_objs_from_inven(self_obj, item_ptr, item_qty);
destroy_object(item_ptr);
end
end
end

check_restock_item(PID_BOTTLE_CAPS, 150, 1000, 100)
etc ...

I tested it and it seems to work fine. It did not destroy vic's water flask or the temple key, but it did destroy flowers, broken bottles, lighter etc. Then it did its restock. This also makes the inventory more random because in my store scripts I do things like this:

check_restock_item(random(816,822), 0, 1, 70) // random spear
check_restock_item(random(827,835), 0, 1, 70) // random punching weapon
check_restock_item(random(851,859), 0, 1, 70) // random thrown weapon

This should take care of the "too many items" bug caused by excessive selling to stores. The command to check if quest item is below. I'm working on similar commands to do better randomization of store inventories, and also loot that you find. The loot should be random if its not a quest item. Every time you play you should find different things, ideally in different places. I'm working on this ....


#define objpid_is_quest_item(x) ((x == PID_KEY) OR \
(x == PID_KEYS) OR \
(x == PID_JAIL_KEY) OR \
(x == PID_NUKE_KEY) OR \
(x == PID_TRAPPER_TOWN_KEY) OR \
(x == PID_TEMPLE_KEY) OR \
(x == PID_VAULT_13_SHACK_KEY) OR \
(x == PID_CELL_DOOR_KEY) OR \
(x == PID_RED_PASS_KEY) OR \
(x == PID_BLUE_PASS_KEY) OR \
(x == PID_YELLOW_PASS_KEY) OR \
(x == PID_YELLOW_REACTOR_KEYCARD) OR \
(x == PID_RED_REACTOR_KEYCARD) OR \
(x == PID_V15_KEYCARD) OR \
(x == PID_TANKER_FOB) OR \
(x == PID_ACCESS_CARD) OR \
(x == PID_SECURITY_CARD) OR \
(x == PID_PRESIDENTIAL_PASS) OR \
(x == PID_PRES_ACCESS_KEY) OR \
(x == PID_DAY_PASS) OR \
(x == PID_FAKE_CITIZENSHIP) OR \
(x == PID_STABLES_ID_BADGE) OR \
(x == PID_DR_HENRY_PAPERS) OR \
(x == PID_BECKY_BOOK) OR \
(x == PID_ACCOUNT_BOOK) OR \
(x == PID_ENLIGHTENED_ONE_LETTER) OR \
(x == PID_MEMO_FROM_FRANCIS) OR \
(x == PID_RAIDERS_MAP) OR \
(x == PID_SURVEY_MAP) OR \
(x == PID_VERTIBIRD_PLANS) OR \
(x == PID_DERMAL_PIP_BOY_DISK) OR \
(x == PID_PIP_BOY_MEDICAL_ENHANCER) OR \
(x == PID_ELRON_MEMBER_HOLO) OR \
(x == PID_ECON_HOLODISK) OR \
(x == PID_HOLODISK) OR \
(x == PID_HOLODISK_FAKE_V13) OR \
(x == PID_GECKO_DATA_DISK) OR \
(x == PID_REACTOR_DATA_DISK) OR \
(x == PID_BISHOPS_HOLODISK) OR \
(x == PID_ENCLAVE_HOLODISK_1) OR \
(x == PID_ENCLAVE_HOLODISK_2) OR \
(x == PID_ENCLAVE_HOLODISK_3) OR \
(x == PID_ENCLAVE_HOLODISK_4) OR \
(x == PID_ENCLAVE_HOLODISK_5) OR \
(x == PID_EVACUATION_HOLODISK) OR \
(x == PID_EXPERIMENT_HOLODISK) OR \
(x == PID_MEDICAL_HOLODISK) OR \
(x == PID_PASSWORD_HOLODISK) OR \
(x == PID_BROADCAST_HOLODISK) OR \
(x == PID_SIERRA_MISSION_HOLODISK) OR \
(x == PID_NCR_HISTORY_HOLODISK) OR \
(x == PID_LYNETTE_HOLO) OR \
(x == PID_WESTIN_HOLO) OR \
(x == PID_SPY_HOLO) OR \
(x == PID_ELRON_MEMBER_HOLO) OR \
(x == PID_ELRON_TEACH_HOLO) OR \
(x == PID_DOG_TAGS) OR \
(x == PID_BLONDIE_DOG_TAG) OR \
(x == PID_ANGEL_EYES_DOG_TAG) OR \
(x == PID_TUCO_DOG_TAG) OR \
(x == PID_WATCH) OR \
(x == PID_GOLD_LOCKET) OR \
(x == PID_ANNA_GOLD_LOCKET) OR \
(x == PID_CORNELIUS_GOLD_WATCH) OR \
(x == PID_TALISMAN) OR \
(x == PID_VIC_RADIO) OR \
(x == PID_VIC_WATER_FLASK) OR \
(x == PID_EMPTY_JET) OR \
(x == PID_OXYGEN_TANK) OR \
(x == PID_POISON_TANK) OR \
(x == PID_GECK) OR \
(x == PID_V15_COMPUTER_PART) OR \
(x == PID_NAV_COMPUTER_PARTS) OR \
(x == PID_COMPUTER_VOICE_MODULE) OR \
(x == PID_CAR_FUEL_CELL_CONTROLLER) OR \
(x == PID_CAR_FUEL_INJECTION) OR \
(x == PID_PLASMA_TRANSFORMER) OR \
(x == PID_EXCAVATOR_CHIP) OR \
(x == PID_SUPER_TOOL_KIT) OR \
(x == PID_MOTIVATOR) OR \
(x == PID_K9_MOTIVATOR) OR \
(x == PID_HY_MAG_PART) OR \
(x == PID_MINE_PART) OR \
(x == PID_BRIEFCASE) OR \
(x == PID_MOORE_BAD_BRIEFCASE) OR \
(x == PID_MOORE_GOOD_BRIEFCASE) OR \
(x == PID_RAMIREZ_BOX_CLOSED) OR \
(x == PID_RAMIREZ_BOX_OPEN) OR \
(x == PID_PSYCHIC_NULLIFIER) OR \
(x == PID_MR_NIXON_DOLL) OR \
(x == PID_SPECTACLES) OR \
(x == PID_MIRROR_SHADES) OR \
(x == PID_DIXON_EYE) OR \
(x == PID_CLIFTON_EYE) OR \
(x == PID_CYBERNETIC_BRAIN) OR \
(x == PID_HUMAN_BRAIN) OR \
(x == PID_CHIMP_BRAIN) OR \
(x == PID_ABNORMAL_BRAIN) OR \
(x == PID_BIO_GEL) OR \
(x == PID_SMITTY_MEAL) OR \
(x == PID_MEM_CHIP_BLUE) OR \
(x == PID_MEM_CHIP_GREEN) OR \
(x == PID_MEM_CHIP_RED) OR \
(x == PID_MEM_CHIP_YELLOW))
 
to dude_obj

>>- new weapon calibers

How did you do it?


As for your code. Why don`t use:
if obj_item_subtype(item)==item_type_misc_item or obj_item_subtype(item)==item_type_key_item then ...
 
Raven_2 said:
to dude_obj>>- new weapon calibers
How did you do it?

http://www.nma-fallout.com/forum/viewtopic.php?t=11149

Raven_2 said:
As for your code. Why don`t use:
if obj_item_subtype(item)==item_type_misc_item or obj_item_subtype(item)==item_type_key_item then

A misc item might be a quest item or it might not be. A flower and the geck are both misc items. There is no way to distinguish them other than having a list of which ones are important. I could have used the key subtype check but its already done ...

EDIT: Okay, you made a good point, I took the keys out of the list and used the key item subtype check for those. The rest of the items need to be listed.
 
>> http://www.nma-fallout.com/forum/viewtopic.php?t=11149

Damn. I dig from the wrong side :-) There is a table _cal_type_strs (name from Abel name .idc) in Mapper.exe, it`s contain pointers to strings with caliber names and it`s only can contain up to 19 pointers.

Mapper hard-limit on caliber is here:
0x92aeb [13]

If you set to greater value,the "<ERROR>" message would be replaced with "" and proto editing would be work fine with such protos. But there is no entry for your own calibers in this list, there simply no space in pointer table for 20 entry.

Is it possible to move this table to another adress, where would be enough memory for greater table and change all xrefs to it on new value?

[EDIT]
Um. Forgot another offset.
>>0x92aeb [13h]
that was for weapon protos

For ammo:
0x92c09 [13h]

[EDIT 2]

BTW, I found where explosion radius for grenades (2) and rockets (3) stored and where penalty for called shots stored. Also found penalty from radiation tables. All for mapper.exe. Do you need such stuff for your mod? I can search fallout.exe for this, then.
 
You can add more caliber entries on the table though it may not be necessary at all.

{300}{}{None}
{301}{}{Rocket}
{302}{}{Flamethrower Fuel}
{303}{}{C Energy Cell}
{304}{}{D Energy Cell}
{305}{}{.223}
{306}{}{5mm}
{307}{}{.40 cal}
{308}{}{10mm}
{309}{}{.44 cal}
{310}{}{14mm}
{311}{}{12-gauge}
{312}{}{9mm}
{313}{}{BB}
{314}{}{.45 cal}
{315}{}{2mm}
{316}{}{4.7mm caseless}
{317}{}{HN needler}
{318}{}{7.62mm}

#
# Race Types
#
{350}{}{Caucasian}
{351}{}{African}

If you look at the end of caliber types, between the last entry and the first entry for Race Types there is a big gap; you can fill it all the way, giving you a total of 31 different caliber types you could add.
 
Total num of calibers are harcoded. Adding entries in the proto.msg does nothing.

Mapper load only first 19 entries, others simply don`t fit. We can change this limit so the maper could read protos with cal>12h. But we can`t add new entries into the "Select calber menu" menu in mapper cause there is no place in exe table for such stuff. As far as I understand :-)

Disasm from Mapper.exe:
Code:
.bss:0072CE8C _cal_type_strs  dd 4FDBFF8h ; pointer to string "None"
.bss:0072CE90                 dd 4FDC040h ; pointer to string "Rocket"
<...>
.bss:0072CED4                 dd 4FDC580h ; pointer to string "7.62 mm"
.bss:0072CED8 _perk_code_strs dd 72C350h ; next table started
 
Raven_2 said:
I found where explosion radius for grenades (2) and rockets (3) stored and where penalty for called shots stored. Also found penalty from radiation tables. All for mapper.exe. Do you need such stuff for your mod? I can search fallout.exe for this, then.

The more information we have about the engine the better. Right now I have to do hex editing of protos for new weapon calibers (and ammo PID for those with changed calibers), and new weapon sounds. Its a pain but its not that bad to deal with. For this kind of thing I think it would be better to write a new prototype editor rather than patching the engine and/or mapper. These are not really engine issues, they are prototype issues, and the only problem is that the mapper doesn't allow selecting the new values. The proto editor in the mapper is very clunky anyways, so it would be nice to have a better one.

Aside from that, the things that bug me the most are:

1) Inability to add new damage types (poison, diseases, etc)

2) Inability to specify damage type for ammo (instead of weapon). If we had this ability we could make things like poison ammunition.

3) Inability to add new animation codes (there are hard-coded pistol, rifle, sledge, etc). I tried adding a new one but it didn't work.

Unfortunately I don't think there is much we can do about these.

It would be nice to know more about exactly how the combat works in the engine, how the rolls are calculated, how damage is calculated, critical hits etc. If that could be found in the executable it would be good information to have.
 
Raven_2 said:
Total num of calibers are harcoded. Adding entries in the proto.msg does nothing.

Mapper load only first 19 entries, others simply don`t fit. We can change this limit so the maper could read protos with cal>12h. But we can`t add new entries into the "Select calber menu" menu in mapper cause there is no place in exe table for such stuff. As far as I understand :-)

Disasm from Mapper.exe:
Code:
.bss:0072CE8C _cal_type_strs  dd 4FDBFF8h ; pointer to string "None"
.bss:0072CE90                 dd 4FDC040h ; pointer to string "Rocket"
<...>
.bss:0072CED4                 dd 4FDC580h ; pointer to string "7.62 mm"
.bss:0072CED8 _perk_code_strs dd 72C350h ; next table started

That's true, but we have got around this problem by editing any weapon prototypes that uses new calibers on a hex editor.
 
>>The more information we have about the engine the better.

Offsets (Fallou2 1.02d, english)

0x69583 [02] - grenade damage radius
0x69587 [03] - rocket damage radius

0xfef54 - _hit_location_penalty table (called shot penalties):
Code:
            D8 FF FF FF-E2 FF FF FF E2 FF FF FF
00 00 00 00 EC FF FF FF-EC FF FF FF C4 FF FF FF
E2 FF FF FF 00 00 00 00

There is 9 dword values:
D8 FF FF FF == 0xffffffd8 == -40 - head
E2 FF FF FF == 0xffffffe2 == -30 - hand
E2 FF FF FF == 0xffffffe2 == -30 - hand
00 00 00 00 == 0x00000000 == 0 - body
EC FF FF FF == 0xffffffec == -20 - leg
EC FF FF FF == 0xffffffec == -20 - leg
C4 FF FF FF == 0xffffffc4 == -60 - eyes
E2 FF FF FF == 0xffffffe2 == -30 - groin
00 00 00 00 == 0x00000000 == 0 - penalty for *non-called* shot

All penalties are halfed for HtH combat.

About radiation stuff and perks ... later. Not have much time for now...
 
0x1083cc - start of _perk_data table

Perks, that have no used in Fallout2 and can be replaced by your own perks:
0x108bd0 - "Mental block" perk
0x108e7c - "ERROR -- UNIMPED" perk :-)
0x1087ac - "Scrounger" perk
0x109944 - "Flower child" perk
0x1090dc - "Animal friend" perk

I think this would be enough for begining.

How to replace this some of this perks with your own (Animal friend for example).

Go to 0x10909c. Whole perk entry is 19 dwords (76 bytes).

00 00 00 00 00 00 00 00

Skip first 8 bytes (filled with 0).

74 00 00 00

Change this dword to your .frm number for this perk from data/art/skilldex/skilldex.lst. If your frm is on the 172 line then you need to write 171==AB==AB 00 00 00 instead of 74 00 00 00.

01 00 00 00

Number of this perk you can gain (2 for Action boy, 3 for Bonus Melee damage ...).

36 01 00 00

Change this to minimum level requred to gain this perk. For 12 level you need to write 0c 00 00 00.

FF FF FF FF

Number of stat that would be modified (see define.h, STAT_* defines). 01 00 00 00 for Perception.

00 00 00 00

Value that would be added to this stat. You can make a penalty by writing something like FF FF FF FB.

11 00 00 00 | 19 00 00 00

Number and value of skill that would be modified.

00 00 00 00

? Type? Don`t change/set to 00 00 00 00.

FF FF FF FF | 00 00 00 00

Second skill.

00 00 00 00 | 00 00 00 00 | 00 00 00 00 | 00 00 00 00| 05 00 00 00 | 00 00 00 00 | 00 00 00 00

Stats (SPECIAL) requried for gain this perk. In>=5 for this. Also you can use something like this: FF FF FF F9 it`s equal to -6, condition is "stat < 6".
 
to dude_obj

>> For this kind of thing I think it would be better to write a new prototype editor rather than patching the engine and/or mapper.

Hm. Maybe Anchorite could write such tning... I know nothing about win GUI programming. I could write console-based editor only :-) I wrote simple proto-reader app not long ago (just for fun, it full parse only sceneries and give generic info about protos of other types). There is a lot of documentation about pro-files (if all types) by Bazik, Anchorite and Wasteland Ghost. But its all in russian :-)

>>1) Inability to add new damage types (poison, diseases, etc)

AFAIK that hardcoded and there is no way to change this because there is fixed number of damage DR/DT fields in armor pro-files. So for add new type of damage you should rewrite pieces of protoreading functions in .exe, update all armor prototypes and so on.

>>2) Inability to specify damage type for ammo (instead of weapon). If we had this ability we could make things like poison ammunition.

Forgetaboutit. There simply no poison/rad counter for anyone except dude_obj. So you can`t poison other critters. Thats why envenoum of weapon in NV just add max damage.

>>3) Inability to add new animation codes (there are hard-coded pistol, rifle, sledge, etc). I tried adding a new one but it didn't work.

Know nothing about this. I'll post this to fallmods-tech (russian mailing list for FO R&D), maybe anyone work on this.

>>It would be nice to know more about exactly how the combat works in the engine, how the rolls are calculated, how damage is calculated, critical hits etc.

AFAIK, FO combat system is very close to FO PnP. There is document in russian (i don`t know ehre it goes from, but I found it long before PnP was released) that describe how to hit and damage are calculated. What exactly you need?

Also, I know where the crittical success/failure effects tables are located in .exe, but I know not their format for now.
 
Here's a couple of other things I'd like to know ...

We have these sfx animations from FoT that are explosions and other special effects. I'm using the explosions already, but only as replacements for the original fallout explosions. I'd like to know how to play an sfx animation directly in script code. So far I haven't found a way to do this. The trapped containers and doors have code like this:

explosion(tile_num(self_obj), elevation(self_obj), Trap_Damage);

I assume that the engine plays the explosion animation, but I'd like to know if there is a way to trigger those animations from a script. This would allow some interesting new effects. Unlike the reg_anim commands, it looks like the engine determines the FRM graphic to play for these effects. If I have new ones, how to trigger them?

The other thing is how the engine handles books. There are no scripts for most of the books (guns and bullets etc). As far as I can tell it does an item PID number check, because if I clone one of the books and move it to a new PID number it no longer works. We have figured out how to make new books using scripting, but the method of destroying the book (after its read) isn't quite right because the book will not disappear until the inventory screen is closed. We had to pass a pointer to the book object to the obj_dude script to make this work. I wonder how the engine does the destroying of books.

Another similar issue is the "active" items, which are flares, dynamite, plastic explosives, motion detector, stealth boy, and geiger counter. These must also be hard coded to check PID number. And they are interesting because they animate when armed or turned on. It would be interesting to know how that works. Like the books, if I move (clone) the prototypes they will not work at a different PID number. It would be nice to be able to make new active items, but I'm not sure this is possible.
 
Back
Top