StoBo on 31/10/2019 at 14:44
Another stupid newbie question here:
In my mission I've got a set of seven "lucky coins", individually almost worthless (1 gold) but valuable as a full set (60 gold total, so I have to award a bonus 53 gold somehow).
To achieve this, I have done the following, based on (
https://www.ttlg.com/forums/showthread.php?t=140807) this thread
* Put a coin pile worth 53 golds in my blue room and put that into the inventory of an AI named Derp that is also in my blue room.
* Each lucky coin in the level has the TrigContained script and a ControlDevice link to a RequireAllTrap, so that each coin can send a signal and so that all need to be collected to trigger the conversation that will award the bonus.
* The RequireAllTrap uses ControlDevice to activate a conversation marker (I gave it the TrapConverse script and an AIConversationActor link to Derp)
* Set the Data of the AIConversationActor to Actor ID=1
* The conversation itself is as follows, all in conversation step 00 read from top to bottom:
Actor: Actor One
Conversation Action 0: Remove link (flavor, destination, source)
Argument 1: Contains
Argument 2: CoinSetBonus
Argument 3: Derp
Actor: Actor One
Conversation Action 1: Wait (ms)
Argument 1: 2000
Actor: Actor One
Conversation Action 2: Add link (flavor, destination, source)
Argument 1: Contains
Argument 2: CoinSetBonus
Argument 3: Player (I tried this also with StartingPoint and Garrett, no luck)
However, I cannot get it to put the bonus money in inventory. What am I doing wrong?
Unna Oertdottir on 31/10/2019 at 15:04
Does the conversation marker work at all?
I'd always try something simple first that you can see immediately (open door, frob something).
It's also recommended to begin with "wait" in the first entry (100ms is enough).
StoBo on 31/10/2019 at 15:24
Yes, using the conversation to frob a switch near the player works fine.
I can also use the conversation to give myself a mine rather than money.
Why is loot different?
edit: I noticed something else strange-
If I pick up the coins in the wrong order, or I pick up anything else at all along the way, the conversation will no longer award me the mine and it also will no longer frob my test switch. The RequireAllTrap itself doesn't depend on order so I'm not sure what's going wrong.
I am completely confused.
Yandros on 31/10/2019 at 16:52
Giving the bonus loot object a unique combine type might do the trick.
StoBo on 31/10/2019 at 16:59
Won't that give me two loot stacks in my inventory, one containing the normal loot and one containing the special bonus?
Anyway, I still have the problem of the conversation being highly sensitive to the order in which I pick stuff up.
StoBo on 31/10/2019 at 19:14
Okay, it seems that this is impossible to accomplish with conversations.
I've done a bunch of testing and the problems are the following:
* Grabbing loot or items interfers with the ability of a RequireAllTrap to activate a conversation, even if the loot item doesn't link to anything. (or maybe it messes with TrapConverse itself?) I have no idea why, but that's what happens.
* Using a conversation to put anything into your inventory gives you a new stack of those things. So if you use it to obtain a gas mine, and you already have some, you will now have two gas mine stacks. The happens with loot.
I'm going to have to do this with a script, once I know what I'm doing with those. But using a conversation to get this effect is a bust. It cannot be done.
R Soul on 31/10/2019 at 20:24
When you pick up the first of any 'combine' object (some loot, a mine etc) that exact object goes in to your inventory. The next one you pick up doesn't. Its model name is assigned to the existing inventory object (with loot, not sure about other things), and the loot value/stack count is increased, and the original object is deleted. It doesn't become contained.
RequireAllTraps use ScriptParams links back to each triggering object to keep track of which ones are 'on'.
If the first loot object you pick up is Coin1, it'll remain in your inventory forever, and the RAT will have an SP link back to it. Each subsequent coin (and other loot object of course) will be deleted. When the final coin is picked up, it also gets deleted and all of a sudden the RAT sees that there's is 1 object CD linked to it (Coin1) and it has an SP link back to Coin1, therefore all triggering objects are on, so it fires.
In other words, it works by accident.
When the first loot object is something else, the first coin (or other loot object) will be deleted, so none of them will actually turn on the RAT.
The way to record the coins being picked up is to replace TrigContained with TrigWorldFrob, add the property Engine Features > FrobInfo and add 'script' to the World Action list. Then give each coin a CD link to its own RelayTrap. Give each RelayTrap a CD link to the RequireAllTrap.
The other part of the problem is that, as mentioned, subsequent loot objects don't become 'Contained', so adding a Contains link is not the right way to go. You should install NVScript and use NVItemGiver.
john9818a on 1/11/2019 at 02:06
If the first loot item is the conversation loot then any subsequent loot picked up by the player will combine with the conversation loot. Otherwise there will be more than one loot stack. I agree that Contains is not the way to go when it comes to giving loot to the player.
If the 53 loot item already exists when the mission starts then its not really a bonus. The total loot will include the 53, and those who find all of the other loot will know that there is 53 still to be found... somehow.
StoBo on 1/11/2019 at 06:55
Quote Posted by R Soul
Then give each coin a CD link to its own RelayTrap. Give each RelayTrap a CD link to the RequireAllTrap.
That seems to have solved the problem of picking things up in the wrong order from letting the RAT trigger the conversation.
Quote Posted by john9818a
If the first loot item is the conversation loot then any subsequent loot picked up by the player will combine with the conversation loot. Otherwise there will be more than one loot stack. I agree that Contains is not the way to go when it comes to giving loot to the player.
Yes, I'll have to go with NVScripts and ItemGiver. Still, it was good to learn a bit about conversations and how they work.
Quote:
If the 53 loot item already exists when the mission starts then its not really a bonus. The total loot will include the 53, and those who find all of the other loot will know that there is 53 still to be found... somehow.
That's not a problem. I'll eventually have a hidden optional objective "Collect all seven lucky coins" appear when you pick one up. If you never find any it will be 60 missing loot, a nice round number that won't make the player suspect anything other than they've missed a loot item.