Zeriab's Caterpillar
Version: 1.1c
Author: Zeriab [ported to VX by modern algebra]
Date: February 21, 2010
Version History
- <Version 1.1c (RMVX)> 02.21.2010 - Fixed an error that would keep the caterpillar actors visible (and immobile) even when the caterpillar switch was turned off. Also applied the passability features to 8D movement.
- <Version 1.1b (RMVX)> 01.15.2010 - Fixed a little error with dashing - no more jarring movement. Also, the demo apparently wasn't set up correctly before - whoops! It is now.
- <Version 1.1 (RMVX)> 12.08.2009 - Added compatibility with Composite Characters, as well as adding a feature to generate the graphic of actor caterpillar events automatically
- <Version 1.0 (RMVX)> 10.13.2009 - RMVX conversion of original script. Added features:
- Non-Party Followers
- Pass Through Solid Followers
- <Version 1.0 (RMXP)> 08.16.2008 - Original Release for RMXP
Description
Quote from: ZeriabThis script creates a caterpillar of the party members by using events present on the map. (You need to actually make the events in the editor)
When the caterpillar is deactivated they act just like any other event. Most event commands still works on the events when the caterpillar is activated, but the results be strange.
I also added the features of allowing events who are not in the party to follow the player as well (which I am pretty sure is unique to this caterpillar script), and also an ability to set the events to be solid and letting only the player pass through them automatically and to all other events they react as if they are solid, so other events can't just walk through your party members (unless you set them to Through)
For the most part, the basic functioning of the follower events noted by Zeriab remains the same.
Features
- Party members will follow behind the player in a line, like Lufia and countless other RPGs
- Event based, Event-based caterpillar, meaning that follower events can be interacted with as events
- Can set regular events to follow even if they are not in the party.
- Can set them to solid, so that other events are not able to walk through follower events while still allowing the player to pass through them.
Screenshots
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg26.imageshack.us%2Fimg26%2F8269%2Fzeriabcaterpillar.png&hash=abb81419784986f1bdb41085f1b0cb415a568886)
Instructions
Quote from: Zeriab
Put \cat_actor[3] in the name of an event and it will be considered the event for the actor with id 3. The name could for example be "Cyrus\cat_actor[3]"
The switch number specified with CATERPILLAR_ACTIVE_SWITCH (default is 23) is used to determine whether the events should be positioned in the caterpillar or not. When the switch is off they are just like any other event.
The REMOVE_VISIBLE_ACTORS (default is true) is used to determine whether actor event not in the party should be erased or not. If it is set to an integer rather than true or false the switch with the corresponding id is used. For example REMOVE_VISIBLE_ACTORS = 21 will allow you to determine whether the events should be erased or not depending whether switch 21 is OFF or ON.
The MAX_ACTORS (default is 4) is used to determine how many player moves should be remembered. Only change this if you can have a party with more than 4 followers.
Features added for RMVX version by modern algebra
~
Non-Party Followers This addon allows you to set events to follow the player in the caterpillar without having to be an actor in the party. It is set by page, rather than name, as that allows a number of conditions to be placed on being able to follow. In order to set an event to be a follower, you MUST place a comment as the FIRST line of a page and in the first line of the comment there must be the code: \cat_event
~
Pass Through Solid Followers This addon to Zeriab's Caterpillar Script allows the player to walk through a Caterpillar event that is not set to through - this will make it so that the events are treated as non-through in all cases except the player walking through them. To enable this, you must set PASS_SOLID_FOLLOWERS below to true. You can also set the MUST_FACE_FIRST constant, which forces the player to face the event before being allowed to pass through the follower event. It's useful if you want to allow the player the opportunity to interact with the 1st follower event for whatever reason.
~
Auto Change GraphicThis is a simple feature. If AUTO_CHANGE_GRAPHIC at line 73 is true, then the graphic of the caterpillar actors will automatically change to the current graphic of the actor it represents, regardless of what you have the graphic in the event set as. If you use silver wind's addon, then it MUST be set to true. This feature is also recommended if you use Composite Characters, in order to have them show up with all their added equipment.
Script
See the Demo to retrieve the script
Addons
[spoiler=silver wind's Auto Generate Party]
This is an addon originally written by silver wind for the RMXP version and ported to RMVX by me. Basically, it automatically generates events for all the actors in your party, so you don't need to put them in every map. If you do have an actor event in a map, then it will take priority. Note that if you do this, the events will not be interactable, and you won't be able to custom set things, like Stepping Animation or any of that special stuff, thus actors that are autogenerated will be less functional than events that are manually set up. Also, please note that for this script to work, you must set the constant AUTO_CHANGE_GRAPHIC to true in the main script. In any case, put the code underneath the Caterpillar script, but still above Main:
#==============================================================================
# Silver Wind's AutoParty
# Addon to Zeriab's Caterpillar Script
# Version: 1.1
# Author: silver wind (converted to RMVX by modern algebra)
# Date: December 6, 2009
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Description:
# * Now you don't have to create events for each party member, in every map.
# This script will create them automatically. You may create events for some
# of the actors, and let this system add the missing events.
# * If you ever need to know the id of the event used for a certain actor,
# use:
# event_id = $game_map.cat_event_id(actor_id)
#==============================================================================
#==============================================================================
# ** Game_Map
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased method - setup
# new methods - make_cat_events; new_cat_event; cat_event_id
#==============================================================================
class Game_Map
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Setup
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias silwer_wind_cat_game_map_setup setup
def setup(*args)
silwer_wind_cat_game_map_setup(*args)
make_cat_events
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Make Caterpillar Events
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def make_cat_events
# if the caterpillar event doesn't exist, create it
all_actors = []
for i in 1...$data_actors.size
all_actors.push ($game_actors[i].id)
end
actor_events = []
for event in @events.values
actor_events.push (event.caterpillar_actor)if event.caterpillar_actor != nil
end
for actor_id in all_actors
# add a new event for this actor
new_cat_event(actor_id) if !actor_events.include? (actor_id)
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Create new Caterpillar Event
# actor_id : the ID of the actor to create event for
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def new_cat_event(actor_id)
# create unique ID for the event
ids = @map.events.keys
event_id = (ids.size==0) ? 1 : ((ids.max) +1)
# Set the event on the upper-left corner
new_event = RPG::Event.new(0,0)
new_event.name = "EV#{event_id} \\cat_actor[#{actor_id}]"
new_event.pages[0].priority_type = 1
new_event.pages[0].graphic.pattern = 1
l = @map.events.keys.length
@map.events.keys[l]=event_id
@map.events[event_id]=new_event
game_event = Game_Event.new(@map_id, new_event)
@events[event_id] = game_event
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Retrieve Caterpillar Event ID
# actor_id : the ID of the actor you want event ID for
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def cat_event_id(actor_id)
for i in @events.keys
return i if @events[i].caterpillar_actor == actor_id
end
return false
end
end
class Game_Caterpillar
AUTO_CHANGE_GRAPHIC = true # DO NOT CHANGE
endCredit:
- silver wind
- modern algebra
[/spoiler]
Credit
Thanks
- Zero2008, for bug reports
Support
Post in this topic at rmrk.net for support.
Demo
Download Demo (http://rmrk.net/index.php?action=dlattach;topic=35167.0;attach=19528)Note that only the main script is included in the demo. If you want silver wind's addon, get it above.
Author's Notes
Credit for this script is attributed solely to Zeriab because I took a very hands-off approach to converting this script. I only removed or changed what was necessary to allow it to work in RMVX. This ended up not being fully the case as I did add a few features to the basic script (I imagine Zeriab would take offense if I attributed such sloppy code to him), but as these were minor applications of the code already written by Zeriab I should not take credit for those modifications. I do, however, accept blame for anything that doesn't work and will try my best to resolve any issues you might have with the script.
Updated this script to 1.1.
It should now work with Visual Equipment, and it has an added feature that actor caterpillar events can have their graphics autogenerated.
Not being good at life, I had forgotten to include functionality for the followers to dash when the player was dashing. I just added it now. In addition, the demo wasn't properly set up before, which is why there were people hanging out in the corners of the maps. That wasn't an error with the script, it was just me rushing the demo and not retesting after I took silver wind's addon out for distribution.
So, the demo is now fixed too.
Hey Modern Nice Job For Making This But I Got 1 Question....
Where Is The Link To The Demo?
-Thanks-
It's at the very end of the post, right above my signature and right below the Author's Notes section. I'll edit to include a hyperlink I suppose.
Thanks Modern:D
Sorry To Bug You Again :D
But This Keeps Buggin Me...
I'm Trying To Make An Event Folow Me But It Doesnt Work???
Can You Help Me Out
-Thanks-
Well, umm - the ghost in the demo is an event. Make sure that it's set up like he is. It has to be the first comment on the page.
Oke So i Did This...
I Copied The Ghost From The Demo...
Then Pasted In My Own Game And Changed Event Graphic.
But Still Not Working Am I Missing Somthing?
Well, A) the switch that activates the caterpillar has to be ON - have you done that?
B) the event in the demo has to be on the second page before he will start following.
Does everything work in the demo?
Yes Every Thing Is Fine In The Demo :D
So I Make An Switch And Call It Catipillar And Turn It On?
Never Mind Fixed It :D
-Thanks-
I must say I do like this caterpillar script. There's just one thing I'd like to see done, if possible.
I use Yanfly's Variable Dash Speed (http://www.pockethouse.com/rpgvx/scripts/variabledash.txt) to set dashing to a more appropriate speed for my game. The problem arises with following characters. If the dash speed is set to anything but the default of 2x the trailing members will have jagged movement.
Example: I set the dash speed to be 1.5x (150 in the script's setup), and when the player dashes, the caterpillar members still try to go the normal 2x speed (so it seems) and they "run into" the player.
Any way to make the caterpillar recognize the new dash speed?
-Heart of Shadow-
Hmm, try going to around line 59 in Yanfly's script and changing:
class Game_Player < Game_Character
to:
class Game_Character
That change makes it a little more likely to be incompatible with other scripts that affect movement, so you should put Yanfly's script above all your other custom scripts but still below the default scripts.
Awesome.
Runs smoothly now. (hah.. pun) Thanks for the help!
-Heart of Shadow-
Updated to version 1.1c. Before, the caterpillar actors wouldn't disappear when the caterpillar switch was turned off. That is now fixed. Also, the PASS_SOLID_ACTORS feature now works for 8D movement, in case anyone is using a script for that or force 8D movement through move events.
I think there is a problem with Silverwind's Auto genereate addon cuz when you use it all together and stop walking on a map where the events are not present the following party members are shown with a walking sprite instead of a standing one...
You're right. Thanks for noticing that. The tall grass in my demo made it unnoticable for me :)
Anyway, to fix it, go to line 64 of the addon to see this:
new_event.pages[0].priority_type = 1
Put a new line directly under it with this:
new_event.pages[0].graphic.pattern = 1
Thank you for all your help and patience in working out the issues with me, Zero2008.
You're welcome!
And thank you for coming up with a solution to my diagonal movement dilemma!
Sry for double posting...
Uhh MA i have a question. Could it be possible to set the Silverwind add on to make the caterpillar events "Bellow hero"?
I know it's supposed to let you walk through, but when I put the scripts in the game, it only lets me walk through the caterpillar where the original caterpillar event is located if it's set to bellow hero.
Also in the map where the original caterpillar event is located when I stop walking the following member stays in a walking position again...
I think it might be one of the other scripts i am using...
Edit:
I figured our which script is messing with the Diagonal movement ones.
It appears that the add on or caterpillar script is not compatible with KGC's TilesetExtension script.
I hope this helps...
If you need a list of the ones I'm using then just say so and I'll have ready in no time!
thanks again!
No, I don't think the problem you mention is an incompatibility - it's intentional if it's occuring as a result of what I think you're doing. The event's stationary pose will be the one you set it to in its event, as with any other event. So, if you're setting the graphic to a moving pose (or leaving it without a graphic), then when it's stationary it will return to that pose. I prefer to leave that much control open to the users of the script, since they could be using scripts that alter the way sprites are interpreted that may not have the middle pose be the one they want to use for stationary events, for instance.
So, to fix it, all you have to do is set it to the stationary pose of the sprite, or if you are using AUTO_CHANGE_GRAPHIC, to the stationary pose of any sprite.
However, if you want it to do it automatically, pasting in something like the following might work:
class Game_Event
attr_writer :original_pattern
end
Then go into the script around line 228 and see:
rescue
event.set_graphic ($game_actors[actor.id].character_name, $game_actors[actor.id].character_index)
end
and put this line right below that end command:
event.original_pattern = 1
Awesome!
But does this fix the walking through problem too?
Also where am I suppose to paste the first edit piece you gave me?
I was just wondering if there was a way to use the character zoom script ( http://rmrk.net/index.php/topic,34543.0.html ) with this script. Seeing as that script is around 8 lines and yours is quite a bit more, i was hoping maybe you would have a possible idea where to insert the call line in yours.
I'm using Modern algebra's reserve party script and when I change the party order,it doesn't reflect in the caterpillar order.any solution?
P.S:Can I use this script for sharewares/commercial projects?
You'd have to PM Zeriab to see if you can use it in a commercial project - that determination I leave entirely to him. As for changing the party order, try to put this code in its own slot below the Reserve Party in the Script Editor:
#==============================================================================
# ** Game_Party
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased method - ma_switch_actor_order
#==============================================================================
class Game_Party
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Switch Party Order
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if self.method_defined? (:ma_switch_actor_order)
alias mlgb_zcat_irp_swtcpyordr_7uh1 ma_switch_actor_order
def ma_switch_actor_order (*args)
mlgb_zcat_irp_swtcpyordr_7uh1 (*args)
$game_system.caterpillar.refresh
end
end
end
@b00radley - I may look into it in the future, but not right now - it's a matter of applying the same zoom to events; probably not hard
@Zero2008 - sorry I must have missed that the first time. To do it, go to the same place where you put:
new_event.pages[0].graphic.pattern = 1
and place underneath it:
new_event.pages[0].priority_type = 0
Wow that was really fast!works absolutely fine :D
Many thanks!
Um... yeah I'm a little lost.
-I was asking where I'm supposed to paste this:
class Game_Event
attr_writer :original_pattern
end
-Also, I don't think you asked me to paste this anywhere yet..:
new_event.pages[0].graphic.pattern = 1
-You did however ask me to paste this:
event.original_pattern = 1
-Under this:
rescue
event.set_graphic ($game_actors[actor.id].character_name, $game_actors[actor.id].character_index)
end
Lol So where does everything go again, and which script exactly cuz one could get paste it in the wrong place... :P
1.
class Game_Event
attr_writer :original_pattern
end
You can paste it in its own slot if you want, or at the end of the silver wind addon, or anywhere really, except inside another class. Just paste it into its own slot is the easiest thing to do.
2.new_event.pages[0].graphic.pattern = 1I did indeed tell you where to paste that line:
Quote from: Modern Algebra on February 23, 2010, 02:55:16 PM
Anyway, to fix it, go to line 64 of the addon to see this:
new_event.pages[0].priority_type = 1
Put a new line directly under it with this:
new_event.pages[0].graphic.pattern = 1
3.new_event.pages[0].priority_type = 0is to go directly underneath
new_event.pages[0].graphic.pattern = 14. event.original_pattern = 1You've pasted that in the correct place.
"I can see clearly now the rain is gone!"
LOL Thanks again man you rock!
Edit:
Okay now the sprite faces in the correct position, but it still won't let me walk through it in maps where it's event is not located. And I made sure to make the original sprite set to under.
Is there something we can do?
Oh also, I just noticed something...
In the game there are butterflies that when touched fly over the head of the main character and replenishes the PP (Psychic points).
Will the script make so the butterfly event not fly over the following characters or will it allow event that are to to above go over them?
One last thing.
Earlier before I asked for the fixes, I made the main character with a following member walk on a event that would change both the main characters sprite and the following members sprite so that it looks like they are climbing.
But while the sprites were climbing the following member kept jumping under the leader and stayed back for a bit and then jumped under again, and didn't stop until the sprites were switched back to normal...
Just thought I'd mention that...
And that's with the priority_type set to 0? I didn't think it made sense to depend on the priority of the hero - I will take another look at it sometime in the next few days and see if I can resolve your issue.
Your the man Modern!
I'll make sure to put a HUGE thankyou spot for you in the game credits!
Ok I don't know where to put it(whether in reserve party topic or here).I'm using Modern algebra's reserve party and when I take out one member from the party so that there are only three in the active party,then the caterpillar shows four members where the first one is the duplicate of the second member.But if I check my active party from menu or battle screen it shows three members.how to remove the duplicate member?here's a screenshot to explain it better.
before (with 4 active members)-(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg704.imageshack.us%2Fimg704%2F3146%2F82740890.jpg&hash=77c3d69e846c36919453e5e540490345a776a71a)
after (with 3 active members)- (https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg341.imageshack.us%2Fimg341%2F2837%2F88734191.jpg&hash=647a5f5e91d71777a88d00261d3cddd873a5bb24)
also how do I disable the party leader from getting subtracted from the active party?that is how do I ensure he cannot be moved from active party while others can be removed or changed?
Um, try adding $game_player.refresh right above $game_system.caterpillar.update in that code I gave you. If that doesn't work I will look into it.
There isn't any $game_system.caterpillar.update in your bit of code fix.there is $game_system.caterpillar.refresh only.and if you are talking of zeriab's script,I added $game_player.refresh before $game_system.caterpillar.refresh in it but it did not work.
Alright, can you possibly reproduce the conditions for error in a new project and send that to me? (or else just send me your project if you don't mind sharing it at this stage).
Well I'm working out all the scripts before actually starting the project.so there isn't any actual game progress.I don't mind sharing it with you.I've PM ed the project download link(zipped).The caterpillar can be seen in map MAP001.You can see the errors there.
Hey Modern Algebra I figured out what was making the following events jump under the Leader when switching sprites. I had a Common event that made the followers switch to a sprite while walking and then switch back when stopping. After I altered that Event to only switch and not switch again The jumping stopped!
So you can cross that right off your list of glitches buddy!
Hi,any updates on my queries? :)
Hey Modern I found something interesting that you might want to look at.
When I places the KGC Script under the 3 scripts that give us the diagonal movement it gives me this error everytime I start up the project.
Script 'Zeriab Caterpillar' line 449: ArgumentError occurred.
wrong number of arguments(3 for 2)
Maybe this could help you identify the problem!
Hallo.
I cannot download the demo
An Error Has Occurred!
You are not allowed to access this section
it says.
Would you kindy post the script as a txt, or fix downloading error?
Thanx.
It was a link to the wrong attachment. It's fixed now, and you can always just click on the attachment at the bottom of the first post.
Hey MA!
Anything new about those glitches?
Sorry, I haven't had time to take a look at anything RM for quite some time. I'll try to get around to it when I can.
So... um... Any progress with the script buddy?
Okay... I know its kind of necro posting but I have a question.
Will the script still work if instead of having a event on the map for the caterpillar you just make the events into Common Events and have them activated all the time with the appropriate name of the character?
I have yet to try it, but I would appreciate someones professional opinion.
The point of having the events on the map is so that there is a graphical representation of the other party members. I don't think that a common event can do that...
Oh well just asking...
Thanks for the help though!
Yeah, no you can't just use a common event. What you can do, and what I did when I used this script, is set all the interactions up in a common event and simply have all the caterpillar events that you use for that character in every map call that common event.
Hey, I've been trying to get this script and the autoparty add on to work, and I've got them running pretty smoothly, except when you load a saved game the followers that were generated prior to saving will just stand in the place they were in during the save and not move. This goes away as soon as you change maps but it looks really awkward. I was wondering if there was any way around it? Whenever I change something enough for the script to reinitialize or whatever the saves won't have this issue for at least one load, I think if there was a way to flip the activating switch off and on real quick every time you load a game it would work, I just have no idea how one would go about doing that.
Any help in this matter would be greatly appreciated.
I'm using KCG's Large Party script as well as the Tankentai Side View Battle System in addition to this script. It worked fine. But then I added a total of 6 characters to my party, changed the party number in all of my scripts to that it would work with 6 people, and then re-arranged the positions the characters will be in during battles. Then it crashed. I get the error:
Script: "Zeriab Caterpillar" line164:NoMethodError occurred.
undefined method 'values' for nil:NilClass
Any help here?
Well, it's likely an incompatibility. I can't say much more than that. Try starting a new project, adding your scripts in one by one and note the last script you added when it crashes. Then share that script with me and I'll take a look.
@neuromonster - sorry; I never noticed that error before since I had always modified and so it never showed up in my testing. It is easy to fix and I will release a new version with it fixed very soon; I'd like to explore whether DCZ's problem is a general error in the script first.
It can't be incompatibility. It worked perfectly, and then I changed a number in the SBS to make my battler stand closer to the middle of the screen. I haven't added any scripts since then. If it is compatibility, then it is probably with the KCG's Large Party script. It was the most recent on I added.
Edit: I put it into a game with only the Large party script and the caterpillar one. It's incompatible with that one. I've got it so that I can only have 4 people in my party at a time, but can hold up to 6 in the reserve, if that info is helpful or not. Hopefully I'll have my database done shortly so that I can start the actual game so I can put it up on here.
Well, wha the error is telling me is that $game_map.events is not defined the first time the caterpillar is refreshed. Since that can't happen if isolated to this script, I think it's likely to be a script incompatibility. Anyway, test it out and recreate the error in a new project, then upload it and send it to me.
Sorry. I hope I am not breaking the rules by bumping and old thread. I am having issues with this script. When I press the restart button (f12 or something) and try to load up the game again, I get an "stacking error" on line 459. I have no idea what is wrong with it ...
Thanks ahead of time!
Add a new section at the very top of the script editor and copy & paste the following snippet into that section:
unless $@.nil?
game_exe = 'Game' # Name of the .exe file
exec = game_exe + ' debug' if $DEBUG # XP
exec = game_exe + ' test' if $TEST # VX
Thread.new{system(exec)}
exit
end
*hugs*
Thanks for helping me out. :D
I tried to use it - but it did a weird thing. The test window was brought to the back of all my windows, but it works. :D Though I don't know what the problem is.
When you test play the editor waits until the game instance ends.
My scripts opens a new instance and closes the current one.
When you play normally it's less evident ^_^
Oh alright. :D Sorry, I have one more question - using the automated caterpillar, is there anyway that the person could face the same way you are facing when entering a room?
yeah, I've been facing the same problem
Sorry for the Necropost.
This script is awesome! It has a few bugs, but hey, people are human!
Has anyone else noticed that when you get On or Off a Vehicle, the Characters just start following the Vehicle (Boat, Ship, Airship)?
Quote from: Heretic86 on May 21, 2011, 11:34:46 AM
Sorry for the Necropost.
Excused in scripts and recourses sections, don't worry as long as you have something worth posting to post.
Quote from: Heretic86 on May 21, 2011, 11:34:46 AM
This script is awesome! It has a few bugs, but hey, people are human!
People are human? YOU CHANGED MY LIFE
Quote from: Heretic86 on May 21, 2011, 11:34:46 AM
Has anyone else noticed that when you get On or Off a Vehicle, the Characters just start following the Vehicle (Boat, Ship, Airship)?
Can you not just turn the switch off then?
Quote from: Pacman on May 21, 2011, 11:41:18 AM
...Can you not just turn the switch off then?
Not for every place that a player can land a vehicle in a world, and I'd like to stay away from more Parallel Processes if possible. It interferes with other events. Of course, its probably just the fact that I suck at life. Just a humble suggestion.
well...that script is great...but...there's a little BIG problem:
if I save the game and then I load it...the characters that was following:
1) dont follow me
2) are untouchable
that's a biiiiig prob....
what can we do to fix it?
the DEMO have this prob too!
Quote from: Vhank on June 13, 2011, 07:06:49 PM
well...that script is great...but...there's a little BIG problem:
if I save the game and then I load it...the characters that was following:
1) dont follow me
2) are untouchable
that's a biiiiig prob....
what can we do to fix it?
the DEMO have this prob too!
im also having this problem, but it can be solved by adding a dummy party member and removing it again when the game loads to refresh the caterpillar.
Also when i use Set move route in the player it often gets stuck in the caterpillar... Specially with the move backward command or any move type that causes it to move to the caterpillar.
When using the SilverWind addon, how do you set move routes/play animations to the generated events?
This little code by GubiD fixes the problem with the saves. Enjoy. :3
class Scene_Map < Scene_Base
alias upd_basic_scn_map_cat_fix_zeriab update_basic unless $@
def update_basic
upd_basic_scn_map_cat_fix_zeriab
if @last_map_refresh == nil
$game_system.caterpillar.refresh
@last_map_refresh = $game_map.map_id
elsif @last_map_refresh != $game_map.map_id and Graphics.framecount % 120 == 0
$game_system.caterpillar.refresh
@last_map_refresh = $game_map.map_id
end
end
end
First of all, great script. Thank you for maintaining it.
I'm having an issue where after the actors join my party they don't follow me, they just remain stationary after teleporting to the player's position. I have a feeling there is an incompatibility with ArcThunder's Pixel Movement script, but I can't find where.
Can you help me out?
Here is the pixel movement script:
#-------------------------------------------------------------------------------
# * Arcthunder Pixel Movement
#-------------------------------------------------------------------------------
# * By Khas Arcthunder (nilokruch@live.com)
# * Version: 1.0 US
# * Released on: 21/07/2011
#
#-------------------------------------------------------------------------------
# * Author's note
#-------------------------------------------------------------------------------
# Thank you for choosing Arcthunder scripts. If you find any bug, please let
# me know by reporting it at the official threads (threads created by me - Khas)
#
# You can find more scripts and updates (in portuguese or english) at:
# http://arcthunder.host.org/
#
# If you like my scripts and want to donate a little, anything you can give
# would be appreciated. Please visit http://arcthunder.host.org/ to donate.
#
#-------------------------------------------------------------------------------
# * Terms of use
#-------------------------------------------------------------------------------
# You must give credit to Khas if you are using any Arcthunder script;
# All Arcthunder Scripts are licensed under a Creative Commons license;
# All Arcthunder Scripts are for non-commercial projects, if you need
# them for a commercial game, please send a email to nilokruch@live.com
# All Arcthunder Scripts are for personal use, you may edit them and use in your
# own project, but you can't post any modified version without my permission.
#
#-------------------------------------------------------------------------------
# * Instructions
#-------------------------------------------------------------------------------
# 1. How to use
# Just place this script after materials. This script will change the movement
# of the player, the events and the vehicles of your game.
#
# 2. Physics system
# In order to make this script working correctly, there's a system called
# Khas Physics. This system will load all Pixel Movement maps at the start
# of the game and it will save the settings into a file called
# "Khas Physics.rgss2a". You must refresh the file if you make any modifications
# at the maps of your game.
#
# There's two ways of refreshing Physics:
# a. Delete the "Khas Physics.rgss2a"
# b. Set Force_Physics_Update = true
#
# When you finish your game and it's ready to send to other people, remember to
# delete "Khas Physics.rgss2a" before encrypting! The Physics System will
# automatically create a new file when the player plays at the first time.
#
# 3. Event Commands (put on comments of events on map)
# You may put special commands for some events. There are two special commands:
#
# a. [collision X]
# This command sets the collision constant of the event to X.
#
# b. [forcedefaultcmd]
# This command forces the event to move as the default RMVX movement.
#
# 4. Event Commands (script codes)
# You may call some new commands for the player or map events:
#
# character.centralize(x,y)
# This command centralizes the character at x,y.
#
# character.px
# This command returns the Pixel X coordinate.
#
# character.py
# This command returns the Pixel Y coordinate.
#
# character.pixel_passable?(px,py)
# This command checks the passability at px,py coordinates.
#
#-------------------------------------------------------------------------------
# * Incompatibilities
#-------------------------------------------------------------------------------
# The Arcthunder Pixel Movement is incompatible with:
# 1. RMVX Loop maps
# 2. Heavy modifications in Game_Character, Game_Player and Game_Event
# 3. Anti-lag scripts
# 4. Action Battle Systems (A compatible ABS is coming soon! Arcthunder ABS!)
#
#-------------------------------------------------------------------------------
# * Setup part
#-------------------------------------------------------------------------------
module Pixel_Core
# Pixel Movement maps (ID)
# Example:
# Maps = [1,3,4,5,6,7]
Maps = [1,2,3]
#-------------------------------------------------------------------------------
# * Physics update
#-------------------------------------------------------------------------------
# Force physics to update when testing?
# If you set this option to false you may delete the physics file manually
# to refresh the collision system. You only will need to refresh the file
# when you make a change in any map.
Force_Physics_Update = true
#-------------------------------------------------------------------------------
# * Auto-Multiply system
#-------------------------------------------------------------------------------
# Multiply event commands? (event_commands will be multiplied by Pixel constant)
# Please note that it isn't a very precise feature, it's better if you
# multiply the commands by yourself to get better results.
Multiply_Commands = false
# Commands that will be multiplied (ID, separated by commas)
Commands = [1,2,3,4,5,6,7,8,9,10,11,12,13]
#-------------------------------------------------------------------------------
# * Pixel settings (OTHER SETTINGS THAN THE DEFAULT MAY CRASH YOUR GAME!!!)
#-------------------------------------------------------------------------------
# Axis [x plus, y plus, width, height]
# Default: [0,0,0.75,0.75]
# True Pixel: [0.25,0.25,0.25,0.50]
Axis = [0.25,0.25,0.25,0.50]
# Bush axis [x plus, y plus, width, height]
Bush_Axis = [0.5,0.75,0.0,0.0]
# Counter axis [x plus, y plus, width, height]
Counter_Axis = [0.25,0.25,0.25,0.25]
# Pixel constant (32/Pixel must be an integer!) - Best setting: 4
Pixel = 4
# Tile divisor (256/Tile must be an integer!) - Best setting: 0.25
Tile = 0.25
# Default collision range (must be an integer!)
Collision = 3
# Trigger range (direction => [x,y])
Trigger_Range = {2=>[0,2],4=>[-2,0],6=>[2,0],8=>[0,-2]}
# Counter range
Counter_Range = {2=>[0,3],4=>[-3,0],6=>[3,0],8=>[0,-3]}
# Vehicle Range (gettin on or off vehicles)
Vehicle_Range = {2=>[0,3],4=>[-3,0],6=>[3,0],8=>[0,-3]}
end
#-------------------------------------------------------------------------------
# * End of setup part
#-------------------------------------------------------------------------------
class Game_Character
include Pixel_Core
attr_accessor :px
attr_accessor :py
attr_accessor :collision
alias apm_initialize initialize
alias apm_moveto moveto
alias apm_jump jump
alias apm_update_bush_depth update_bush_depth
alias apm_force_move_route force_move_route
alias default_mr move_right
alias default_ml move_left
alias default_mu move_up
alias default_md move_down
alias default_mur move_upper_right
alias default_mul move_upper_left
alias default_mlr move_lower_right
alias default_mll move_lower_left
def initialize
apm_initialize
if (Maps.include?($game_map.map_id) rescue false)
@x = @x.to_f
@y = @y.to_f
@pixel = true
else
@pixel = false
end
@px = (@x*Pixel).to_i
@py = (@y*Pixel).to_i
@collision = Collision
end
def moveto(x,y)
@pixel = Maps.include?($game_map.map_id)
apm_moveto(x,y)
if Maps.include?($game_map.map_id)
@x = @x.to_f
@y = @y.to_f
end
@px = (@x*Pixel).to_i
@py = (@y*Pixel).to_i
end
def update_bush_depth
if @pixel
if object? or @priority_type != 1 or @jump_count > 0
@bush_depth = 0
else
bush = $physics[$game_map.map_id][@px,@py,4] == 1
if bush and not moving?
@bush_depth = 8
elsif not bush
@bush_depth = 0
end
end
else
apm_update_bush_depth
end
end
def move_down(t=true)
@pixel ? pixel_md(t) : default_md(t)
end
def move_up(t=true)
@pixel ? pixel_mu(t) : default_mu(t)
end
def move_left(t=true)
@pixel ? pixel_ml(t) : default_ml(t)
end
def move_right(t=true)
@pixel ? pixel_mr(t) : default_mr(t)
end
def move_upper_right
@pixel ? pixel_mur : default_mur
end
def move_upper_left
@pixel ? pixel_mul : default_mul
end
def move_lower_right
@pixel ? pixel_mlr : default_mlr
end
def move_lower_left
@pixel ? pixel_mll : default_mll
end
def pixel_mr(turn_ok)
if pixel_passable?(@px+1,@py)
turn_right
@x += Tile
@px += 1
@real_x = (@x-Tile)*256
increase_steps
@move_failed = false
else
turn_right if turn_ok
check_touch(@px+1, @py)
@move_failed = true
end
end
def pixel_ml(turn_ok)
if pixel_passable?(@px-1,@py)
turn_left
@x -= Tile
@px -= 1
@real_x = (@x+Tile)*256
increase_steps
@move_failed = false
else
turn_left if turn_ok
check_touch(@px-1, @py)
@move_failed = true
end
end
def pixel_mu(turn_ok)
if pixel_passable?(@px,@py-1)
turn_up
@y -= Tile
@py -= 1
@real_y = (@y+Tile)*256
increase_steps
@move_failed = false
else
turn_up if turn_ok
check_touch(@px, @py-1)
@move_failed = true
end
end
def pixel_md(turn_ok)
if pixel_passable?(@px,@py+1)
turn_down
@y += Tile
@py += 1
@real_y = (@y-Tile)*256
increase_steps
@move_failed = false
else
turn_down if turn_ok
check_touch(@px, @py+1)
@move_failed = true
end
end
def pixel_mur
pixel_mu(true)
pixel_mr(true)
end
def pixel_mul
pixel_mu(true)
pixel_ml(true)
end
def pixel_mlr
pixel_md(true)
pixel_mr(true)
end
def pixel_mll
pixel_md(true)
pixel_ml(true)
end
def pixel_passable?(px,py)
return false unless $game_map.pixel_valid?(px,py)
return true if @through or debug_through?
return false if $physics[$game_map.map_id][px,py,0] == 0
return false if collision?(px,py)
return true
end
def collision?(px,py)
for event in $game_map.events.values
if (event.px - px).abs <= event.collision && (event.py - py).abs <= event.collision
next if event.through || event == self
return true if event.priority_type == 1
end
end
if @priority_type == 1 && !$game_player.in_airship?
return true if ($game_player.px - px).abs <= @collision && ($game_player.py - py).abs <= @collision
end
return false
end
def check_touch(px,py)
end
def force_move_route(mr)
apm_force_move_route(mr)
multiply_commands
end
def multiply_commands
return unless @pixel
return unless Multiply_Commands
return if @move_route.list.empty?
new_route = []
for cmd in @move_route.list
if Commands.include?(cmd.code)
Pixel.times do
new_route << cmd
end
else
new_route << cmd
end
end
@move_route.list = new_route
end
def centralize(fx=@x.to_i,fy=@y.to_i)
cx = @x - fx
cy = @y - fy
tx = (cx/Tile).to_i
ty = (cy/Tile).to_i
ty.times do; (cy > 0 ? pixel_mu(false) : pixel_md(false)); end
tx.times do; (cx > 0 ? pixel_ml(false) : pixel_mr(false)); end
end
def move_random
if @pixel
case rand(8)
when 0; pixel_mu(false)
when 1; pixel_md(false)
when 2; pixel_ml(false)
when 3; pixel_mr(false)
when 4; pixel_mur
when 5; pixel_mul
when 6; pixel_mlr
when 7; pixel_mll
end
else
case rand(4)
when 0; move_down(false)
when 1; move_left(false)
when 2; move_right(false)
when 3; move_up(false)
end
end
end
def move_type_toward_player
sx = @x - $game_player.x
sy = @y - $game_player.y
if sx.abs + sy.abs >= 20
move_random
else
if @pixel
move_toward_player
else
case rand(6)
when 0..3; move_toward_player
when 4; move_random
when 5; move_forward
end
end
end
end
def move_toward_player
sx = distance_x_from_player
sy = distance_y_from_player
if @pixel
unless sy == 0
sy > 0 ? pixel_mu(true) : pixel_md(true)
end
unless sx == 0
sx > 0 ? pixel_ml(true) : pixel_mr(true)
end
else
if sx != 0 or sy != 0
if sx.abs > sy.abs
sx > 0 ? move_left : move_right
if @move_failed and sy != 0
sy > 0 ? move_up : move_down
end
else
sy > 0 ? move_up : move_down
if @move_failed and sx != 0
sx > 0 ? move_left : move_right
end
end
end
end
end
def move_away_from_player
sx = distance_x_from_player
sy = distance_y_from_player
if @pixel
unless sy == 0
sy < 0 ? pixel_mu(true) : pixel_md(true)
end
unless sx == 0
sx < 0 ? pixel_ml(true) : pixel_mr(true)
end
else
if sx != 0 or sy != 0
if sx.abs > sy.abs
sx > 0 ? move_right : move_left
if @move_failed and sy != 0
sy > 0 ? move_down : move_up
end
else
sy > 0 ? move_down : move_up
if @move_failed and sx != 0
sx > 0 ? move_right : move_left
end
end
end
end
end
def jump(xp,yp)
apm_jump(xp,yp)
@px = @x*Pixel
@py = @y*Pixel
end
end
class Game_Player < Game_Character
alias apm_get_on_vehicle get_on_vehicle
alias apm_get_off_vehicle get_off_vehicle
def get_on_vehicle
@pixel ? pixel_gov : apm_get_on_vehicle
end
def get_off_vehicle
@pixel ? pixel_offv : apm_get_off_vehicle
end
def pixel_offv
if in_airship?
return unless pixel_airdocs?(@px,@py)
else
fx = @px+Vehicle_Range[@direction][0]
fy = @py+Vehicle_Range[@direction][1]
return unless pixel_walk?(fx,fy)
end
$game_map.vehicles[@vehicle_type].get_off
if in_airship?
@direction = 2
else
jump(Vehicle_Range[@direction][0]*Tile,Vehicle_Range[@direction][1]*Tile)
@transparent = false
end
@vehicle_getting_off = true
@move_speed = 4
@through = false
@walking_bgm.play
make_encounter_count
end
def pixel_gov
fx = @px+Trigger_Range[@direction][0]
fy = @py+Trigger_Range[@direction][1]
if ($game_map.boat.px - fx).abs <= $game_map.boat.collision && ($game_map.boat.py - fy).abs <= $game_map.boat.collision
return false if $physics[$game_map.map_id][@px+Vehicle_Range[@direction][0],@py+Vehicle_Range[@direction][1],1] == 0
jump(Vehicle_Range[@direction][0]*Tile,Vehicle_Range[@direction][1]*Tile)
@vehicle_getting_on = true
@vehicle_type = 0
@walking_bgm = RPG::BGM::last
$game_map.boat.get_on
return true
elsif ($game_map.ship.px - fx).abs <= $game_map.ship.collision && ($game_map.ship.py - fy).abs <= $game_map.ship.collision
return false if $physics[$game_map.map_id][@px+Vehicle_Range[@direction][0],@py+Vehicle_Range[@direction][1],2] == 0
jump(Vehicle_Range[@direction][0]*Tile,Vehicle_Range[@direction][1]*Tile)
@vehicle_getting_on = true
@vehicle_type = 1
@walking_bgm = RPG::BGM::last
$game_map.ship.get_on
return true
elsif ($game_map.airship.px - fx).abs <= $game_map.airship.collision && ($game_map.airship.py - fy).abs <= $game_map.airship.collision
$game_player.centralize($game_map.airship.x,$game_map.airship.y)
@vehicle_getting_on = true
@vehicle_type = 2
@through = true
@walking_bgm = RPG::BGM::last
$game_map.airship.get_on
return true
end
return false
end
def pixel_walk?(px,py)
lvt = @vehicle_type
@vehicle_type = -1
result = pixel_passable?(px,py)
@vehicle_type = lvt
return result
end
def pixel_airdocs?(px,py)
return false if $physics[$game_map.map_id][px,py,3] == 0
return false if collision?(px,py)
return true
end
def pixel_passable?(px,py)
return false unless $game_map.pixel_valid?(px,py)
return true if @through or debug_through?
case @vehicle_type
when 0
return false if $physics[$game_map.map_id][px,py,1] == 0
when 1
return false if $physics[$game_map.map_id][px,py,2] == 0
when 2
return true
else
return false if $physics[$game_map.map_id][px,py,0] == 0
end
return false if collision?(px,py)
return true
end
def move_by_input
return unless movable?
return if $game_map.interpreter.running?
if @pixel
case Input.dir8
when 1; pixel_mll
when 2; pixel_md(true)
when 3; pixel_mlr
when 4; pixel_ml(true)
when 6; pixel_mr(true)
when 7; pixel_mul
when 8; pixel_mu(true)
when 9; pixel_mur
end
else
case Input.dir4
when 2; move_down
when 4; move_left
when 6; move_right
when 8; move_up
end
end
end
def update_encounter
return if $TEST and Input.press?(Input::CTRL)
return if in_vehicle?
if @pixel
@encounter_count -= ($physics[$game_map.map_id][@px,@py,4] == 1 ? 2 : 1)
else
@encounter_count -= ($game_map.bush?(@x, @y) ? 2 : 1)
end
end
def collision?(px,py)
for event in $game_map.events.values
if (event.px - px).abs <= event.collision && (event.py - py).abs <= event.collision
next if event.through
return true if event.priority_type == 1
end
end
return false
end
def check_touch(px,py)
return false if $game_map.interpreter.running?
result = false
for event in $game_map.events.values
if (event.px - px).abs <= event.collision && (event.py - py).abs <= event.collision
if [1,2].include?(event.trigger) && event.priority_type == 1
event.start
result = true
end
end
end
return result
end
def pixel_th?(t)
return false if $game_map.interpreter.running?
result = false
for event in $game_map.events.values
if (event.px - @px).abs <= event.collision && (event.py - @py).abs <= event.collision
if t.include?(event.trigger) && event.priority_type != 1
event.start
result = true if event.starting
end
end
end
return result
end
def pixel_tt?(t)
return false if $game_map.interpreter.running?
result = false
fx = @px+Trigger_Range[@direction][0]
fy = @py+Trigger_Range[@direction][1]
for event in $game_map.events.values
if (event.px - fx).abs <= event.collision && (event.py - fy).abs <= event.collision
if t.include?(event.trigger) && event.priority_type == 1
event.start
result = true
end
end
end
if !result && $physics[$game_map.map_id][fx,fy,5] == 1
fx += Counter_Range[@direction][0]
fy += Counter_Range[@direction][1]
for event in $game_map.events.values
if (event.px - fx).abs <= event.collision && (event.py - fy).abs <= event.collision
if t.include?(event.trigger) && event.priority_type == 1
event.start
result = true
end
end
end
end
return result
end
def check_touch_event
return false if in_airship?
return (@pixel ? pixel_th?([1,2]) : check_event_trigger_here([1,2]))
end
def check_action_event
return false if in_airship?
return true if (@pixel ? pixel_th?([0]) : check_event_trigger_here([0]))
return (@pixel ? pixel_tt?([0,1,2]) : check_event_trigger_there([0,1,2]))
end
end
class Game_Event < Game_Character
alias apm_event_initialize initialize
alias apm_setup setup
def initialize(m,e)
apm_event_initialize(m,e)
setup_collision
end
def setup_collision
@collision = Collision
unless @list.nil?
for value in 0...@list.size
next if @list[value].code != 108 && @list[value].code != 408
if @list[value].parameters[0].include?("[collision ")
@list[value].parameters[0].scan(/\[collision ([0.0-9.9]+)\]/)
@collision = $1.to_i
end
end
end
@force_dc = false
return unless @pixel
unless @list.nil?
for value in 0...@list.size
next if @list[value].code != 108 && @list[value].code != 408
if @list[value].parameters[0] == ("[forcedefaultcmd]")
@force_dc = true
end
end
end
end
def check_touch(px,py)
return if $game_map.interpreter.running? || $game_player.in_vehicle?
if @trigger == 2 && ($game_player.px - px).abs <= @collision && ($game_player.py - py).abs <= @collision
start if not jumping? and @priority_type == 1
end
end
def setup(n)
apm_setup(n)
unless @page.nil?
setup_collision
multiply_commands unless @force_dc
end
end
def move_random
if @force_dc
case rand(4)
when 0; pixel_md(true)
when 1; pixel_ml(true)
when 2; pixel_mr(true)
when 3; pixel_mu(true)
end
else
super
end
end
def pixel_mr(turn_ok)
if @force_dc
if pixel_passable?(@px+Pixel,@py)
turn_right
@x += 1
@px += Pixel
@real_x = (@x-1)*256
increase_steps
@move_failed = false
else
turn_right if turn_ok
check_touch(@px+1, @py)
@move_failed = true
end
else
super(turn_ok)
end
end
def pixel_ml(turn_ok)
if @force_dc
if pixel_passable?(@px-Pixel,@py)
turn_left
@x -= 1
@px -= Pixel
@real_x = (@x+1)*256
increase_steps
@move_failed = false
else
turn_left if turn_ok
check_touch(@px-1, @py)
@move_failed = true
end
else
super(turn_ok)
end
end
def pixel_mu(turn_ok)
if @force_dc
if pixel_passable?(@px,@py-Pixel)
turn_up
@y -= 1
@py -= Pixel
@real_y = (@y+1)*256
increase_steps
@move_failed = false
else
turn_up if turn_ok
check_touch(@px, @py-1)
@move_failed = true
end
else
super(turn_ok)
end
end
def pixel_md(turn_ok)
if @force_dc
if pixel_passable?(@px,@py+Pixel)
turn_down
@y += 1
@py += Pixel
@real_y = (@y-1)*256
increase_steps
@move_failed = false
else
turn_down if turn_ok
check_touch(@px, @py+1)
@move_failed = true
end
else
super(turn_ok)
end
end
end
class Game_Map
alias apm_initialize initialize
alias apm_setup setup
def initialize
apm_initialize
@pixel_w = 0
@pixel_h = 0
end
def setup(id)
apm_setup(id)
@pixel_w = Pixel_Core::Pixel*@map.width
@pixel_h = Pixel_Core::Pixel*@map.height
end
def pixel_valid?(px,py)
return (px >= 0 && px < @pixel_w && py >= 0 && py < @pixel_h)
end
end
class Game_Vehicle < Game_Character
alias apm_set_location set_location
alias apm_sync_with_player sync_with_player
def set_location(m,x,y)
apm_set_location(m,x,y)
if Maps.include?(m)
@x = @x.to_f
@y = @y.to_f
@pixel = true
else
@pixel = false
end
@px = (@x*Pixel).to_i
@py = (@y*Pixel).to_i
end
def sync_with_player
apm_sync_with_player
@px = $game_player.px
@py = $game_player.py
end
end
class Khas_Physics
Axis = Pixel_Core::Axis
Bush_Axis = Pixel_Core::Bush_Axis
Pixel = Pixel_Core::Pixel
Tile = Pixel_Core::Tile
Counter_Axis = Pixel_Core::Counter_Axis
def initialize
@maps = {}
@passages = load_data("Data/System.rvdata").passages
run
end
def run
size = []; phase = 0
for i in 0...Pixel_Core::Maps.size
size << (100*i)/Pixel_Core::Maps.size
end
warn = Sprite.new
warn.bitmap = Bitmap.new(192,32)
warn.y = 376
for id in Pixel_Core::Maps
warn.bitmap.clear
warn.bitmap.draw_text(32,0,160,32,"Loading... #{size[phase]}%")
Graphics.update; Graphics.wait(5)
map = load_data(sprintf("Data/Map%03d.rvdata", id))
@maps[id] = Table.new(map.width*Pixel,map.height*Pixel,6)
for x in 0...(map.width*Pixel)
for y in 0...(map.height*Pixel)
@maps[id][x,y,0] = process_point(x*Tile+Axis[0],y*Tile+Axis[1],map,0x01)
@maps[id][x,y,1] = process_point(x*Tile+Axis[0],y*Tile+Axis[1],map,0x02)
@maps[id][x,y,2] = process_point(x*Tile+Axis[0],y*Tile+Axis[1],map,0x04)
@maps[id][x,y,3] = process_point(x*Tile+Axis[0],y*Tile+Axis[1],map,0x08)
@maps[id][x,y,4] = bush_point?(x*Tile+Bush_Axis[0],y*Tile+Bush_Axis[1],map)
@maps[id][x,y,5] = counter_point?(x*Tile+Counter_Axis[0],y*Tile+Counter_Axis[1],map)
end
end
phase += 1
end
warn.bitmap.clear
warn.bitmap.draw_text(32,0,160,32,"Loading... 100%")
Graphics.update; Graphics.wait(20)
warn.bitmap.dispose; warn.dispose
warn = nil
Graphics.update
end
def process_point(x,y,map,flag)
return 0 unless (x >= 0 && x < map.width && y >= 0 && y < map.height)
return 0 unless free_tile?(x.to_i,y.to_i,map,flag)
return 0 unless free_tile?((x+Axis[2]).to_i,y.to_i,map,flag)
return 0 unless free_tile?(x.to_i,(y+Axis[3]).to_i,map,flag)
return 0 unless free_tile?((x+Axis[2]).to_i,(y+Axis[3]).to_i,map,flag)
return 1
end
def bush_point?(x,y,map)
return 1 if (@passages[map.data[x.to_i,y.to_i,1]] & 0x40 == 0x40 rescue false)
return 1 if (@passages[map.data[(x+Bush_Axis[2]).to_i,y.to_i,1]] & 0x40 == 0x40 rescue false)
return 1 if (@passages[map.data[x.to_i,(y+Bush_Axis[3]).to_i,1]] & 0x40 == 0x40 rescue false)
return 1 if (@passages[map.data[(x+Bush_Axis[2]).to_i,(y+Bush_Axis[3]).to_i,1]] & 0x40 == 0x40 rescue false)
return 0
end
def counter_point?(x,y,map)
return 1 if (@passages[map.data[x.to_i,y.to_i,0]] & 0x80 == 0x80 rescue false)
return 1 if (@passages[map.data[(x+Counter_Axis[2]).to_i,y.to_i,0]] & 0x80 == 0x80 rescue false)
return 1 if (@passages[map.data[x.to_i,(y+Counter_Axis[3]).to_i,0]] & 0x80 == 0x80 rescue false)
return 1 if (@passages[map.data[(x+Counter_Axis[2]).to_i,(y+Counter_Axis[3]).to_i,0]] & 0x80 == 0x80 rescue false)
return 0
end
def free_tile?(x,y,map,flag)
for i in [2, 1, 0]
tile_id = map.data[x, y, i]
return false if tile_id == nil
pass = @passages[tile_id]
next if pass & 0x10 == 0x10
return true if pass & flag == 0x00
return false if pass & flag == flag
end
return false
end
def [](id)
return @maps[id]
end
end
if File.exists?("Khas Physics.rgss2a") && !(Pixel_Core::Force_Physics_Update && $TEST)
tmf = File.open("Khas Physics.rgss2a", "rb")
$physics = Marshal.load(tmf); tmf.close
else
$physics = Khas_Physics.new
tmf = File.open("Khas Physics.rgss2a", "wb")
Marshal.dump($physics,tmf); tmf.close
end
Any help would be appreciated, thank you!
If I recall this version correctly, there is a switch called "Caterpillar" that needs to be set to ON with an event. I think its #23. Im just goin with the basics, as Im not very good at most of the scripting language.
You're partially correct. The switch by default is 23, you can redefine it on line 70 of the script
I've yet to see a single catepillar system or script that can deal with dead party members. I'm no scripter myself, but anyone think of an easy way to deal with knocked out (dead) party members? I really love how the Dragon's Quests games do it with little coffin images...
QuoteI've yet to see a single catepillar system or script that can deal with dead party members. I'm no scripter myself, but anyone think of an easy way to deal with knocked out (dead) party members? I really love how the Dragon's Quests games do it with little coffin images...
Well, this script already uses events. So just put a condition inside the event of the party members that if actor has x state inflicted that his graphic will be changed, then set the else to change to the original graphic so it can change back when the state isn't inflicted. Pretty sure that'll work.
thanx, that's actually what I did...
Well, I have a problem with SwapXT, not an error or anything, but the actual caterpillar doesn't work on SwapXT maps.
I had the same problem that affected neuromonster.
[spoiler]
Quote from: neuromonster on September 22, 2010, 01:54:18 AM
Hey, I've been trying to get this script and the autoparty add on to work, and I've got them running pretty smoothly, except when you load a saved game the followers that were generated prior to saving will just stand in the place they were in during the save and not move. This goes away as soon as you change maps but it looks really awkward. I was wondering if there was any way around it? Whenever I change something enough for the script to reinitialize or whatever the saves won't have this issue for at least one load, I think if there was a way to flip the activating switch off and on real quick every time you load a game it would work, I just have no idea how one would go about doing that.
Any help in this matter would be greatly appreciated.
[/spoiler]
The solution of RavenTDA gave me an error.
And the solution what i found is this:- You have to press F11(script editor) and go to "scenes", then "Scene_File".
- Go to the line 195 and paste this
$game_switches[23] = trueSo, when you execute load, automaticly the switch 23 turn on, and the events (caterpillar) follow you again. (the DEMO used the switch 23)
I hope this will help to someone.
CYA later
KriZ
Thanks for posting that here Kriz!