Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Random walking + speech.

Acera

Sponsor

Greetings, for my current project I'm trying to make cities (note: the NPC's in it) as dynamic as possible. This means that your actions will have an influence on what they say. But I'm also using a few pre-set routes for each NPC to walk on (mostly 3-5 for each).
So i'm using this set-up:
http://img137.imageshack.us/img137/751/pic1ca1.png[/img]

But if I use this, I keep getting the message spammed in my screen. While I didn't even press anything yet (just like an autorun and a speech).
How should I make this event so it:
-can have multiple routes
-have multiple speeches

I'm all set with the variables (for randomness), but putting them together on 1 event doesn't seem to work for me.

Thanks in advance,
~MindHunterr
 

Acera

Sponsor

gratheo":2mtbkfh9 said:
Sure - try this. Using self-switches, have your move routes set autonomously for each switch necessary.
Then, work it all out from there.
Hope this helps...

I just tried this out. Yes it works to a certain extent. I can now do the multiple routes and random speeches (I can live with "only" 4 different routs). But now I have the problem with turning the self switches off. I can't pick the "switch off", because it only applies to normal switches, and not to self-switchs (and using 3 switches for each NPC is a bit overdone imo). Unless anyone can tell me how to put the 2 necessary commands in a "script"; "wait for move's completion" and "control self switch"

Any other suggestions are also appreciated =)

~MindHunterr
 

Acera

Sponsor

Well thanks for trying to help me, but for some reason I don't think you've read any of the posts. I'll write it up again (including other tips)
We have a NPC named Test

I want NPC Test to have 3 moving routes, which are obviously different. These routes are picked by a random number (picked by Variable vA).
NPC Test also has diffent things to say (connected to where in the story you are, your decisions and just standard lines). These are also picked by a random (and also picked by Variable vA). So, at first I came up with this:
http://img137.imageshack.us/img137/751/pic1ca1.png[/img]
But it keeps looping the speech instead of waiting for when I press the C button (note: C = Enter).

Now gratheo thought of doing self switches. So I decided to try that.
-----
Page 1:
random number 1-3
-depending on the number turn on self-switch A,B or C.

Page 2,3,4:
(each set to be used if either A,B,C is on, depending on page)
Each of these has an Autonomous route set (and they differ from eachother, obviously)
And I just filled the page with random text and such.
-----

Doing this will enable the NPC to pick a path to walk, (the self switch A,B,C) but if one is chosen it wont go back to the first page, as there's no way to turn the self-switch off again (which needs to be in the Move Route window, else it will do a weird reset at a wrong point, which will mess up the paths)

~MindHunterr
 
Ahh at the very end, use the script function and type:
Code:
$game_self_switches[[mapID, eventID, "switch"]]=nil

Change mapID and eventID to the IDs, and switch is the letter (A, B, C, D).
 

Acera

Sponsor

Regimos":3c4e4w0m said:
Ahh at the very end, use the script function and type:
Code:
$game_self_switches[[mapID, eventID, "switch"]]=nil

Change mapID and eventID to the IDs, and switch is the letter (A, B, C, D).

You just made my day :thumb:
That was exactly what I needed and it works perfectly now *bows*
Thanks a lot Regimos!

~MindHunterr
(this can be closed now afaik)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top