Mounting object given to NPC?

In this forum, you can ask questions and get help with the House Party Custom Story Creator. Not for Bug Reports. See the forum below for that.
Forum rules
Forum rules
No racism, sexism, anti-semitism, brigading, doxxing, or ANY form of abusive behavior. No discussion of hacking or piracy or the buying, trading, or selling of ANY type of product or service (digital or otherwise). No advertising of any product or service (digital or otherwise, and this includes streams or any service involving 'subscribers'). No discussion of religion or politics. Do not link to other adult sites, with the exception being discussion of other adult games in Offtopic/allowed subforums; i.e. no pornography.

Do not spam, do not try to circumvent any automated tools that are part of these forums or any linking to these forums. Do not judge others based on their preferences for custom stories, their opinions, sexuality, etc., and most certainly do not bring it to the moderators.

Respect the moderators and each other and all will be well. Report any violations of the above rules. Do not violate local or international laws (including, but not limited to the laws of your country and/or the laws of the United States) while making use of these forums. The IP address of all posts are recorded to aid in enforcing these conditions.

We will use username, e-mail, AND IP bans without reservation, and mods hold the final word in such decisions.
Post Reply
Satan
Posts: 2
Joined: Sat Nov 09, 2019 7:06 pm

Mounting object given to NPC?

Post by Satan » Sat Nov 09, 2019 8:08 pm

Trying to 'give' a character sunglasses from the player's inventory and have them mount to that characters head. I also want it to check for glasses already mounted and remove the glasses to the player's inventory, from the characters head, before mounting the sunglasses. And Vice Versa. The best I've come up with is using the item interaction to drop it from the player inventory and then mount it, handing it off to a triggerevent if the opposite is already mounted. That triggered event drops the items from both the character and inventory and then swaps them. This doesn't work.

Using in game commands to remove sunglasses from the inventory, then mounting to NPC's head works. Any ideas how to accomplish this in CSC?

erasmus
Posts: 1081
Joined: Tue Feb 13, 2018 4:29 pm

Re: Mounting object given to NPC?

Post by erasmus » Thu Nov 14, 2019 8:54 pm

Satan wrote:
Sat Nov 09, 2019 8:08 pm
Trying to 'give' a character sunglasses from the player's inventory and have them mount to that characters head. I also want it to check for glasses already mounted and remove the glasses to the player's inventory, from the characters head, before mounting the sunglasses. And Vice Versa. The best I've come up with is using the item interaction to drop it from the player inventory and then mount it, handing it off to a triggerevent if the opposite is already mounted. That triggered event drops the items from both the character and inventory and then swaps them. This doesn't work.

Using in game commands to remove sunglasses from the inventory, then mounting to NPC's head works. Any ideas how to accomplish this in CSC?
Yeah, if I am reading this right it would be (I am gonna short hand this rather aggressively, sorry). None of the criteria given are necessary, but in case you are doing a LOT with these items at once (or more than one character can affect these items) or grow the story later, it'll prevent debug log spam and ensure specificity:

Event: Item : Glasses : Mount : False
Criteria : Item : Glasses : Is Mounted: True

Event : Player : Inventory : Add : Glasses
Criteria: Player Inventory Has: Glasses : False

Event: Player : Inventory : Remove : Sunglasses
Criteria: Player Inventory Has: Sunglasses : True

Event: Item : Sunglasses : SetEnabled : True
Criteria: Item : Sunglasses : Is Active : False

Event: Item : Sunglasses : Mount : CHARACTER NAME HERE : Head : True
Criteria : Item : Sunglasses : Is Mounted : False

The console version of removing items from the player's inventory automagically does a few extra things that the game event does not. The above should work.

The above should get you started. To reverse the process, just shift the events around, optimally in a new item interaction, but you could also write this all as one item interaction that calls different swap event triggers depending on who has what glasses. I would always suggest getting the mechanic working as cleanly as you can at first, and then cleaning it up later so it's quickly readable and "modularized" later on.
Erasmus
Eek! Games LLC
Vice President, QA & UX

Satan
Posts: 2
Joined: Sat Nov 09, 2019 7:06 pm

Re: Mounting object given to NPC?

Post by Satan » Sun Nov 17, 2019 12:51 pm

Thanks, that's got me sorted out. I think what I was missing was the explicit setenabled. Really all I needed to add to what you gave me here was a check for player having picked up both pair before adding the not-given item to player inventory. Easy enough with player values. Thanks alot.

erasmus
Posts: 1081
Joined: Tue Feb 13, 2018 4:29 pm

Re: Mounting object given to NPC?

Post by erasmus » Sun Nov 17, 2019 10:08 pm

No problem!
Erasmus
Eek! Games LLC
Vice President, QA & UX

Post Reply