The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Tutorials and Eventing => Topic started by: Armadilloshriek on November 15, 2009, 06:38:21 AM

Title: i need to get those things first before i can leave
Post by: Armadilloshriek on November 15, 2009, 06:38:21 AM
is there perhaps a way to create an objective in which the hero needs to collect all the items in the room before he can leave it. should he leave the room, he reminds the player that he cant leave unless he has those specific items.
Title: Re: i need to get those things first before i can leave
Post by: Nessiah on November 18, 2009, 01:20:28 PM
Well...you can use conditional branches and let it check the "item switches" arcross the room, e.g.

if switch one is on
if switch two is on
  if switch three is on
        TELEPORT To New Map :D
    end
  end
else
It feels like we're missing some items
end

If can also be


if hero has x item in possession
if  hero has y item in possession
   if hero has z item in possession
        TELEPORT To New Map :D
    end
  end
else
It feels like we're missing some items
end
Title: Re: i need to get those things first before i can leave
Post by: Roph on November 18, 2009, 01:47:05 PM
Isn't she great *-*
Title: Re: i need to get those things first before i can leave
Post by: shaz on November 18, 2009, 10:14:55 PM
You could also use variables for this instead of lots of switches - when each item is collected, add 1 to the variable.  On the teleport event, if variable < number of required items, show message, otherwise leave.

The really nice thing about Nessiah's suggestions (both of them) is that if you want to, you can specifically point out what the player still needs to get, or maybe give them a hint.
Title: Re: i need to get those things first before i can leave
Post by: Armadilloshriek on November 24, 2009, 12:31:52 PM
Thanx shaz and nessiah. its just, embarrasingly im still a bit of a noob. if you could just be a tad more detailed in your explanations? sorry, haha, ive only had rm2k for about a week now. :-\
Title: Re: i need to get those things first before i can leave
Post by: shaz on November 24, 2009, 08:53:19 PM
I'll show you all 3 ways...

Nessiah #1:
Allocate a switch to each item you want the player to collect.
On the item, when the player collects it and you increase their item count, turn the specific switch on.
On the door event, have a series of embedded conditions:


Condition: If switch1 is ON (switch 1 is turned on when you pick up item 1)
  Condition: If switch2 is ON (switch 2 is turned on when you pick up item 2)
    Condition: If switch3 is ON (switch 3 is turned on when you pick up item 3)
      (more switches here)
        Teleport to New Map
        Exit event processing
    End
  End
End

Show Text: It feels like we're missing some items


There's a slight difference to the original suggestion, as I just now realised the message is part of an Else statement, and would only be shown if the player didn't have item 1 (if they had item 1 but not item 2 or 3, you wouldn't teleport, but you wouldn't get the message either).

Nessiah 2:
Easier - on each item to collect, just increase the player's count of that item.  On the door event have the following:

Condition: If hero has item 1 in possession
  Condition: If hero has item 2 in possession
    Condition: If hero has item 3 in possession
      (more conditions here)
        Teleport to New Map
        Exit event processing
    End
  End
End

Show Text: It feels like we're missing some items



and finally my variable suggestion:
On each item, when you increase the player's count of that item, also add 1 to a variable:

Change Variables [0001: Items Collected] + 1


And on the door event:

Condition: Variable [0001: Items Collected] = 3 (or however many items they need to pick up)
  Teleport to new map
Else
  Show Text: I feel we're missing something
End
Title: Re: i need to get those things first before i can leave
Post by: shaz on November 24, 2009, 08:54:05 PM
Do some searching for tutorials telling you how to use switches and variables, and how to test for conditions.  These are all commands on the event tabs.
Title: Re: i need to get those things first before i can leave
Post by: Armadilloshriek on November 25, 2009, 02:00:16 PM
Alright, let me just make sure i understand. suppose i went with nessiahs 2nd suggestion. theres this fantastic little thing called fork conditions on the event command menu that can work miracles. should i use it in this case?
Title: Re: i need to get those things first before i can leave
Post by: shaz on November 25, 2009, 09:30:51 PM
mmm - I'm an XP user, and not familiar with fork conditions.  That may be the Condition command.  Try it, and see if you can compare switches, variables, what the user has in inventory, who is in the party, etc.  If it's got all those things, that's the one you're after :)
Title: Re: i need to get those things first before i can leave
Post by: Nessiah on November 27, 2009, 01:35:31 AM
Yes, Fork Condition is Conditional Branch :p