Random npc event toggling

fuzzalicious

Villager
Member
Joined
Jun 3, 2014
Messages
23
Reaction score
2
First Language
english
Primarily Uses
I would like to have random npcs walk through my town, so I have a two questions:

• How can you display a graphic on the map through scripting? (So I can make random npc appear)

• Can you an event toggle by touching an npc, or script the npc to change if touch an event or tile id? 

That way I could make npcs disappear out of the map, and have them turn when the road turns instead

of having to type the whole route for all npcs.

Any help would be geatly appreciated =)

 
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
you questions show that you are very new to the program, and haven't learned the terminology or how things are done - for example, you should use eventing and NOT scripting for handling random events (there are no NPCs in the game, just events pretending to be NPCs - that's a very important difference).


you can change and trigger events by a lot of different ways, you can set them move routes or restrict them to portions of the map or a lot of other things.


I suggest you follow the link in my signature, that will show you to the most important tutorials and get you started fast.
 

fuzzalicious

Villager
Member
Joined
Jun 3, 2014
Messages
23
Reaction score
2
First Language
english
Primarily Uses
Excellent tutorials, especially about using forum search rather then googling =)

When I learned about control variables I was able to figure how to go about

making routes by eventing. However theres a little stutter when my npc walks,

probably because when I click "set move route", it automaticly inserts

Set Move Route: This event (wait) before $>Move left.

I also read that I should use autonomous movement, but I guess it's not possible

in this case?
 
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
However theres a little stutter when my npc walks,


probably because when I click "set move route", it automaticly inserts


Set Move Route: This event (wait) before $>Move left.
No, that is just the command header - but by default the events are set to a slower speed than the player, you'll need to increase speed and frequency where needed to get them moving more fluently.
autonomous movement is for independent movement outside cutscenes or special sequences - it usually helps a lot and makes things easier, but you can't coordinate several events as easy as with the set move route command.
 

fuzzalicious

Villager
Member
Joined
Jun 3, 2014
Messages
23
Reaction score
2
First Language
english
Primarily Uses
I have set frequency to max in autonomous movement and it's never changed.

If I remove wait for completion in movement the stuttering stops, though it leads

to many new problems.
 

fuzzalicious

Villager
Member
Joined
Jun 3, 2014
Messages
23
Reaction score
2
First Language
english
Primarily Uses
I was able to fix the stuttering by using script calls rather then events, but now i have

move_route = RPG::MoveRoute.new
m = RPG::MoveCommand.new
in the code, and since I use it in a parallel process does it make a new instance every step?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
I have set frequency to max in autonomous movement and it's never changed.
Are you using autonomous movement?
Changing the frequency in autonomous movement will not work if you're using a set move route command, it will only work if you have activated autonomous movement. If you're using a set move route command, then you need to change the speed inside that command sequence.


Show us a screenshot of what you're doing, and then we can tell you if there is a better way - it reads as if you're mixing things that can't work together. And if at all possible, you should not use parallel process for movement - there are a few specific cases where you will need a parallel process for movement, but so far nothing I read here indicates that it is needed here, and too many parallel processes will cause lag in the game.


fuzzalicious, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.
 

fuzzalicious

Villager
Member
Joined
Jun 3, 2014
Messages
23
Reaction score
2
First Language
english
Primarily Uses
Ahh no I was wrong, when I use autonomous movement and have frequency set to normal and then set a set route command event, the frequency

speeds up so I assumed it was maxed.

Now my code looks like;

if $game_map.events[17].x == 1

$game_variables[2] = 3

elsif $game_map.events[17].x == 30

$game_variables[2] = 2

end

 

move_route = RPG::MoveRoute.new

m = RPG::MoveCommand.new

m.code = $game_variables[2]

move_route.list.insert(0,m.clone)

$game_map.events[17].force_move_route(move_route)

 

 

Which means if the event 17 (an npc) reaches furthest left or right her direction changes to other direction, to get the npc to walk back and forth the map.

 

It works great but it's a parallel process and I don't know if it's leaking by creating new objects that arn't cleaned away.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top