Author Topic: Knowing who besides Who  (Read 3830 times)

0 Members and 1 Guest are viewing this topic.

Roxaszu

  • Tier 7
  • *
  • Posts: 935
  • Gender: Male
  • Current Mood: creative creative
Knowing who besides Who
« on: November 07, 2014, 10:24:49 AM »
Ok,
So I stuck a little bit about The Rpg Maker VX Logic for My Game.
And I really need help.

So, Let's just say I have something like this :

Spoiler: show


Now,
The thing is,
all of them is events,
How can one of the event know who is besides him/her Or knowing who is diagonally ?
Like for example, How can number 5 know that South of Her know that there are no 8, And how can number 1 know that His diagonally is number 5 ?

Note : Within the case that every time you play it, no 1-9 will be randomized, So each time you play it, It'll be in the different order.But still same that The script or the common events can detect, Who/what event is besides this or that event .

Is it possible to create this with common event ?
Or
if it must be done with the script, How can I make the script so I can make it know each other?

Looking forward for the advice guys,
And Thank you in advance :)

Unimaginative Username

  • Guest
Re: Knowing who besides Who
« Reply #1 on: November 07, 2014, 04:09:08 PM »
I'd know how to do this with objects in Unity, but I expect Rpg Maker VX is a fair bit different and I have no knowledge of Ruby. Sorry  :P

Roxaszu

  • Tier 7
  • *
  • Posts: 935
  • Gender: Male
  • Current Mood: creative creative
Re: Knowing who besides Who
« Reply #2 on: November 07, 2014, 08:21:12 PM »
I'd know how to do this with objects in Unity, but I expect Rpg Maker VX is a fair bit different and I have no knowledge of Ruby. Sorry  :P
Ah, Yes.
I can have the logic if it's C / C++ / C# / Java.
But It's looks like Ruby Common Events is a little bit different  :reivsweat:
It's look's like I've got to try to learn how to use Ruby Script again (Which is the one that I tried to avoid) ::)
Anyway, Thanks for the input, TPO :)

Tumbles

  • 海が私の心です。
  • *
  • Tier 7
  • **
  • Posts: 3956
  • Gender: Male
  • I am who I am, but not yet.
    • Big Palooka
  • Current Mood: cheerful cheerful
Re: Knowing who besides Who
« Reply #3 on: November 07, 2014, 10:03:38 PM »
I'd do it using an array. Not sure if that's possible in the engine, but... yeah. That's how I'd do it.

Spoiler: show


                                         

~

Roxaszu

  • Tier 7
  • *
  • Posts: 935
  • Gender: Male
  • Current Mood: creative creative
Re: Knowing who besides Who
« Reply #4 on: November 10, 2014, 11:49:16 PM »
I'd do it using an array. Not sure if that's possible in the engine, but... yeah. That's how I'd do it.
Yes,
Now I got the BIG Question Mark,
How to implement 2D Array in RPG Maker VX (RGSS2) ?
I using "$name[4][5] = 10" as a test, And It comes to be an error -.-

Ancurio

  • *
  • Tier 5
  • **
  • Posts: 212
  • Gender: Male
  • Current Mood: blank blank
Re: Knowing who besides Who
« Reply #5 on: November 11, 2014, 10:11:03 AM »
That's because you're trying to access an undefined variable as an array. You have to initialize the variable properly first. Try something like
Code: [Select]
$name = []
10.times {|i| $name[i] = []}

10 is just an example for the outer size, ie. you can then access it with $name[number smaller or equal 9][any number]

Roxaszu

  • Tier 7
  • *
  • Posts: 935
  • Gender: Male
  • Current Mood: creative creative
Re: Knowing who besides Who
« Reply #6 on: November 11, 2014, 12:04:00 PM »
That's because you're trying to access an undefined variable as an array. You have to initialize the variable properly first. Try something like
Code: [Select]
$name = []
10.times {|i| $name[i] = []}

10 is just an example for the outer size, ie. you can then access it with $name[number smaller or equal 9][any number]
Ahhh,
Yes...
So that's how it is done .
It works at VX :)
Thanks Ancurio, I think This thread is consider solve (For now) :)