Refresh map via script call - retain event positions.

Revival

Veteran
Veteran
Joined
May 16, 2012
Messages
71
Reaction score
25
First Language
English
Primarily Uses
                 I forgot to add to the title but this is for VX.

Hey everybody recently my ABS has been causing me a slight issue, but I think there's a way around it.

You see, my enemies are evented, and I'm trying to do a thing where the enemy walks on a custom route, and if he sees you he uses a skill which raises the alarms SFX and all that jazz at this point he's supposed to start a random move route and load a new "enemy" which is basically just a new skillset. 

Long story short, the event page obviously flips - the npc walks randomly, however the new skillset does not load.

I've found using this script command will in fact make the skillset load:

$game_map.setup($game_map.map_id)$game_player.moveto($game_player.x,$game_player.y)$scene = Scene_Map.newThe problem then arises that the sprite moves back to it's initial place on the map, which looks stupid as heck.  I want to retain it's position with something like:
$game_map.events[evID].moveto(x, y)

Where x and y would be determined by variables :s I only have a couple maps where I need to do this, and never more than 3 events per map so I need to be able to target them by ID as well - I got that little bit above from an XP forum so I dunno if it even works.  Regardless I need it to check for variables rather than put it in set coordinates.
 
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I think you are going about it the wrong way. Find out WHY the new skillset does not load when you switch event pages, and fix THAT problem. Reloading the whole map is overkill and, as you've found, introduces other problems. Why spend time solving problems caused by a workaround instead of solving the REAL problem itself?


What IS a "new skillset"? How have you implemented it? How does he use a skill? Events are not enemies. Events don't have skills. It's all about your ABS and how you're handling the transition. You might just need a simple script call to refresh the event rather than the entire map.
 
Last edited by a moderator:

Revival

Veteran
Veteran
Joined
May 16, 2012
Messages
71
Reaction score
25
First Language
English
Primarily Uses
I think you are going about it the wrong way. Find out WHY the new skillset does not load when you switch event pages, and fix THAT problem. Reloading the whole map is overkill and, as you've found, introduces other problems. Why spend time solving problems caused by a workaround instead of solving the REAL problem itself?


What IS a "new skillset"? How have you implemented it? How does he use a skill? Events are not enemies. Events don't have skills. It's all about your ABS and how you're handling the transition. You might just need a simple script call to refresh the event rather than the entire map.
Ah but see - if I try to treat the ailment directly it would bring about WAY more work and probably exceedingly so beyond my capabilities.
I use Vlad's Requiem ABS - or to say the least, a heavily modified version of it.


Enemies are determined by a Comment "Enemy 46" <- this would give the stats and skillset of database enemy ID 46 - this is all done by the script beyond that simple comment.  If the page flips to a page with a Comment like "Enemy 56" it should replace 46 with 56. 


The only thing is, all this loading of the stuff is in the script itself, and way beyond my abilities to touch or even diagnose the source.


The switching of enemies usually occurs after a death, which in this case is not possible.  It's curious to note that normally if say - the first enemy is a cloak with 1hp - hitting it will make it die


You add to the comment box "Die Self Switch A"


This will make Page A dominant upon death -obviously - and therefore the comment page will in fact switch successfully to the uncloaked enemy.


So what I'm saying is, either the first enemy (the docile version) need to die, or I need a way to refresh this all :/  And the problem is well, he isn't supposed to die, and either way I have no way to make the enemy "kill itself" to trigger the change - another thing about the abs, pretty sure enemy AI doesn't allow it to hurt itself, least they never use the skills that do.


But I think the problem in my case is that the first enemy is still alive when I try to replace it.- perhaps if their is a way to disregard the previous page's comment information?


It's a unique issue, that's for sure.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Then please provide a link to the script (if you've heavily modified it, load it up to dropbox or pastebin and give us a link there), along with screenshots of your event with all the things we need to see to try and follow what it's doing.


Or create a very small, basic project that uses that script and has one enemy, to show this happening, and put it online somewhere so we can download.


I stand by my "refreshing the whole map is just a bad idea" comment :)


Did you try doing $game_map.events[id].refresh? That should clear the comments from the previous page and load the ones for the new page.
 
Last edited by a moderator:

Revival

Veteran
Veteran
Joined
May 16, 2012
Messages
71
Reaction score
25
First Language
English
Primarily Uses
Then please provide a link to the script (if you've heavily modified it, load it up to dropbox or pastebin and give us a link there), along with screenshots of your event with all the things we need to see to try and follow what it's doing.

Or create a very small, basic project that uses that script and has one enemy, to show this happening, and put it online somewhere so we can download.

I stand by my "refreshing the whole map is just a bad idea" comment :)

Did you try doing $game_map.events[id].refresh? That should clear the comments from the previous page and load the ones for the new page.

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

And please don't quote yourself just for the purpose of adding a new comment. Just edit your post instead.
ULTIMATE EDIT OF IRONY.  I don't know if it was the blessing of the gods smiling upon me, or if you knew or remembered... but Shaz, you made my solution.  It was an Ace script but I hazarded my chances and found out it works for VX.  

http://forums.rpgmakerweb.com/index.php?/topic/1853-remember-event-position/

Ultimately it took

$game_map.events[14].save_pos()$game_map.setup($game_map.map_id)

$game_player.moveto($game_player.x,

$game_player.y)

$scene = Scene_Map.new

But dayum, it's functional and it's amazing. 

I get my slight frame skip from the scene_map.new but that's a small price to pay for having my game functional again.
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top