Home | Download | Discussion | Help | Site Map | New Posts | Sign in

Latest Site News

Nysha's New Creators for July - posted on 1st Aug 2018 at 9:00 AM
Replies: 18 (Who?), Viewed: 2967 times.
Lab Assistant
Original Poster
#1 Old 13th May 2018 at 12:39 AM Last edited by whiteman-Dara : 17th May 2018 at 10:48 AM.
Default the creation of an alien is possible in the CAS?
I tried to create a AlienSort in CASLoadSim, but my game crashes, I do not understand why a ghost is written in occult types, if it does not have the OccultGhost class? Is it possible to create a button referring to the class AlienUtils?
Advertisement
Puffin McMuffin
staff: administrator
#2 Old 13th May 2018 at 12:11 PM
Because if you don't use occult types, CAS won't be able to generate an actual supernatural with it's needed data Like ghost having their own tombstone connected to their inventory and mummies also having their own walk/interactions etc. So it's just a matter of grabbing the data that it's needed + the hidden traits that they have (Which I believe aliens have as well) Although I would carefully study the Fairy CAS and such, because I think the reason it's crashing is because it can't grab the data it can with the others. Or well, EA's settings.
Instructor
#3 Old 15th May 2018 at 4:58 PM
I think you should check how Master Controller adds Alien DNA to Sims.
Lab Assistant
Original Poster
#4 Old 16th May 2018 at 10:23 PM
skydome, Did not find anything, except
Quote:
using System;

namespace NRaas.CommonSpace.Helpers
{
public enum SimType
{
None,
Service,
Resident,
Townie,
Dead,
Tourist,
Mummy,
SimBot,
Frankenstein,
PlayableGhost,
Pregnant,
Human,
Vampire,
Occult,
ImaginaryFriend,
Genie,
Fairy,
Werewolf,
Witch,
Zombie,
BoneHilda,
Unicorn,
Alien,
Animal,
ActiveFamily,
NonActiveFamily,
Selectable,
NonSelectable,
Hybrid,
Partnered,
Steady,
Married,
Single,
Straight,
Gay,
Bisexual,
Plantsim,
Alive,
Foreign,
Local,
StrandedCouple,
MiniSim,
Mermaid
}
}
Instructor
#5 Old 17th May 2018 at 3:07 AM
Check the Master controller cheat module. The interaction comes with that module.
Lab Assistant
Original Poster
#6 Old 17th May 2018 at 10:51 AM
skydome, How will this help me?
Quote:
using NRaas.CommonSpace.Options;
using Sims3.Gameplay.Abstracts;
using Sims3.Gameplay.CAS;
using Sims3.Gameplay.CelebritySystem;
using Sims3.Gameplay.Interfaces;
using Sims3.UI;
using System;

namespace NRaas.MasterControllerSpace.Sims.Intermediate
{
public class AlienPercentage : SimFromList, IIntermediateOption, IOptionItem, IInteractionOptionItem<IActor, GameObject, GameHitParameters<GameObject>>, IDescriptionOptionItem, IInteractionOptionItem<IActor, SimDescriptionObject, GameHitParameters<SimDescriptionObject>>, ICommonOptionItem
{
private float mPercent;

public override string GetTitlePrefix()
{
return "Criteria.AlienPercentage";
}

protected override int GetMaxSelection()
{
return 0;
}

protected override bool CanApplyAll()
{
return true;
}

protected override bool Run(SimDescription me, bool singleSelection)
{
if (!base.ApplyAll)
{
string text = StringInputDialog.Show(this.Name, Common.Localize(this.GetTitlePrefix() + ":Prompt", me.IsFemale, new object[]
{
me,
CelebrityManager.HighestLevel
}), me.CelebrityLevel.ToString(), 256, StringInputDialog.Validation.None);
if (string.IsNullOrEmpty(text))
{
return false;
}
this.mPercent = 0f;
if (!float.TryParse(text, out this.mPercent))
{
SimpleMessageDialog.Show(this.Name, Common.Localize("Numeric:Error"));
return false;
}
}
me.mAlienDNAPercentage = this.mPercent;
if (me.CreatedSim != null)
{
me.CreatedSim.Motives.RecreateMotives(me.CreatedSim);
}
return true;
}
}
}
Instructor
#7 Old 17th May 2018 at 8:26 PM
Not exactly sure since I don't know how you're doing this. You want to add an alien option in the supernatural section in CAS right? You can make it so the Sim will get 100% alien DNA to the sim. You could even add the Alien outfit and skin tone like we do when we select Genies in CAS.
Department of Post-Mortem Communications
#8 Old 18th May 2018 at 8:38 AM
While I am no coder at all, I think the issue is a bit more complicated, because aliens are actually not a supernatural life state. All occults or supernaturals from ghosts to mermaids are governed by a hidden occult trait (they added the ghost trait with the Supernatural EP), and in CAS you simply add the trait to make a supernatural. But there is no hidden "Alien" trait. This is done via a percentage number of alien DNA, ranging from 0-100. So, I guess you'd also need some sort of slider mechanism in order to make an alien in CAS.

If I were a coder I would probably look at how the game creates the alien NPCs in the Alien household, as it adds a 100% alien percentage automatically.
Puffin McMuffin
staff: administrator
#9 Old 18th May 2018 at 5:59 PM Last edited by Lyralei : 19th May 2018 at 11:06 AM. Reason: my sub-consciousness really have a thing for mermaids doesn't it? :P
Agreed, which was kinda what I tried to explain in my first post. Now I took a look at the way the fairy and ghosts data works, given how they apply something new and unique to that specific to a supernatural (So wings with the fairy, etc). And if it's actually possible to add a new occult type like that, since I know you've been working on a solution for this for about a year or so.

Now looking at the code, (which I will say they could have totally written way better than the way it is at the moment) and let's say, take the ghostdata:

Code:

if (occultType <= OccultTypes.Ghost)
			{
				if (occultType <= OccultTypes.Unicorn)
				{
					switch (occultType)
					{
					case OccultTypes.Mummy:
					case OccultTypes.Frankenstein:
					case OccultTypes.Vampire:
						break;
					case OccultTypes.Mummy | OccultTypes.Frankenstein:
						return result;
					default:
						if (occultType != OccultTypes.ImaginaryFriend && occultType != OccultTypes.Unicorn)
						{
							return result;
						}
						break;
					}
				}

It basically calls the CASGhostData, which is another class that the CASsupernaturaldata calls (Same counts for CASFairyData, CASMermaidData, etc). AS you can read, the snippet pretty much says "exclude the mummies and frankensteins, imaginary friends and unicors
Now after it reads all the occulttypes the script checks and calls, including the CASGhostData, CASMermaidData, etc. It says:

Code:

			result = new CASSupernaturalData(occultType);
			return result;
		}


if none of those supernaturals have been clicked on the menu that has been mentioned in the script, it looks at the occultType. Now this is an enum. Enums are pretty difficult to... well, bypass if that makes any sense:



This also pretty much shows that aliens indeed aren't, even by script, non-occult types. So... in this case we have a problem. The Alien isn't in the enum list, so that's already an issue, nor is an occultType. Nor is there a xml/tuning list that lists them all like the CommodityKinds for traits. We know that there is a "bypassable" way (If that's even a word :P) for traits in this case, but that's because the game doesn't check all the individual traits and then if there's no trait to be found, checks the enum. It's actually written in this sense where from the script you can call yours from creating an internal const basically (With of course some additional resources ) to get it done.

So, to answer your question on "I do not understand why a ghost is written in occult types, if it does not have the OccultGhost class?"
The reason why is because there is a CASGhostData class. That class is referred in the CASSupernaturalData already that points to the enum, which then seemingly adds a 'deathtype' simdescription to the sim. I couldn't really understand why there wasn't any ghosthiddentrait attached to the sim and went to research this a bit more. It seems that EA has 3 different way of spawn, apply, etc. a ghost type to a sim. And reading the script, it seems that it only applies a simdescription.deathtype to a sim but the trait is rarely being called in any ghost-related script anyways. it's interesting too that EA didn't include the actual hiddentrait in the enum trait list in the occult manager. So that pretty much points out that ghosts are just... well, ghosts with a shader/material and an animation applied to them through the deathtype ANd then there's also the fun fact that the occultTypes are connected to the occultmanager.

Now we have a few problems here:

- The CASSupernaturalData checks the occultTypes through the enum and these are hardcoded. They don't actually refer to any traits whatsoever either. So that is actually pretty bad given how to make an occult ourselves we need traits.
- The CAS(Specific supernatural kind)Data refers to it's own occult type. This is how it reads it and how they eventually call all the interactions they do.
- Occult types aren't listed in XML files either.
- The reason it's probably crashing now is because it's not recognizing it as a occultType, which it seems it's the only way this works.

Now you might be able to make a work-around script if you have made traits or skills yourself, since if you understand that technique (Which also is done in a work-around way) it will be easier to understand how to may be able to actually get there to make it read the AlienUtils. (or maybe even have it make your own code) But to be really fair, it's not easy nor can I actually see a way it might be possible.

I will say that I am a bit curious on to what you've written code related already. Maybe with that it might be easier to help you out. don't forget to put them under a spoiler though. Although this code should be relatively small since it only should call CAS data. No social interactions.
Lab Assistant
Original Poster
#10 Old 21st May 2018 at 10:10 AM
Thanks to everyone for replies
Skydome, it's impossible to add an alien to the supernatural type button. Think I need to add another button for this.
Don Babilon, More than sure the slider will not work, since sliders are designed to change physical data.
Lyralei, I have several versions, half of them do not work:
sorting aliens is failed, because the sort uses the code CasAgeGenderFlags in which
there is no aliens.
Code:
namespace Sims3.SimIFace.CAS
{
[Flags, ComVisible(false)]
public enum CASAgeGenderFlags : uint
{
None = 0u,
Baby = 1u,
Toddler = 2u,
Child = 4u,
Teen = 8u,
YoungAdult = 16u,
Adult = 32u,
Elder = 64u,
AgeMask = 127u,
Male = 4096u,
Female = 8192u,
GenderMask = 12288u,
Human = 256u,
Horse = 512u,
Cat = 768u,
Dog = 1024u,
LittleDog = 1280u,
Deer = 1536u,
Raccoon = 1792u,
LargeBird = 2048u,
SimWalkingDog = 2304u,
SimWalkingLittleDog = 2560u,
SimLeadingHorse = 2816u,
Paddleboat = 3072u,
WaterScooter = 3328u,
Speedboat = 3584u,
Rowboat = 3840u,
HouseboatSmall = 16640u,
HouseboatMedium = 16896u,
HouseboatLarge = 17152u,
Shark = 17408u,
Sailboat = 17664u,
WindsurfBoard = 17920u,
SpeciesMask = 52992u,
LeftHanded = 1048576u,
RightHanded = 2097152u,
HandednessMask = 3145728u
}
}

Adding a traits to aliens will work, but their DNA will break.
and the last addition of the enum to the aliens.
Code:
using System;

namespace Sims3.UI.Hud
{
[Flags]
public enum UtilsTypes : uint
{
Human = 0u,
Alien = 1u,
}
}
Instructor
#11 Old 21st May 2018 at 4:00 PM
I like that idea. Creating another button for Alien. You could make it so pressing that button gives 100% Alien DNA and changes the skintone to gree and changes your outfit to alien outfit.
Puffin McMuffin
staff: administrator
#12 Old 22nd May 2018 at 12:17 PM
What exactly do you mean with versions?
Lab Assistant
Original Poster
#13 Old 25th May 2018 at 2:11 AM
Lyralei, in English a small vocabulary. I mean "Versions" - opportunities, possible options, variants.
Puffin McMuffin
staff: administrator
#14 Old 27th May 2018 at 10:54 AM
One thing here that you'd want to make sure is, is to see what is considered CAS compatible. The alienutils has some CAS compatible stuff but it also seems to link to stuff that can only be applied when the alien is being created in the game itself (So when playing the game) In fact, alienUtils is only for the gameplay. The actual code you want to look at is probably genetics.makeAlien. It automatically adds the genderAgeFlags to the the alien so you don't have to worry about those. I think the // Sims3.Gameplay.Core.Terrain.DEBUG_CreatePlayableAlien could be a good reference to work from but keep in mind that this one is one of EA's code for testing but seeing how they added the simdescription to the alien could be helpful

I think that way you can also easily figure out how to inject the DNA data after the player accepted the sim to play with it in-game.
Lab Assistant
Original Poster
#15 Old 7th Jun 2018 at 1:12 AM Last edited by whiteman-Dara : 7th Jun 2018 at 1:30 AM.
The creation of a new button or slider is meaningless, since the aliens have a standard of sliders looks, therefore it is more logical to sorted aliens as pets. But there are problems, the code can not use other links, except those, which are located in the сode.
Code:
// Sims3.UI.CAS.CASLoadSim
private CASAgeGenderFlags GetCurrentSpecies()
{
switch (this.mCurrSpeciesID)
{
case CASLoadSim.ControlIDs.SimSort:
return CASAgeGenderFlags.Human;
case CASLoadSim.ControlIDs.DogSort:
return CASAgeGenderFlags.Dog;
case CASLoadSim.ControlIDs.CatSort:
return CASAgeGenderFlags.Cat;
case CASLoadSim.ControlIDs.HorseSort:
return CASAgeGenderFlags.Horse;
default:
return CASAgeGenderFlags.SpeciesMask;
}
}

Code:
// Sims3.UI.CAS.CASLoadSim
private string GetCurrentSpeciesLocKey()
{
switch (this.mCurrSpeciesID)
{
case CASLoadSim.ControlIDs.AllSpeciesSort:
return "AllSpecies";
case CASLoadSim.ControlIDs.SimSort:
return "Sim";
case CASLoadSim.ControlIDs.DogSort:
return "Dog";
case CASLoadSim.ControlIDs.CatSort:
return "Cat";
case CASLoadSim.ControlIDs.HorseSort:
return "Horse";
default:
return string.Empty;
}
}

Code:
// Sims3.UI.CAS.CASPuck
private void CallCreateSimCallback(CASPuck.ControlIDs id)
{
if (id == CASPuck.ControlIDs.CreateSimButton)
{
this.CreateSimCallback(CASAgeGenderFlags.Human);
return;
}
switch (id)
{
case CASPuck.ControlIDs.CreateHorseButton:
this.CreateSimCallback(CASAgeGenderFlags.Horse);
return;
case CASPuck.ControlIDs.CreateDogButton:
this.CreateSimCallback(CASAgeGenderFlags.Dog);
return;
case CASPuck.ControlIDs.CreateCatButton:
this.CreateSimCallback(CASAgeGenderFlags.Cat);
return;
default:
return;
}
}
Lab Assistant
Original Poster
#16 Old 16th Jun 2018 at 4:42 PM
Lyralei,I have two problems:
1. Conflict of buttons "AddPopupMenuWindowPet" and " AddPopupMenuWindowAlien" , "AddSimPopupButtonPet" and "AddSimPopupButtonAlien", "ReplaceSimButtonPet" and "ReplaceSimButtonAlien"
2. Genetics diverse species not provided.
Puffin McMuffin
staff: administrator
#17 Old 18th Jun 2018 at 4:11 PM
May I ask how exactly they conflict with each other?

I'm also a little confused about the "Genetics diverse species not provided" could you go a little more into details? I guess it might be the language barrier, so bear with me :P
Lab Assistant
Original Poster
#18 Old 19th Jun 2018 at 10:17 PM
Lyralei, Code is put one of the two buttons in the presence of ep, is of first button, and if not installed a certain ep is of second button, but what button will work if there are 3 of them from 2 ep, I do not know. About the second: Genetics different species not provided. I can not add to SimIFaceCAS / CASAgeGenderFlags new species, the game does not even the run after editing.
Lab Assistant
Original Poster
#19 Old 28th Jun 2018 at 12:04 AM
Does anyone know how to copy Human AgeGenderFlags that rename to another name, so that the new species uses, a human model? This is the only way to remove humans from AlienSort.
Back to top