View Full Version : Alien Detection by BHAV
1st Apr 2008, 10:48 PM
I've been putting a lot of time into an object that will report on the paranormal and species status for all humanoids and animals within the game world, including those fascinating creatures in Castaway Stories. All has gone well, with accurate detection of every one of them except for aliens!
Has anyone found a programatic method to detect that any given Sim is an alien? I would be satisfied with first generation detection only, i.e. identifying the child resulting from an alien abduction.
There is a discussion on skintone here (http://www.modthesims2.com/creator/showthread.php?p=1714551) that seemed to have promise, including the "My Person Data 0x3C: Skin Color" value - but that always seems to be zero. In fact, browsing to an Alien Sim within SimPE also shows a skin colour of zero.
There was also talk of detecting the actual skintone used, but no one seemed to know how to do that programatically. The default alien skintone is reported to be 6baf064a-85ad-4e37-8d81-a987e9f8da46
I thought that perhaps I could detect the presence of an alien parent, but the alien parent does not seem to be indentified in the Sim's family group, only the human parent is acknowledged.
2nd Apr 2008, 5:21 AM
It seems to me that none of the approaches mentioned above are going to work. What I might be able to do is to first determine if the subject Sim had only one parent, and if that parent were male. Then if I could parse the father's memories to check for "abducted by aliens" and "gave birth" this would be a very strong indication that the subject Sim was alien.
Off hand I cannot think of way that the subject Sim would not be an alien if all of the above were true, unless the father - child relationship were created in CAS with no mother specified. Then during gameplay the father could be abducted by aliens so that original child now had an alien sibling. The father in this case would have the specific alien and pregnancy memories, the original Sim child would indeed have only one parent - a parent who was male - but the original Sim child would not in fact be alien. In this case my detection logic would fail.
At this point I do not know if memories can be parsed in this way. In any event, it would appear that this test would not be foolproof. I would have to additionally determine that the subject Sim was not a CAS Sim but was born in-game. Again, I do not know of a way to determine this by BHAV (yes, its easy enough to do so by browsing the Sim's genetics in SimPE but that doesn't help the question at hand).
2nd Apr 2008, 6:31 PM
OK, I can see how the parent's memories may be searched for "Got Abducted by Aliens" (GUID 0x8CAB102B) and "Had Subject$!" (GUID 0x2C8CC73F). All being well, the second parental memory should also tell me that the specific subject Sim was actually born in-game. A very convoluted way to detect an alien genotype, but it should work. Then I'll begin work on a Cylon detector. ;)
4th Apr 2008, 11:20 PM
With the addition of the "Met Aliens" (GUID 0x2DB66260) memory as an alternate to "Got Abducted by Aliens" (either/or) the suggested algorithm works well, including detection that the subject Sim was the one who was born after either of the two Alien encounter memories. In fact this method will work with hacks that allow females to become alien impregnated as well as males, for it should not trigger on conventional pregnancies. An object using this code should be released within a month.
4th Apr 2008, 11:49 PM
Does it cope with twin-births?
5th Apr 2008, 10:14 PM
Thank you for following the story so far, Echo, that is a good insight. No, I hadn't thought of twins. I have now coded that in, to check if the very next memory is also of a birth, then to check if the Subject Sim was the one born in that case. The chances of a natural birth being the very next memory are very slim, even if the only intervening memory is to say that $Subject grew up badly.
It will take a bit of testing to try this out - I think Pascal Curious is going to be looking at twins next time! Another concern comes to me, it could be that alien abduction is only a one-time memory (like "Did WooHoo with $Subject"), in which case my method is going to breakdown on the second impregnation anyway - unless restricted to detecting male impregnation only when looking for a second pregnancy.
In any event I will likely have to allow for manual flagging or unflagging of alien status regardless, not only for the occasional error but for aliens designed in CAS and Phaenoh's Elliot and Polly (Elliot was given a memory wipe). It is tempting to set and test with Expression (Stack Object's person data 0x003C (skin color) == Literal 0x0005) for alien skin colour - S5 indicating the alien default. I presume Maxis shied away from setting skin colour for fears of racsist accusations because this parameter is always zero. But I think I will play it safe and use an invisible token (ha ha, a card carrying alien - my father used to be one for a short time in the States).
I do have a lookup table of GUIDs for all legacy aliens that came with the game - several alive and dead in Strangetown, one young adult at La Fiesta Tech, and a deceased one in Pleasantview. Actually the Strangetown Smith children detect properly without the table, based on Pollination Technician 9's presence in the legacy list. (Did you know #9 actually married his first children's half-sister, as shown here (http://sims.wikia.com/wiki/Smith) - its not called Strangetown without reason).
But I am aware that lookup GUIDs have the chance of being repeated in other neighbourhoods. Do you know of a way to detect the neighbourhood's ID number programatically?
6th Apr 2008, 4:31 PM
It will take a bit of testing to try this out - I think Pascal Curious is going to be looking at twins next time! Another concern comes to me, it could be that alien abduction is only a one-time memory (like "Did WooHoo with $Subject"), in which case my method is going to breakdown on the second impregnation anyway - unless restricted to detecting male impregnation only when looking for a second pregnancy. Alien abduction is a repeatable memory, so this algorithm will work fine. Alien abduction is flagged repeatable because the number of alien abductions is counted as a multiplier for the Extraterrestrial Reparation Grant. One purpose of this mod is that the scholarship will also be awarded on the basis of alien heritage. It is in the interests of Sim society that aliens be well indoct... um, educated.
But I am aware that lookup GUIDs have the chance of being repeated in other neighbourhoods. Do you know of a way to detect the neighbourhood's ID number programatically? Yes, use the Global variable for Neighborhood ID. For example Expression (Global 0x0028 (Current Neighborhood ID) == Literal 0x0002) will check for Strangetown.
BTW, it is useless to check for Stella Terrano's GUID because La Fiesta Tech may be attached anywhere. Her GUID will be initialized more or less randomly during the attachment process. While it would be desireable to identify her as alien manually it is in any event too late to apply for scholarships when she is already in college.
16th Apr 2008, 1:59 PM
It's really insteresting and I think I will use your infos in order to make a mod which allow alien only to ask an abduction of a normal sim !
But is it possible to test the memories of the grandparents in order to detect the second alien generation ?
16th Apr 2008, 8:57 PM
It's really insteresting and I think I will use your infos in order to make a mod which allow alien only to ask an abduction of a normal sim ! Ah, what a delightfully evil idea! :cool:
All being well my project will be released by this time next week. It is intended for the Victorian London Challenge - The Honest to Dickens Mirrors for Discerning Victorians. You are welcome to scoop out any useful code, although credit would be nice of course. What you may want to do is simply use my objects in support of your project so that you will neither have to reinvent the wheel nor introduce yet another system of alien detection to the possible confusion of the players.
BTW, there is a non-functional BHAV in the globals, called something like "Do I Have an Alien Dad?" If I remember correctly, it is supposed to prevent half-aliens from being impregnated if they are abducted. But since the game does not preserve the link from a half-alien child to the Pollination Technician NPC this code is useless.
But is it possible to test the memories of the grandparents in order to detect the second alien generation ? Yes, it would be entirely possible to do this with a recursive algorithm. However, the coding was becoming quite complex already so instead of doing so I actually set a token on any given alien so that generational detection becomes very easy.
I also use a lookup table to determine the alien status for the legacy aliens that come with the game. The natural child of a legacy alien will be appropriately classified, and the child's alien token is then used to determine alien status for future generations.
But there is a twist to this. I use the token to track the portion of alien heritage that any given Sim may have, on a scale of zero to four, as follows:
0 - Contains no traceable alien heritage: a standard Sim genotype. Normally used only as an override. For example Strangetown's Jill Smith is programatically tagged as a half-alien because her father is a full alien. But not only does Jill not look like an alien, it is quite clear from studying her genotype in SimPE that Pollination Technician Smith is not her biological father. The value of zero is used to set things straight.
1 - One Quarter Alien: typically this would be the child of the union between a half-alien parent and a standard parent. Dina and Nina Caliente are theoretically quarter-aliens.
2 - Half Alien: the child of an abductee or the child of two half-alien parents (my genotyping is simplistic - typical of the laws of citizenship inheritance rather than biologically based)
3 - Three Quarter Alien: the child from the union of a pure alien and a half-alien. This could happen if a half-alien were impregnated during an abduction. Or less likely, if Pollination Technician Smith had an affair!
4 - Full Alien, a pure alien genotype. Strangetown's Pollination Technician Smith is the only known and alive full alien in the legacy game. Perhaps La Fiesta Tech's Stella Terrano is also a full alien, but I haven't checked yet. There are however a total of seven dead full aliens that could be relinked in SimPE and then resurrected.
For your Abduction by Alien Agent project you could simply read the Alien Token's value and proceed from there.
For CAS aliens and those like Stella Terrano and Phaenoh's Polly whose geneology is untraceable and who have non-fixed GUIDs, I do plan to release The Candelabrum of Unearthly Visitation as a supporting object. This will allow the user to set any arbitrary value on the Alien Token, as well as arrange for the introduction of CAS aliens from the Sim Bin into the neighbourhood (i.e. free range aliens ;)).
24th Apr 2008, 8:54 PM
The finished mirrors have now been posted here (http://www.modthesims2.com/showthread.php?t=282829).
La Fiesta Tech's Stella Terrano is in fact a pure or full alien. As noted above, her status is not detectable by these mirrors.
Pleasantview's Dina and Nina Caliente are not alien in any respect. Genetic testing has shown that their father Flamenco had not a trace of the alien genotype, proving that Pollination Technician 7 could not have been one of their grandparents. Some folks will claim anything for a little notoriety! ;)
25th Apr 2008, 4:30 PM
Thank you, your BHAV code will be very useful for future projects !
26th Apr 2008, 7:28 PM
Kabuto, these are the specific BHAVs you will need to extract (with instance numbers in parentheses):
Get in Temp 7 - Alien Research (1026)
Sub - Same Subject? (1027)
Get in Temp 7 - Registered Alien (1028)
Sub - Add/Update Alien & Misc Skill Tokens (1029)
Get in Temp 7 - Alien Token (1030)
Function - Is Castaway? (10EC)
Together with the Alien token this will be all you need to both calculate and read alien status, completely independently of my discernment mirrors. Get in Temp 7 - Alien Research is the entry point, and it operates on the Sim pointed to by the Stack Object. This BHAV will return the Alien status in Temp 7 according to the table in Post #9 above (e.g. 0 = Non-Alien, 4 = Full Alien). These routines work with the base game, the three Stories editions, and all expansions.
27th Apr 2008, 6:38 AM
Strangetown's Chloe Singles, Lola Singles and Johnny Smith each have Pollination Technician #9 Smith as their father. Since their other parents were presumeably pure humans they should each be half aliens. However I discovered today that Maxis did not play by the rules and both their dominant and recessive Skintone Range values are alien, indicating that they are in fact full aliens. I have adjusted the lookup table (Get in Temp 7 - Registered Alien) accordingly.
3rd Jul 2010, 1:24 AM
So could Dina or Nina have an alien child with either themselves (using cheats) or humans?
29th Jul 2010, 10:50 PM
So could Dina or Nina have an alien child with either themselves (using cheats) or humans? No. Dina and Nina are not alien at all.
J. M. Pescado
30th Jul 2010, 6:55 PM
Trying to detect an "alien" in the way above gets hairier when you consider that NONE of those are actual indications of being a green alien, and this method easily fails to detect Nth-generation aliens.
30th Jul 2010, 9:51 PM
Trying to detect an "alien" in the way above gets hairier when you consider that NONE of those are actual indications of being a green alien, and this method easily fails to detect Nth-generation aliens. I would be more than happy if you presented me with a better algorithm! However Nth-generation detection actually does work, provided you run the ancestors through the discernment mirror so as to set the alien token. I wasn't really concerned about the manifested skin colour - quite the contrary - I was wanting to detect latent alien ancestry, calculated to a one quarter level.
See Honest to Dickens Mirrors (http://www.modthesims.info/download.php?t=282829), Baker's Dozen (11) -
The results of these calculations are also used to adjust the Miscellaneous Skills token's Alien Abduction value. This value is used to determine scholarship benefits, with one scholarship of §1500 awarded for each quarter portion of alien heritage.
Of course this algorithm has very little to do with genotype, but everything to do with ancestry - much the same as how western governments typically determine aboriginal status. The only truly accurate way that I know to determine genotype is through SIMPE, the Sim equivalent of a blood test.
The most significant shortcoming with this method is that there is no support at all for CAS aliens, including those with user created skintones. For this reason I devised the as yet unpublished Candelabrum of Unearthly Visitation so that the user could set the alien token to an arbitrary value. But as usual that venture kept growing and then became swamped by layers of new projects... :)
vBulletin v3.0.14, Copyright ©2000-2013, Jelsoft Enterprises Ltd.