Advanced: Creating Events During Gameplay?

● ARCHIVED · READ-ONLY
Started by Dymdez 20 posts View original ↗
  1. Not sure how to phrase this but does anyone know of any ways or scripts that allow the player to create an event during gameplay? I want to have my player use an item that would create an event on the tile in front of the direction he's facing. The event could be pre-designed on some other map and called through a common event or something. Does anything like this exist?

    Thanks

    Dym
  2. Yanfly has a clone event script... you can set-up all possible item events on a sample map, then clone it when needed
  3. Engr. Adiktuzmiko said:
    Yanfly has a clone event script... you can set-up all possible item events on a sample map, then clone it when needed
    Are you referring to the spawn event script? If so, I am talking about a script that can spawn an event directly on the tile in front of the player - not preset with region IDs, like Yanfly's spawn event script does.
  4. Actually, this can easily be done with switches. You create a blank event with a second page that is activated when a certain switch gets turned ON. Then, within whatever event you want, when the event ends, you set the switch for the blank event to turn ON.

    That activates the second page which makes it do...whatever it is that you wanted it to do. That way, you "create" events. Or to put it on more technical terms, you "wake up" a sleeping event, not create one.

    And further more, you can have 4 of the same events surrounding the character. Then, set it up so that only the event in the way that the player is facing will turn ON.
  5. You can simply calculate the position where the event should spawn... I've used that script and I can spawn them dynamically anywhere in the map...
  6. SharicX said:
    Actually, this can easily be done with switches. You create a blank event with a second page that is activated when a certain switch gets turned ON. Then, within whatever event you want, when the event ends, you set the switch for the blank event to turn ON.

    That activates the second page which makes it do...whatever it is that you wanted it to do. That way, you "create" events. Or to put it on more technical terms, you "wake up" a sleeping event, not create one.

    And further more, you can have 4 of the same events surrounding the character. Then, set it up so that only the event in the way that the player is facing will turn ON.
    Wouldn't that require me to fill every tile of my game with these "sleeper" events? I want to make it so no matter where the player is, when he uses item x, an event is created on the tile in front of him.

    Specifically, when the player uses an item, a portal opens up in front of him and when he walks into it, he teleports.

    Engr. Adiktuzmiko said:
    You can simply calculate the position where the event should spawn... I've used that script and I can spawn them dynamically.
    Alright - I will try asap. Thanks.

    Sorry, didnt mean to double post - thought they auto merged.
  7. Dymdez said:
    Wouldn't that require me to fill every tile of my game with these "sleeper" events? I want to make it so no matter where the player is, when he uses item x, an event is created on the tile in front of him.

    Specifically, when the player uses an item, a portal opens up in front of him and when he walks into it, he teleports.
    Ah, I understand now. I thought that it would be in a single event, happening only once, not every time he uses the item. Sorry about that.

    It sounds like some sort of transportation-teleportation system. The closest thing it reminds me of is the Ocarina of Time. :D
  8. This is from the spawn events page, this is the very first set of script calls for spawning events...

    spawn_event_location(x, y, event_id)spawn_event_location(x, y, event_id,map_id)It takes x,y position of where to spawn the event...You'd need to calculate x,y based on direction though. :)
  9. Engr. Adiktuzmiko said:
    This is from the spawn events page, this is the very first set of script calls for spawning events...

    spawn_event_location(x, y, event_id)spawn_event_location(x, y, event_id,map_id)It takes x,y position of where to spawn the event...You'd need to calculate x,y based on direction though. :)
    Right, thank you, but even if I could calculate based on direction, how do I get the event to spawn directly next to the player? These script calls are for specific coordinates, and since the player can presumably summon the portal on any point of the tile grid, we cannot know any specific coordinates to call.
  10. I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.

    You can use the MultiQuote button to quote multiple posts in a single response.  They don't auto-merge.

    Tsukihime wrote a script that would allow you to spawn items on the map (take them from your inventory and add them to the map so you can pick them up again later).  You didn't really explain what you intend to do, and whether the items you "use" are what appears on the map or something else, so I'm only throwing it out there as a possibility.
  11. Dymdez said:
    Right, thank you, but even if I could calculate based on direction, how do I get the event to spawn directly next to the player? These script calls are for specific coordinates, and since the player can presumably summon the portal on any point of the tile grid, we cannot know any specific coordinates to call.
    As I told you, calculate... If it's facing up for example, X = X of player, Y = Y of player - 1
  12. You can use these methods:

    x = $game_map.round_x_with_direction($game_player.x, $game_player.direction)y = $game_map.round_y_with_direction($game_player.y, $game_player.direction)
    then make your event spawn at the point designated by x and y.  However, that could be ANYWHERE on the map - on a tree, on the wall of a house, on a cliff or hill, in the water.  There is no check that the tile in front of the player is a VALID tile for a particular event to spawn on.  You would have to do that check yourself, using whatever rules you need for the purpose you have in mind.
  13. @shaz

    I see something interesting here.

    I just knew that you don't have to define the X and Y in numbers!

    So basically, all I have to do is making a script call:

    x = $game_map.round_x_with_direction($game_player.x, $game_player.direction)
    y = $game_map.round_y_with_direction($game_player.y, $game_player.direction)

    spawn_event_location(x, y, 12)
    and then the event 12 will spawn anywhere the player is

    right?
  14. It will spawn on the tile in front of the player, not where the player is.


    If you put that into the script call and it gives an error, it'll be because you're using an earlier version of the engine and the lines are too long, and have auto-wrapped in a bad place. If that happens, make the lines break after the ( and before $game_player and it should be right.
  15. Shaz said:
    It will spawn on the tile in front of the player, not where the player is.

    If you put that into the script call and it gives an error, it'll be because you're using an earlier version of the engine and the lines are too long, and have auto-wrapped in a bad place. If that happens, make the lines break after the ( and before $game_player and it should be right.
    I tried it, then tried it with the adjusted line breaks - still receive this error. Tried in new project as well.

    21jondh.png
  16. Then maybe get the new version of Ace.. :)
  17. Engr. Adiktuzmiko said:
    Then maybe get the new version of Ace.. :)
    So, just to be clear, the only solution to this problem is to get the new version of ace?
  18. Not sure, but getting it won't really do any harm...
  19. This should fit in the small scriptcall box:

    Code:
    x = $game_player.xy = $game_player.yd = $game_player.directionx = $game_map.round_x_with_direction(x, d)y = $game_map.round_y_with_direction(y, d)spawn_event_location(x, y, 12)
  20. Evgenij said:
    This should fit in the small scriptcall box:

    x = $game_player.xy = $game_player.yd = $game_player.directionx = $game_map.round_x_with_direction(x, d)y = $game_map.round_y_with_direction(y, d)spawn_event_location(x, y, 12)
    Haha, all this did was transfer me to the map I have the event on! At least no error, moving in right direction? It isn't transferring me, but rather its making other events disappear? Edit: Yes, when I use the script, it makes one of the events on my map disappear, then spawns the event correctly. Any idea as to why a random event would disappear right before the spawn occurs?

    Any ideas? This is what I have

    x = $game_player.x

    y = $game_player.y

    d = $game_player.direction

    x = $game_map.round_x_with_direction(x, d)

    y = $game_map.round_y_with_direction(y, d)

    spawn_event_location(x, y, 1, 3)