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.
NPCs triggering one another?

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 86
It's Jepherz Bitch
alright so here's the deal...

The player is allowed to steal items (everything works fine) the soldiers bring him to jail when caught and all that, then when he goes back to the place where he stole and he's not allowed in for a day...

here's the problem: I want OTHER people (npcs) to be able to go inside and out, to show to the player that he really is being shunned by the soldiers and law and all that...

But, when I make the 2 npcs touch they just stay there..
I put the soldier who is supposed to move out of the way triggered by event touch while the other npc just walks up to him, SUPPOSED to trigger him.... won't work...
Help, please?
« Last Edit: December 31, 2008, 01:24:27 PM by Jepherz »

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
Events don't trigger other events via those options. Those are for the interaction between the player and events. You could do this with conditions and variables if you were to have an event track the position of another event. For instance, Event1. Variable[1]==Event1MapX, Variable[2]==Event1MapY, Variable[3]==Event1MapID (and if super detailed, Variable[4]==Event1DirectionFaceUp). Then have the guard event track Event1.

So let's say the door is at position [5,5] on the map. The guard is in front of the door and his position is [5,6]. Now in a conditional branch, have it IF variable[1]==5, and then another directly under it as IF variable[2]==7 then one under that again as IF variable[3]=="whatever map ID you're on" (and another directly under that if you're detailed as IF variable[4]==Event1FacingUp). ALL OF THAT, and THEN [or Else], move the guard event out of the way. Set a movement command, turn its Through ON, then walk him through that event it was tracking, then a space to the left or right or something, then turn Through OFF. Then move Event1 UP one space, then erase that event, or turn on a switch for it and turn the graphic off.

**
Rep:
Level 86
It's Jepherz Bitch
Thanks :]

EDIT: How would I allow ALL events in and out.. is there a combination of variables, a common event I could create... or is it impossible?
« Last Edit: December 31, 2008, 01:25:20 PM by Jepherz »

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
What do you mean, In and Out? Are you asking if you can teleport events from one map to another? If so, then no. Not unless there is some script that will allow it. You can't transfer the information of an event to another map unless you were to have EventA on Map1 walk to a door, turn ON SwitchX and then have the graphic disappear, then have a matching EventA on Map2 on the inside of the door or just somewhere inside or on the other side of the door that only is turned on when SwitchX is ON. You wouldn't be able to use and self switches and it'd be very tedious to keep track of what events have happened and what ones are still waiting to happen and then reverse them if you want them to come back to Map1. Of course if you're just asking if you can get an event to go through a door and into a building that is all on the same map, then just after Event1 (from my previous post) would pass the guard, have it move Up 1 space, then do the movement commands for the door opening and have Event1 move Up 2 more spaces into the building, then do the movement commands for the door closing.

Edit: I just noticed your:
Quote
How would I allow ALL events in and out

If you mean how can you allow every event to do the same as the example I showed you from my first post? Then you would have to have one, or multiple events tracking the movement of each event using at least 3 variables. The X, Y positions and MapID. You could use 2 variables come to think of it, since events can't really transfer maps, the ID would always be the map it is on and you need only to check the position of the same map, so you would really only need to track the X and Y positions of each variable basically. You could still have 3 variables per event if you wanted the 3rd to track the direction the event is facing. It'd probably get kind of tedious tracking each event, and you would want to name each event to keep track of them.
« Last Edit: December 31, 2008, 03:58:25 PM by Prince Grafikal006 »

**
Rep:
Level 86
It's Jepherz Bitch
... really didn't think further than that!! xD
Alright, and last but not least... The guard that is guarding the door... If I put it in parallel process,
he just keeps repeating the same thing over and over, and the player is stuck there. But on the other hand,
If the guard isn't running on parallel process, the other events can't work. Unless I just make them go
through each other, which in my opinion, doesn't look so nice...

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
What do you have the guard doing? Parallel processes don't keep your character from doing anything unless the Guard has an event command that stops player movement. For instance, if you have the Wait command on while the Guard is doing anything or if you have the Guard moving and has a wait command attached to that. Also, if you want the guard to just move out of the way and be done, then at the end of the conditional branches after everything else has occurred, turn ON Selfswitch A and then make a new Event Page with just the Guard graphic and maybe a line of text if you intend to be able to speak to him, and make the conditions for this page Selfswitch A On.

**
Rep:
Level 86
It's Jepherz Bitch
Spoiler for:
Event

Spoiler for:
Map


EDIT: so the problem is that when the player will talk to the guard, he'll keep babbling and hte adventure is over XDD
« Last Edit: December 31, 2008, 05:58:50 PM by Jepherz »

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
Well, your first problem, is that you have that first event screenshot up top running on an Autorun. It should be parallel.

Another, on that last screenshot of your event page, is, I'm confused as to why you have:
Condition: Switch Noon ON
Condition: Switch Dawn ON
Condition: Switch Noon ON
  > stuff stuff stuff

There's no need to repeat that last conditional. It's already checking if Switch Noon is ON. Same goes for the rest like that down there.

Also, on very first conditions, where it's checking the Player's X, Y pos, and MapID and Direction, you don't need any of that. You can just get rid of that, and have it so when the player just talks to the guard he says that. You don't need to track the player's position. Only the event's positions.

I'll get in more detailed soon, I'm being very rushed out the door.

**
Rep:
Level 86
It's Jepherz Bitch
The reason why theres Condition: Noon
      -----> Condition: Dawn..
 then Condition: Noon again...
Is because when the player gets caught stealing, he's not allowed back in the Town Square for a day...
So, I make sure its exactly a day..

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
You can't use conditionals like that, you need to use switches for that, those conditionals are checking, all at the same time, if Noon is on, if Dawn is on and if Noon is on again. Noon is already on, so the 3rd noon, is not necessary at all.

You'd need to make some kind of a timer if you want to have it check at certain times. Uhh. I'm trying to think a way best to describe it... Uh, I'll just tell you how to set it up instead then. Lol. And then I'll try and explain what's happening.


Ok, so... you get caught stealing. You're locked out and you want NPC's to go through to the market area, but not the player. In your screenshot of the guards, I'll call the guard on the far left of the market area only 'Guard1', and the guard on the far right of the market area only 'Guard2'.

It appears you only have 1 NPC, and I'll tell you how to use her, but if you have more I'll explain that if you want, though it'd be the same as the one, just repeated with more variables. Also it looks like you have a day/night system, so I'll tell you how to incorporate that too.

Vocab:
Girl NPC Event Name ~ Girl1
Left NPC Guard ~ Guard1
Right NPC Guard ~ Guard2
Player ~ uhh...Player


Ok.

You should, preferably, make 2 Common Events for this.
Just for this example, we'll name them: Shunned1Left and ShunnedRight
Make these Common Events both Parallel Processes and make a new switch that turns these Common Events on, and also for the sake of this example, we'll name that Switch: Shun Switch On

NOTE: Turn this switch ON only when you are shunned and OFF when you're done using this, as this can contribute a small part to lag if you have a lot of things running in your game and it's always good to get rid of things you're not using to reduce lag.

In the common events, begin by creating all the variables you'll need. [Note that the ID I use to label these variables are arbitrary and you can use whatever ID variables you want]
Variable[1]==Girl1Xposition
Variable[2]==Girl1Yposition
(You don't actually need the MapID variable for this here.)

Now for the sake of this example again, we'll make up positions for the guards. Guard1 is at [5,5] and Guard2 is at [15,5].

After you defined those variables, create the conditionals like this: (note that this is for if she walks into the market from the left side.)

Condition::IF:Variable[1]==4
>Condition::IF:Variable[2]==5
>>Condition::IF:Girl1 Face Right
>>Movement Command: Guard1(Wait)
>>>>>>>>Move Right
>>>>>>>>Move Up
>>>>>>>>Face Down
>>Movement Command: Girl1(Wait)
>>>>>>>>Move Right
>>>>>>>>Move Right
>>>>>>>>Move Right
>>Movement Command: Guard1(Wait)
>>>>>>>>Move Down
>>>>>>>>Move Left
>>ELSE
>ELSE
ELSE


The Common Event for the girl walking in from the right side is like this:
(Define your variables again, though you don't need to as long as the other common event is still running)

Condition::IF:Variable[1]==16
>Condition::IF:Variable[2]==5
>>Condition::IF:Girl1 Face Left
>>Movement Command: Guard1(Wait)
>>>>>>>>Move Left
>>>>>>>>Move Up
>>>>>>>>Face Down
>>Movement Command: Girl1(Wait)
>>>>>>>>Move Left
>>>>>>>>Move Left
>>>>>>>>Move Left
>>Movement Command: Guard1(Wait)
>>>>>>>>Move Down
>>>>>>>>Move Right
>>ELSE
>ELSE
ELSE

Now, these cover the girl getting into the market. However, I would suggest, that when she enters the market, that your player is near the events so that you can see this happening, otherwise if you cannot see it and then the conditions become fulfilled, the game will pause until all of the events' movements are completed.

To get the girl OUT of the market is the same way as getting in. Make a common event for each side, you could name them: ShunnedOutLeft and right.
Just change the conditionals in the variables to equal one space to the right of guard1 or one space to the left of guard2 before the movements occur.


Now here is something else completely. You want to have the player not be able to enter the market for a game day of time. This is separate from the commands of the girl NPC going in and out. For this you will have to, on your own, figure out how long an actual day is in game. Let's say your Day/Night timer is set for 2 minutes real time per day game time.

NOTE:
60 frames = 1 second
600 frames = 10 seconds.

So we'll set up a timer. Make a new Common Event, name it: Timer
Set it to a Parallel Process and make a new switch and name that: Timer
In the common event make this:

Variable[3] ==0
Label: Start
Wait: 600frames
Variable[3] += 1
Conditional::IF:Variable[3]==12
>Switch[ID:Shun Switch On] = OFF
>Switch[ID:Timer] = OFF
>>Movement Command: Guard1 (NO WAITING)
>>>>>>>>Move Right
>>>>>>>>Move Up
>>>>>>>>Face Down
>>Movement Command: Guard2 (NO WAITING)
>>>>>>>>Move Left
>>>>>>>>Move Up
>>>>>>>>Face Down
ELSE:
>Jump to Label: Start

Ok, what this does is loop the wait command until variable 3 = 12.
When the timer turns ON, this common event will refresh Variable[3] and it will equal zero. Then it'll wait 600 frames (10 seconds) and then add 1 to Variable[3]. Variable[3] now = 1. Then the event will check if V[3] = 12. It will not equal 12, so it goes to the Else commands, and that event command, 'Jump to Label', will automatically jump to where you labeled it, which is 'Label: Start'. (This prevents it from refreshing Variable[3] back to 0. Now again, since V[3] only equals 1 at this point, it will wait 600 frames again (10 seconds) and then add 1 to it where V[3] will now equal 2. This will AGAIN not meet the condition and jump back up to the label and repeat itself UNTIL V[3] is equal to 12. (2 minutes, or 120 seconds). Now that V[3]=12, it will turn off the Shun Switch that makes the player not be able to enter the market and also turns off the timer switch so that this event stops running, then it moves the guards out of the path so that the player can enter the market once again.

That's what is going on in there. Now, if your Day/Night system is longer or shorter than 2 minutes, you can edit what the conditional of V[3] is equal to. If your Day/Night system is 3 minutes per day, then the Condition would be set like IF:V[3] == 18. It's safer to go by increments of 5 or 10 seconds when using frames. 5 seconds = 300 frames, 10 seconds = 600 frames. So if your timer is something wild like 1minute 25 seconds, then change the "Wait" command in the event to 300 frames and then for every 1 of V[3] will equal 5 seconds instead of 10. So, if, for example, your Wait command here was at 300 frames, then 1 minute and 25 seconds would make V[3] have to equal 17. 17x5 = 85 seconds, 85 seconds = 1 minute 25 seconds. You get the idea I hope.


Now to the point. Just make sure you turn on the switches that control the common events. The advantage to using common events, is that it removes an extra page from any of the events on the map and you can use it anywhere. Also, it frees up a page so that you can have like one guard talking to you (and that's IT as far as event commands go on that page) while he's still doing the functions of the common event. It's cleaner.

Now, this is a hell of a lot of information I wrote here, if anyone see's any mistakes let us know. Also Jepherz if you have any questions on what stuff is doing, let me know.