Usermade Animals and Ingame Toys

Got a question about APE that isn't answered in the tutorials? Ask it here! APE - the Animal Project Editor - designed for the original version of Zoo Tycoon.
Post Reply
JVM
zoo guest
Posts: 8
Joined: Sun May 22, 2016 5:43 am

Usermade Animals and Ingame Toys

Post by JVM »

My current zt1 project is a gibbon, and a few other primates, based on the ingame orangutan. This was based on hearing from rightEyElash about the Absolutely Apes exhibit at San Diego, which held siamang and orangutan in a mixed exhibit, but I broadened my interest into making a new gibbon as well. Part of the intent was to allow these animals to use the ingame orangutan toys - in particular, I feel the rope swing is a great fit for a gibbon.

Making them toy ready has been challenging. I contacted jbl89 who has been very helpful -- it looks that having them use the toys should be do-able, if risking compatibility issues, but I feel confident no other mods have affected or will affect orangutan toys, and I may release two files if need be, one which does not alter the ingame toys and/or a separate file with a new rope for these animals.

For now for me the focus is on the ingame toys. Any guidance to getting the toy working is appreciated. Below is my altered ai file compared to three other toy files.

Here is my alteration to the asirope.ai:
[Animations]
idle = objects/asirope/idle/idle.ani
used = objects/asirope/used/used.ani

[Satisfies]
building
animalrest

[slots]
name=slot1
name=slot2
name=slot3
name=slot4
name=slot5

[slot1]
;orangutan
id = 5506

slotpos = 0
slotpos = 0

entrpos = 32
entrpos = -144

exitpos = 32
exitpos = 144

capacity = 1
facing = 0

[slot2]
id = BCC7102D

slotpos = 0
slotpos = 0

entrpos = 32
entrpos = -144

exitpos = 32
exitpos = 144

capacity = 1
facing = 0

[slot3]
id = BCC1C030

slotpos = 0
slotpos = 0

entrpos = 32
entrpos = -144

exitpos = 32
exitpos = 144

capacity = 1
facing = 0

[slot4]
id = BCC4802D

slotpos = 0
slotpos = 0

entrpos = 32
entrpos = -144

exitpos = 32
exitpos = 144

capacity = 1
facing = 0

[slot5]
id = wcgibbon

slotpos = 0
slotpos = 0

entrpos = 32
entrpos = -144

exitpos = 32
exitpos = 144

capacity = 1
facing = 0
I can tell the ai file is read by the game because the cost changes (this is the only reason I changed that) but none of the animals with the new ids are using the toy. I copied the same info used by the orangutan section while adding slots for the new animals. For a while there were no [slot1] or [slot2] either.

I tried to compare with Taz's usermade toys:
[rockrftr]

[Icon]
Icon=objects/rockrftr/SE/SE
Icon=objects/rockrftr/SE/SE
Icon=objects/rockrftr/SE/SE
Icon=objects/rockrftr/SE/SE

[Member]
toys
aqua

[Characteristics/Integers]
cPurchaseCost=600
cNameID=19000
cHelpID=6509
cFootprintX=4
cFootprintY=4
cHabitat=9411
cCommerce=0
cSelectable=0
cMoveable=0
cDeletable=1
cHideUser=0
cUserStaysOutside=0
cHideBuilding=0
cCapacity=5
cTimeInside=9
cUsedThought=0
cUserUsesExit=1
cDeadOnLand=1
cUsesRealShadows=1
cHasShadowImages=1
cHasUnderwaterSection=1
cBlocksLOS=0
cSwims=1
cLand=0
cHeight=1
cToySatisfaction=2
cUseNumbersInName=0
cRubbleable=0
cDirectEntrance=1
cUnderwater=1
cSurface=1

[Characteristics/Strings]
cInfoImageName=scenery/building/inbldg/inbldg

[Animations]
idle=objects/rockraft/idle/idle.ani
used=objects/rockraft/idle/idle.ani
shadowidle=objects/rockraft/sidle/sidle.ani
underidle=objects/rockraft/uidle/uidle.ani
idledead=objects/rockraft/dead/dead.ani

[Satisfies]
building
animalrest

[slots]
name=slot1
name=slot2
name=slot3
name=slot4
name=slot5

[slot1]
slotpos=-32
slotpos=-32
entrpos=-32
entrpos=-65
exitpos=-32
exitpos=-65
capacity=1
facing=0
entranceonwater=1
exitonwater=1

[slot2]
slotpos=-32
slotpos=32
entrpos=-32
entrpos=65
exitpos=-32
exitpos=65
capacity=1
facing=4
entranceonwater=1
exitonwater=1

[slot3]
slotpos=32
slotpos=-32
entrpos=32
entrpos=-65
exitpos=32
exitpos=-65
capacity=1
facing=0
entranceonwater=1
exitonwater=1

[slot4]
slotpos=32
slotpos=32
entrpos=32
entrpos=65
exitpos=32
exitpos=65
capacity=1
facing=4
entranceonwater=1
exitonwater=1

[slot5]
slotpos=0
slotpos=0
entrpos=0
entrpos=-65
exitpos=0
exitpos=65
capacity=1
facing=0
entranceonwater=1
exitonwater=1

[defaultLCID]
LCID=1033

[Global]
Type=rockrftr

[1033]
cGeneralInfoFileName=objects/rockrftr/texts/1033.txt
cLongHelp = Certain animals will climb onto this floating raft to rest and relax. Only put this in a tank or exhibit if every animal in the tank or exhibit has a purchase menu tooltip saying they can use the Raft For Certain Animals. Other animals might get stuck trying to use this raft. MM or CC is needed to see the raft graphics.
cName = Raft For Certain Animals
cTheString = the Raft For Certain Animals
[icffcatz]

[Icon]
Icon=objects/icffcatz/se/se
Icon=objects/icffcatz/sw/sw
Icon=objects/icffcatz/nw/nw
Icon=objects/icffcatz/ne/ne

[Member]
toys
aqua

[Characteristics/Integers]
cPurchaseCost=600
cNameID=19000
cHelpID=6505
cFootprintX=4
cFootprintY=4
cHabitat=9411
cCommerce=0
cSelectable=0
cMoveable=0
cDeletable=1
cHideUser=0
cUserStaysOutside=0
cHideBuilding=0
cCapacity=5
cTimeInside=9
cUsedThought=0
cUserUsesExit=1
cDeadOnLand=1
cUsesRealShadows=1
cHasShadowImages=1
cHasUnderwaterSection=1
cBlocksLOS=0
cSwims=1
cLand=0
cHeight=1
cToySatisfaction=2
cUseNumbersInName=0
cRubbleable=0
cDirectEntrance=1
cUnderwater=1
cSurface=1

[Characteristics/Strings]
cInfoImageName=scenery/building/inbldg/inbldg

[Animations]
idle=objects/icffcatz/idle/idle.ani
used=objects/icffcatz/idle/idle.ani
shadowidle=objects/icffcatz/sdle/sdle.ani
underidle=objects/icffcatz/udle/udle.ani
idledead=objects/icffcatz/dead/dead.ani

[Satisfies]
building
animalrest

[slots]
name=slot1
name=slot2
name=slot3
name=slot4
name=slot5

[slot1]
slotpos=-32
slotpos=-32
entrpos=-32
entrpos=-65
exitpos=-32
exitpos=-65
capacity=1
facing=0
entranceonwater=1
exitonwater=1

[slot2]
slotpos=-32
slotpos=32
entrpos=-32
entrpos=65
exitpos=-32
exitpos=65
capacity=1
facing=4
entranceonwater=1
exitonwater=1

[slot3]
slotpos=32
slotpos=-32
entrpos=32
entrpos=-65
exitpos=32
exitpos=-65
capacity=1
facing=0
entranceonwater=1
exitonwater=1

[slot4]
slotpos=32
slotpos=32
entrpos=32
entrpos=65
exitpos=32
exitpos=65
capacity=1
facing=4
entranceonwater=1
exitonwater=1

[slot5]
slotpos=0
slotpos=0
entrpos=0
entrpos=-65
exitpos=0
exitpos=65
capacity=1
facing=0
entranceonwater=1
exitonwater=1

[defaultLCID]
LCID=1033

[Global]
Type=icffcatz

[1033]
cGeneralInfoFileName=objects/icffcatz/texts/1033.txt
cLongHelp = Certain animals will climb onto this ice floe to rest and relax. Only put this in a tank or exhibit if every animal in the tank or exhibit has a purchase menu tooltip saying they can use the Ice Floe For Certain Animals By Taz. Other animals might get stuck trying to use this ice floe.
cName = Ice Floe For Certain Animals By Taz
cTheString = the Ice Floe For Certain Animals By Taz
I also looked at the Asian Elephant Swinging Log, which I believe you made:
[Icon]
Icon = objects/swnglog/SE/SE
Icon = objects/swnglog/SW/SW
Icon = objects/swnglog/NW/NW
Icon = objects/swnglog/NE/NE

[Member]
toys

[Characteristics/Integers]
cPurchaseCost = 1200
cNameID = 19000
cHelpID = 6100
cFootprintX = 2
cFootprintY = 2
cHabitat = 9411
cCommerce = 0
cSelectable = 0
cDeletable = 1
cHideUser = 1
cUserStaysOutside = 0
cHideBuilding = 0
cCapacity = 1
cTimeInside = 14
cUsedThought = 0
cUserUsesExit = 1
cUserInAnim = 1
cUseNumbersInName=0
cHeight = 3
cToySatisfaction = 2

[Characteristics/Strings]
cInfoImageName = scenery/building/inbldg/inbldg

[Animations]
idle = idle
used = used

[defaultLCID]
LCID = 1033

[Global]
Type = swifaejy

[1033]
cGeneralInfoFileName = objects/zkbnfaea/texts/1033.txt
cLongHelp = Asian elephants love to use their prehensile trunk to play with the swinging log.
cName = Swinging Log For Asian Elephant
cTheString = the Swinging Log For Asian Elephant

[Satisfies]
building
animalrest

[slots]
name=slot

[slot]
id = 5081
filter = y
slotpos = 0
slotpos = 0
entrpos = 0
entrpos = -77
exitpos = 0
exitpos = -77
capacity = 1
facing = 0
So there are definitely differences in how slots are handled in each of these files, but I am not sure what is and isn't 'correct'. The original rope swing and the new asian elephant file definitely contained reference to the animal id, but neither of Taz's files seem to include ids, for example.
User avatar
Jay
african elephant keeper
Posts: 11552
Joined: Thu Jan 15, 2004 9:23 pm
Location: Orlando, FL (M:66)

Re: Usermade Animals and Ingame Toys

Post by Jay »

Toy configuration is complicated. Most of the toy configuration is the same as configuring guest buildings and shelters, especially buildings like the Stego Putt. When Blue Fang designed ZT, they did not make building and toy configuration as flexible as they should. So we are limited in what can be done. Blue Fang also changed how building and toy configuration is done in the ZT expansion packs compared to the original ZT, which included breaking some configuration that worked in the original ZT.

Raft For Certain Animals, Ice Floe For Certain Animals By Taz, and Swinging Log For Asian Elephant are configured properly. The configuration is based on what graphics were available.

When a slot has an "id=" line or multiple "id=" lines, that tells ZT what animals or guests can use that slot. When a slot does not have an "id=" line, that tells ZT that any animal or guest can use that slot. Ideally, a slot should not have an "id=" line. The above Raft and Ice Floe are examples of that. Since they do not have an "id=" line, it is possible for a designer to make a new animal in the future that uses them, without having to change the raft or ice floe configuration. The disadvantage is that an animal not configured to use the Raft or Ice Floe can get stuck trying to use them. That is why their "cLongHelp" setting is worded the way they are. Animals that can use the raft and ice floe do not need any special graphics. Usually the same graphics the animals use for lying or sitting on land will work.

The Swinging Log For Asian Elephant uses special graphics. The elephant's trunk has to move realistically in relation to the log. Blue Fang had created this special graphics for the Asian Elephant, but never finished or used the graphics. There were 2 ways to use the unused graphics. One way was to have the elephant/log interaction graphics inside the configuration of the Asian Elephant, which means a hack of the Asian Elephant would have to be created. The other way was to create a new swinging log and put the elephant/log interaction graphics in that swinging log configuration, which would not be a hack. When I have a choice of creating a hack or not creating a hack, I choose not creating a hack. That way if someone else creates an Asian Elephant hack, this will not interfere with that hack. Since the elephant/log interaction graphics are in the swinging log configuration, it does not make sense for this swinging log to be used by any other animal. So I added the "id=5081" line to tell ZT that it is only used by the Asian Elephant.

When "id=" is added to a slot, it has to be set to an ID number that is in a ".dll" file. 5081 is an ID in ZT's lang0.dll, and is set in lang0.dll to "Asian Elephant". ZT does not look for APE ID's or internal names in "id=" lines. So that is why your changes in asirope.ai did not work. But there might be additional reasons it did not work, since the settings in [Characteristics/Integers] section and the settings in the animal configuration have to be correct as well. If your animal configuration has "[m\BehaviorSet\basiropeanimalrest0]" and not some number other than "0", I would remove slots 2 through 5, and only have slot 1. I would remove the "id = 5506" line. Then I would test this rope configuration with your animal to see if the animal uses it. Once that works, you can then decide the next step, which is whether you want to continue to use a hack of asirope, or if you want to do it without a hack and create a new orangutan that links to ZT's orangutan graphics.
JVM
zoo guest
Posts: 8
Joined: Sun May 22, 2016 5:43 am

Re: Usermade Animals and Ingame Toys

Post by JVM »

Thank you for such a careful and technical explanation, Jay, I truly appreciate it.
The Swinging Log For Asian Elephant uses special graphics. The elephant's trunk has to move realistically in relation to the log. Blue Fang had created this special graphics for the Asian Elephant, but never finished or used the graphics. There were 2 ways to use the unused graphics. One way was to have the elephant/log interaction graphics inside the configuration of the Asian Elephant, which means a hack of the Asian Elephant would have to be created. The other way was to create a new swinging log and put the elephant/log interaction graphics in that swinging log configuration, which would not be a hack. When I have a choice of creating a hack or not creating a hack, I choose not creating a hack. That way if someone else creates an Asian Elephant hack, this will not interfere with that hack. Since the elephant/log interaction graphics are in the swinging log configuration, it does not make sense for this swinging log to be used by any other animal. So I added the "id=5081" line to tell ZT that it is only used by the Asian Elephant.
I can understand this, since there are multiple existing files that affect ingame animal ai files, such as Happy Animals or Nature vs ZT megahack; so the incompatibility is a serious concern. I intended to put off that question until the end of this process, once I proved if this was possible. I was also considering offering two options, so a user might have the choice to download a hack or a new toy, in a similar manner to how there is an option at Zoo Tek between a researchable or non researchable Asian lion in Jungle Junk.
When "id=" is added to a slot, it has to be set to an ID number that is in a ".dll" file. 5081 is an ID in ZT's lang0.dll, and is set in lang0.dll to "Asian Elephant". ZT does not look for APE ID's or internal names in "id=" lines. So that is why your changes in asirope.ai did not work. But there might be additional reasons it did not work, since the settings in [Characteristics/Integers] section and the settings in the animal configuration have to be correct as well. If your animal configuration has "[m\BehaviorSet\basiropeanimalrest0]" and not some number other than "0", I would remove slots 2 through 5, and only have slot 1. I would remove the "id = 5506" line. Then I would test this rope configuration with your animal to see if the animal uses it. Once that works, you can then decide the next step, which is whether you want to continue to use a hack of asirope, or if you want to do it without a hack and create a new orangutan that links to ZT's orangutan graphics.
The fact that it is looking for ID numbers defined in the .dll files is the key I needed -- I reset to the original asirope and asibars ai files and simply commented out the id line (so I could change it back easily if there was an issue) and it works like a charm. The orangutan-based primates can use both the bars and ropes comfortably and I witnessed this ingame within minutes. Thank you so much!!

The only issue now is the animals 'exited' in the middle of the rope swing, with the rope still missing after the animation was completed. I suspect this may be as the animal used for the test, a gibbon, uses baby orang anims instead of adult at present. The configuration lines for the exit slot are the same from the unmodified orangutan toy file.
User avatar
Jay
african elephant keeper
Posts: 11552
Joined: Thu Jan 15, 2004 9:23 pm
Location: Orlando, FL (M:66)

Re: Usermade Animals and Ingame Toys

Post by Jay »

JVM wrote:The only issue now is the animals 'exited' in the middle of the rope swing, with the rope still missing after the animation was completed. I suspect this may be as the animal used for the test, a gibbon, uses baby orang anims instead of adult at present. The configuration lines for the exit slot are the same from the unmodified orangutan toy file.
ZT's young orangutans should be able to use ZT's rope swing. But the young orangutans use different animation names than adult orangutans. ZT's orngutan.ai has the following:

[m/Animations]
...
rope_get_off = rpgetoff
...
[f/Animations]
rope_get_off = rpgetoff
...
[y/Animations]
...
rope_get_off = rpgetdn

So to exit the rope, ZT's adult orangutans are using the rpgetoff animation and ZT's young orangutans are using the rpgetdn animation. If your adult gibbon is using ZT's young orangutan animations, then your gibbon uca should have the following:

[m/Animations]
...
rope_get_off = rpgetdn


As a side note, ZT's orangutans have animations to interact with 3 things: Orangutan Rope Swing, Orangutan Jungle Gym, and Durian Tree.
JVM
zoo guest
Posts: 8
Joined: Sun May 22, 2016 5:43 am

Re: Usermade Animals and Ingame Toys

Post by JVM »

Jay wrote: Fri Dec 23, 2022 12:29 pm
JVM wrote:The only issue now is the animals 'exited' in the middle of the rope swing, with the rope still missing after the animation was completed. I suspect this may be as the animal used for the test, a gibbon, uses baby orang anims instead of adult at present. The configuration lines for the exit slot are the same from the unmodified orangutan toy file.
ZT's young orangutans should be able to use ZT's rope swing. But the young orangutans use different animation names than adult orangutans. ZT's orngutan.ai has the following:

[m/Animations]
...
rope_get_off = rpgetoff
...
[f/Animations]
rope_get_off = rpgetoff
...
[y/Animations]
...
rope_get_off = rpgetdn

So to exit the rope, ZT's adult orangutans are using the rpgetoff animation and ZT's young orangutans are using the rpgetdn animation. If your adult gibbon is using ZT's young orangutan animations, then your gibbon uca should have the following:

[m/Animations]
...
rope_get_off = rpgetdn


As a side note, ZT's orangutans have animations to interact with 3 things: Orangutan Rope Swing, Orangutan Jungle Gym, and Durian Tree.
Thank you, that worked like a charm, they can now exit the toy without issue! This is fantastic, thank you.
Post Reply