v1c10us

Villager
Member
Joined
Nov 13, 2016
Messages
5
Reaction score
1
First Language
Polish
Primarily Uses
Hello. At first, sorry for my poor English. I'm trying to make a game in the atmosphere of Silent Hill. If you played "Silent Hill", you probably remember the radio that was warning you when the enemy was close. The noise from the radio was getting louder when enemies were nearby. I wanted to implement that in my game, but after hours of trying I just gave up. Can any1 help me make this work? I'm uploading screenshots with this post and legend to them below:


001 - Player XY coords set, Enemy (Monstrum) XY coords set, and Player XY sub Enemy XY coords.


002 - The event that changes depending on the Player and Enemy distance. Each event has it's page and is activated by Switch NOISE A (the enemy is far), NOISE B (the enemy is getting close), NOISE C (the enemy is close to player).


003-A/003-b - Here's where I totally failed... I have no idea why it's not working... According to my calculations, it should work :( But it's not... You can see how I calculated this on picture number 005 (Dźwięk = Sound/Noise). On picture 004 there's only empty map (not sure why the hell I uploaded it anyways...) I wonder where I did mistake? If there's any1 that can make a quick example in RPGM MV and attach it, or upload a plugin, or just simply explain how should I do this, I would be very grateful. THANKS SO MUCH!!! <3

001.png

002.png

003-A.png

003-B.png

004.png

005.png
 

Lestroth

Veteran
Veteran
Joined
Apr 7, 2013
Messages
121
Reaction score
72
First Language
German
Hey,


at first sight I can see that your if/else statements can not work the way you set them up.


If you put one if into another, it means that you check for case 1 to be true AND case 2 to be true. You have to use else instead! (Please note the small check box in the conditional branch command "Create Else Branch")


In your screenshot for example you check if variable 1 is between 6 and 3 AND between -6 and -3 which will never be the case ;)


Using positive and negative values to determine the distance between monster and player looks extremely cumbersome to me. I would advice using some JS here: Math.abs() returns the absolute value of a number. You can use that with your variables.


check1.png


Please note that I used 6 instead of 4 variables because it was easier for me to get into your problem.


In case you're wondering: Calculations like this can be done in the Script field in Control Variables.


No longer dealing with negative values, you'll have much less trouble defining the if/else statement. Mine looks like this:


sol1.png


I really hope this helps.


Oh, and hopefully you can bake. I claim a cookie for all that effort! ;)
 
Last edited by a moderator:

v1c10us

Villager
Member
Joined
Nov 13, 2016
Messages
5
Reaction score
1
First Language
Polish
Primarily Uses
Thanks a lot for answer, gonna try this 2morrow for sure :D Will leave a comment if it worked!
 

v1c10us

Villager
Member
Joined
Nov 13, 2016
Messages
5
Reaction score
1
First Language
Polish
Primarily Uses
Hello there again! Sorry it took so long, was busy at work :D Finally I could test the method you showed me and guess what... IT WORKED!!! Gonna take me some time to totally understand it (I was never good at math...), but I will eventually get it by making my game further ;) You are genius! Much love <3 :D


 


COOKIE.png
 

Lestroth

Veteran
Veteran
Joined
Apr 7, 2013
Messages
121
Reaction score
72
First Language
German
Oooh, Cookie ;Q


Erm, I mean: Glad it finally worked out for you :)


It takes some time getting used to RPG Maker, but you'll figure it out eventually. When you need further help, you can come back here anytime!
 

v1c10us

Villager
Member
Joined
Nov 13, 2016
Messages
5
Reaction score
1
First Language
Polish
Primarily Uses
  • Now I have another problem... :( When my enemy is on the edge of right side on the map and I'm on the left edge, the event "thinks", that he's close to me somehow... Is there a plugin or a solution to solve it?



EDIT!!! Never mind, I did something terribly wrong :D
 
Last edited by a moderator:

Latest Threads

Latest Profile Posts

Has it really been 50 streams? At this point it's just guilting me into pushing out a prototype. :kaoswt:



I should probably just bite the bullet and send it out, then go with my original plan to provide weekly updates.
I know it's just other small RM devs, but it still always feels legitimizing to have folks email me in private with a steam key, requesting a review of their game.:kaoluv: Look ma, I've made it to the big leagues. small edit: another email just came in. :kaoback:
time and time again I enjoy dramatic remarks on how I should find a better job.
As it stands, I go to work for 10-14 days a month. At work, I have time for my private projects. I arrive home, my mind is clear.
So yes, the pay sucks. But I have what so many lose after graduation. Freedom.
Came back cuz of the sale. Got MZ. The System 2 advanced settings for UI are so frustrating, and I see we still hate pixel fonts. Marvelous.
Did another YouTube short. This one has like 1k views (or maybe 380? Analytics is being weird). Getting them zoomer views, yo!

Forum statistics

Threads
129,719
Messages
1,204,647
Members
170,803
Latest member
JimGTz
Top