Mikemuk01

Black Mike
Member
Joined
Mar 18, 2013
Messages
27
Reaction score
0
First Language
English
Primarily Uses
I'm sure there will be a simple answer to this problem, but I can't find it.  I want my player to accept a task from an NPC, which he will then start.  If he


hasn't completed it within 100 steps he will be told by the NPC that someone else has done the job.  I know that steps are recorded, and that I need to


put the starting steps into a variable, then count up as the player moves, but I can't work out how to Event this.  Any help would be appreciated.  Thank you
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,310
Reaction score
8,753
First Language
German
Primarily Uses
RMMV
most people use two variables for this - it is possible to do with one variable, but then you need to be able to do the math correctly (substraction and compare to zero)


on quest start, use control variable : game data : other : steps to store the starting steps in the first variable.


then add +100 to that with a second control variable command.


on quest end, use the same to store the new current steps into a second variable (but without adding 100).


then use conditional branches - if the new current is higher than the old (which was added the 100 steps) then the quest failed
 

Mikemuk01

Black Mike
Member
Joined
Mar 18, 2013
Messages
27
Reaction score
0
First Language
English
Primarily Uses
Thank you Andar. I'm travelling at the moment, but as soon as I can I'll give your method a try. Thank you.
 

Brigg

Veteran
Veteran
Joined
Apr 22, 2015
Messages
129
Reaction score
4
First Language
English
Primarily Uses
You can store the Steps data in a variable when you first get the mission. 


Control Variables: [001: Steps1] = Steps


If you're returning to a contact to complete it, you can store your new currents steps in a 2nd variable, then subtract the first variable from the second:


Control Variables: [002: Steps2] = Steps


Control Variables: [002: Steps2] -= Variable: [001: Steps1]


Conditional Branch: Variable: [002: Steps2] > 100


  @>Text: Sorry, someone else has completed the job.


:Else


  @>Text: Thank you for finishing the job in a timely manner!


Branch End


Or, although I'm not a huge fan of using Parallel Processes in this manner, if you want to risk lag, you could create a Parallel Process that is doing the completion function above so that it pops when the steps go over 100 saying that the mission failed. To be safe, I would add @>Wait: 10 frame(s) to limit the lag.


Just be sure that if the mission is completed or failed, you add a Control Self Switch to end the Parallel Process.
 

Mikemuk01

Black Mike
Member
Joined
Mar 18, 2013
Messages
27
Reaction score
0
First Language
English
Primarily Uses
Thank you for the info. I think I understand how to do it but not where to put the commands. This is what I've tried


Text - Will you accept the task


Choices yes/no


If yes


Control switch 0022 QuestStart on


Control variable 0020 StepsTaken = Steps


Control variable 0018 TimeUp -= variable 0020 StepsTaken


Conditional branch variable 0018 TimeUp > 100


Text - Time up


Unfortunately this does not work. Nothing happens regarding the steps taken and the event continues as if the steps routine was not there.  Any advice?
 

Brigg

Veteran
Veteran
Joined
Apr 22, 2015
Messages
129
Reaction score
4
First Language
English
Primarily Uses
Can you post a picture of the event?


What's under Show Choices- @if No, option? From what you posted, it looks like you are doing the step check at the same time you are accepting the quest. If that's true, you're telling the program to check the current steps to see if it's over 100 when you first accept it. Which obviously, at this point, that wouldn't be true, because you haven't actually started or even taken a step yet.


How do you want to check if the 100 steps have happened or not? Are you speaking to your contact later, and THAT'S when he's saying it's too late, OR do you want it to alert you when you are walking around and hit 100? Do you want a window popping up saying You did not complete the quest in time?


Here is something I put together based on the information you gave. It is reorganized in a way that should work as you intend it. I also added  Switch [0023:QuestComplete] which you will have to tell when to switch on after the quest is completed - if you so choose. It is only a suggestion based on what you had so far. Remember to add the Control Self Switch: A page to prevent the event any overlapping. Me, personally, I would turn the switches off if they only correlate with the quest here and not the storyline. Turning the Switch [0022:QuestStart] to Off, however, will allow you to do the mission again without the Control Self Switch.


Capture.PNG
 
Last edited by a moderator:

Latest Threads

Latest Posts

Latest Profile Posts

Reading about metaverses recently. I can totally imagine myself in the future, logging in with VR glasses to a virtual beach villa sitting in a virtual chair, with a virtual laptop facing the sea...coding 16-bit RM.
Mod name: "[Game name] Gameplay Overhaul"
What they actually mean: "Here is a mod that makes the game harder."
I decided to reinstall one of my most favourite game of all times, Gothic 2. Time to get back to Khorinis!
So much game make... I needs to rest. The foods call.
-Casino with bunnysuit green check.png
1638563168795.png

Forum statistics

Threads
117,166
Messages
1,105,098
Members
153,259
Latest member
litespace
Top