Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Field Researcher
Original Poster
#1 Old 26th Dec 2021 at 6:36 PM Last edited by lizcandor : 27th Dec 2021 at 3:12 AM.
Default [Resolved]Custom events
Has anyone made a custom event? I'm trying to link a wish in a dream tree to something that seems like it would be easiest to detect by firing a custom event and using that event as the trigger for the wish's check and feedback functions, and I'm wondering if just appending a value to the EventTypeId enum and putting that value in the XML defining my node primitive would work.

[Edit: Confirmed the custom event can be fired, so it's just getting the dream tree to use it that's a problem]
[Edit 2: This seems to work now, actually? I'm not sure what changed between my last test and the one before - maybe it was that I cleared my cache, but I'm pretty sure I'd tried that before and it didn't help. Anyway, putting the enum name - not the enum value - for a custom event as the trigger event for a node primitive is apparently the way to do it, sorry to answer my own question again. Also should note that the enum needs to be added before parsing the node primitive for this to work.]
Advertisement
Senior Moderator
staff: senior moderator
#2 Old 23rd Jul 2022 at 4:33 PM Last edited by zoe22 : 23rd Jul 2022 at 5:08 PM.
Heya @lizcandor !
I'm trying to attempt this myself and it's not working - I'm wondering if you could help see if I've done something wrong?
In OnStartup I've got:
Code:
AddEnumValue<EventTypeId>("kMadeFlowerArrangement", (EventTypeId)0x3B8E439A);


And in the interaction:
Code:
EventTracker.SendEvent((EventTypeId)0x3B8E439A, Actor);


And the dream primitive node is:
Code:
<Primitives>
  <Name>Make Flower Arrangement</Name>
  <Category>Skills</Category>
  <Id>586064062</Id> <!--MakeFlowerArrangement=0x22EEA0BE-->
  <TriggerEvent>kMadeFlowerArrangement</TriggerEvent>
  <PrimaryIcon>w_painting_skill</PrimaryIcon>
  <SecondaryIcon>w_quality_perfect</SecondaryIcon>
 </Primitives>


I've got the STBLs for the primitive's name and description as well, and I'm 99% sure the event is being added before the primitive is loaded as they're in different dlls (checked with simpleMessageDialogues) so I'm not sure what else to check for :p

Dreams are such a pain as they're so hard to know if they're even loaded!
I know my dream tree is being loaded as it's just two nodes - the root node was originally learn skill which triggered the improve skill (worked fine), and now I just changed the root to be make flower arrangement (my custom primitive) and it's no longer triggering the improve skill.
Any help is appreciated! And I'm also curious about your own progress with custom dreams!

edit: of course it was something stupid lol - I was using the wrong name so the xml wasn't even being loaded
Field Researcher
Original Poster
#3 Old 23rd Jul 2022 at 5:52 PM
lol that's how it always goes isn't it

I'm glad your tree is working! I haven't done much with mine lately (I keep losing interest in projects as soon as the I've done the hard parts, so once the going got pretty smooth I just...wandered away...) but one thing that was helpful for me was making a new class to store information about the custom event in! Like SocialEvent/LotEvent/etc.; I think I just stored the ID's of the sims involved in the event in mine, but you could do a lot more.
Senior Moderator
staff: senior moderator
#4 Old 23rd Jul 2022 at 7:43 PM
Oh interesting! I never though of including more info, though I suppose for the moment it's not necessary.

Well I hope you get some inspiration to come back to them soon, as I can't wait to see what you do with the custom dreams
Back to top