RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Item Repeating

0 Members and 1 Guest are viewing this topic.

****
Rep:
Level 89
In one of my quests I have a man offer the hero a grueling quest to obtain a certain rare item and the "bring it back" to him. This is not a problem to set the conditional branches and whatnot. The only problem I am having is the repitition of whenever I open the chest (for instance, right afterwards), I get the same item...over and over again.

Just for fun I was going through the maps and looking for errors and this popped up. If I have confused you thus far, then let me try to give you an example.

1. Created an event with a chest that is closed:
2. Wrote in this code to make the chest open and close, along with give the message "You have found the Nightmare Plate!" and the change of Defense Items.

Code: [Select]


<>Move Event: This Event
:                : <>SE: '044-Chest01'.80.105
:                : <>Lock Facing: OFF
:                : <>Face Left
:                : <>Wait: 1 frames
:                : <>Face Right
:                : <>Wait: 1 frames
:                : <>Face Up
<>Wait: 5 frames
<>Message: You have found the Nightmare Plate!
<>Change Armor: [Nightmare Plate] +1
<>Wait: 5 frames
<>Move Event: This Event
:                : <>Face Right
:                : <>Wait: 1 frames
:                : <>Face Left
:                : <>Wait: 1 frames
:                : <>Face Down
                 : <>Lock Facing: ON


Now, suppose just for the hell of it I decide to open the chest again. I will get the message "You have found the Nightmare Plate" and will end up getting one more set of armor.

I want to do this without erasing the event. Erasing the event is as easy as cake, but I don't want the chest to disappear.

EDIT: Nevermind, I'm an idiot. Had my switches mixed around. But here's a good reference for any newbies who want to do the same thing and don't know how.

Step By Step:

1. Create a new event and add a closed chest you so desire.
2. Creat a new switch...call it Chest Open
3. Insert this information in which case is appropriate in your Event Commands window.

Code: [Select]


<>Move Event: This Event
:                : <>SE: '044-Chest01'.80.105
:                : <>Lock Facing: OFF
:                : <>Face Left
:                : <>Wait: 1 frames
:                : <>Face Right
:                : <>Wait: 1 frames
:                : <>Face Up
<>Wait: 5 frames
<>Message: You have found [color=darkred]'What did you find?'[/color]
<>[color=darkred]'Change of what?'[/color]
<>Wait: 5 frames
<>Move Event: This Event
:                : <>Face Right
:                : <>Wait: 1 frames
:                : <>Face Left
:                : <>Wait: 1 frames
:                : <>Face Down
:                : <>Lock Facing: ON
<>Switch: [Your switch here] = ON
<>



4. Create a new page.
5. Select the same chest image as the last page.
6. Insert this code in the Events Command window on the second page:

Code: [Select]

<>Move Event: This Event
:                : <>SE: '044-Chest01'.80.105
:                : <>Lock Facing: OFF
:                : <>Face Left
:                : <>Wait: 1 frames
:                : <>Face Right
:                : <>Wait: 1 frames
:                : <>Face Up
<>Wait: 5 frames
<>Message: "Chest Empty!"
<>Wait: 5 frames
<>Move Event: This Event
:                : <>Face Right
:                : <>Wait: 1 frames
:                : <>Face Left
:                : <>Wait: 1 frames
:                : <>Face Down
                 : <>Lock Facing: ON


7. On the second page set the Preconditions to your Switch (Chest Open) and make sure it is on.

After all is said and done you should have a one time chest that will increase what ever you want it to, and will not delete the image itself. When you try and open the chest a second time, you will get the "Chest is Empty"
message.

Cheers

[Screens]



*
Rep:
Level 97
Definitely better than Hitler.
2014 Best IRC Chatterbox2014 Best Musician2013 King of RMRK2013 Best Musician2013 Best Use of Avatar and Signature Space2013 Funniest MemberFor the great victory in the Breakfast War.2012 Best Username2012 Best MusicianFor frequent good quality Wiki writing [citation needed]2011 Funniest Member2011 Best MusicianMost entertaining member on the IRC2010 Most Missed Member
You should make use of a switch. If you don't know how to use switches, check out one of the tutorials. Also, just to note, the erase event only "erases" the event until you re-enter the map.
:tinysmile:

****
Rep:
Level 89
Yeah I know. I had my switches mixed up between ON and OFF. I wasn't able to finish editing my last post that tells the story. I also included a tutorial on how to do it without confusing the switches. Hope it helps.