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.

How do you create an event in an action?

I need to spawn an actor (event) to one square besides the Player how can I do this?
I found this script somewhere, but not sure how to implement it (the Call Script window is too small). Thanks for any help.

Code:
ev = RPG::Event.new(x, y)

    ev.id = $game_map.events.size + 1

    ev.pages = []

 

    # Create a game event object using map id and ev value

    event =  Game_Event.new($game_map.map_id, ev)

    event.through = false

 

    # Set the event at ev.id to our event (include it in map)

    $game_map.events[ev.id] = event

    @index = ev.id        

    #$event_instance[ev.id] = event

    #$game_map.map.events.keys.push(@index)

    $game_map.map.events[@index] = ev

    #print $game_map.events

 

    # Map needs to be redrawn because a new event was added

    $game_map.need_refresh = true

    $scene.spriteset.add_additional_sprites
 
Are you going to be making tons of these, or is this one or two sprites?

Because if it is, you could just have a couple of invisible events on the map, and then use Control Variables (to get the player's location) and Set Event Location (using those variables), with Set Move Route to change the event's graphic.
 
true. That was what I was thinking but havent tried yet. I think it might look random though, i.e. I cant set it to like the +1 X axis of the player. Also you never know where the PC is and Move to player can only happen when the PC is in the screen of the event. :S

Its just one or two sprites. Its just so that.... for example I can create a character next to the PC for dialogues of a party member. So do you know how to implemtn?

Better yet let me rephrase my question - is there a way to make your party member pop out of the player character for dialogue scenes?
 

Ares

Member

Yes, there is.
If you wait a few mins, I can make you a short tutorial ;)

Here goes:

Step 1: Create an event like this:
111.PNG

*Note it's a Parallel process!

Step 2: Put in the following Event Commands (except for the comments)
23.PNG

Step 3: Create the second page
32.PNG

Now all you have to do is turn the switch 'I appeared!' on, and he will walk out of you :O
And to make him disappear again, just turn the switch off.
 

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