Main Menu
  • Welcome to The RPG Maker Resource Kit.

Swimming Script!

Started by toriverly, February 26, 2007, 03:29:25 PM

0 Members and 1 Guest are viewing this topic.

Valcos

What you mean add it to your character?
Im to cool to have my own signature!!!

:)

sweeeeetness! nice update.
Watch out for: HaloOfTheSun

toriverly

Quote from: Valcos on February 28, 2007, 09:25:32 PM
What you mean add it to your character?
you know...tools>database>actors double click the picture and select a new one?

Valcos

Oh, you got to make a whole new character?
Im to cool to have my own signature!!!

toriverly

I know that as soon as I make sense, you're gonna say "oh yeah I did that." but I must post this anyway for the sake of helping and being sure.
1. Go to the Database

2. Click the 'Actors' tab

3. Select your actor ^^Aluxes is highlighted there
4. Double-click on the little sprite guy under 'Character Graphic'

5. Select your new graphic


Now, all the other ones (name_swim, name_dive...etc) will be imported with the 'Materials' editor thingy i told you about before into the characters file.  They should work as long as they are named GraphicThatYouJustSet_SwimOrWhatever (ei. 001-Fighter01_swim if your graphic is 001-Fighter01)

Valcos

Ok, I'll try out what you said.
Im to cool to have my own signature!!!

toriverly

fixed two bugs (nobody else noticed them but anyway they're fixed :P) check the updated post.

toriverly

Update:
Now you can (or I should say can't) swim if you don't have a certain item, weapon or armor.  I don't know why you'd need a weapon...maybe you have the magic water rod...w/e it's up to you!

I've also fixed my weird looking template.

zzboy

I just tried the script and for some reason it just wont work. ???
I'm watching you!

toriverly

Be specific: what won't work?  Is there an error? Is it frozen?

Also, did you follow the instructions?  Remember that tiles must have the terrain tag WATER and must be passable.

zzboy

Theres an error and yes I did follow the instrucions.
I'm watching you!

Winged

Awesome script and very unique! Rep +

~Winged



toriverly

Okay...so what is the error?

zzboy

It comes up saying that it's unaccessable. If it makes any difference I use Postality Knights.
I'm watching you!

toriverly

As long as you have all the necessary pictures, i don't see what could be inaccessable?

It's prolly because of PK...I don't know anything about it so I don't know how to fix that error...sorry!

Houna

I encountered a problem too in this part of the script.

# Drowning
  def drown
    $game_screen.start_flash(Color.new(255,0,0,128), 20)
    if @drown_count <= 10
      swim if !@swim
      @drown_count += 1
    elsif @drown_count >=10
      @drown_count = 0
     $scene = Scene_Gameover.new
    end
  end


On this line @drown_count += 1 I had to delete the plus sign for it to work.
Just putting that out there for people to try if they are having trouble.

toriverly

#41
That can't be right.  If you put =1 it will never =10 and you'll never get gameover?
I don't know if you're a scripter but += 1 means "add one" it's not a typo.  You should have a second or so while @drown_count reaches 10 and then you get a gameover.
What happened exactly before and after you removed the +?

@zzboy---I d/l PK to test, but I'm not getting an error? What did you set the constants to?
WATER = 1
SWIM_SWITCH = nil
SWIM_ITEM = nil
SWIM_ARMOR = nil
SWIM_WEAPON = nil
SNEAK_KEY = nil #Input::Letterres["Z"] for Mr.Mo's ABS or input letters script
DASH_KEY = nil #Input::Letters["X"] for Mr.Mo's ABS or input letters script
SWIM_SE = "022-Dive02"
DROWNING = false
WATER_DASHING = false
DIVE_SOUND_OFF = false
DIVE_GRAPHIC = false
TREAD_ANI = true
#---------------------------
These, what did you set them to?

zzboy

I'm watching you!

zzboy

#43
Oh, woops. I was reading through the whole thing and
I think found out what i did wrong. I don't think I made another character. Although I don't quite get how to do that.
I'm watching you!

DarkLordX

Alright - dumb question, I'm sure, by I don't want to alter the script in any way I'll regret later: How exactly can I make the characters swim faster? I'm fairly certain it's with these lines -

# Determines Speed (Swim Leveling)
  def get_speed
    # Gets Swim Count
      @swim_count += 0.05
    case @swim_count
    when 0.05
      @swim_speed = 1
      @move_frequency = 1
    when 100
      @swim_speed =  2
      @move_frequency = 1
    when 250
      @swim_speed = 3
      @move_frequency = 1
    when 750
      @swim_speed = 4
      @move_frequency = 1
    when 2000
      @swim_speed = 5
      @move_frequency = 1
    end

But I'm not sure what's defined as the 'Swim count' or if I want to change it.

toriverly

well, if you want a constant faster speed, just do this:
# Determines Speed (Swim Leveling)
  def get_speed
   @swim_speed = 4 #or any number from 1-6.  3 is walking pace.
    end


[spoiler=if you want the characters to learn faster:]

# Determines Speed (Swim Leveling)
  def get_speed
    # Gets Swim Count
      @swim_count += 0.05 # change this 0.05 to a bigger number to make them level up
                                          # faster.  Remember, just putting 0.5 would be 10 times
                                          # faster.
    case @swim_count
    when 0.05
      @swim_speed = 1
      @move_frequency = 1
    when 100
      @swim_speed =  2
      @move_frequency = 1
    when 250
      @swim_speed = 3
      @move_frequency = 1
    when 750
      @swim_speed = 4
      @move_frequency = 1
    when 2000
      @swim_speed = 5
      @move_frequency = 1
    end
[/spoiler]
Although I don't have rmxp on this computer and I haven't scripted in ages, i'm fairly certain that should work.
enjoy :)

DarkLordX

Alright... one major problem with this script I can see so far... I'm using a caterpillar script for my party, so among the two options of drowning on or off -

If drowning is FALSE, then every time a character tries to go onto a water panel (and by the script, is immediately pushed one step backwards), the party member behind him goes onto the space where the leader just was - so you have the leader of the party unable to go into the water, yes, but all the other members are standing there on the water.

If drowning is TRUE, there are two concerns - every time you walk on a bridge over water or anything, the screen flashes red as if you were about to drown. Aside from that, if the water is only one panel wide and the character walks into it, the screen flashes red and the character jumps forward two panels - OVER the water into an area that should be inaccessible, at least for the time being. ;/

toriverly

  Sorry about the caterpillar script,   I don't get how they work at all *scripting noob here*  I haven't had a lot of time recently in fact I have a math exam in a couple of hours and history tomorrow -_- 

Anyway, the bridge is about terrain tags.  If a terrain tag is 0, the scripts reading them just phase through it and it will behave like the one under it.  It should work if you set it to 2 or w/e is not water or 0.  I can't remember if it's supposed to be a higher # than water though.

DarkLordX

Alright, thanks for the second one... but even if I did use the drowning now, they would still be jumping over 1-tile-wide streams of water.


Caterpillar script - these program it so that your party members trail behind you, or rather, they follow your exact move pattern one panel behind eachother. For example, Bob is the party leader and Joe is the second member in the party. If Bob tries to step onto a water panel, this script pushes him a step back, meaning that the last panel he was on - and coincidingly the one Joe is left on - is the water panel. So, you've got Bob unable to walk on the water, yes, but Joe is left there standing on top of it.

The only way I know could prevent this would be setting a tile as impassible based on its Terrain flag... but alas, I have no idea how or if this is possible. ;/

toriverly

The script calls upon the terrain tag the player is already standing on.  He won't jump until he's already on the water but it looks like he jumps into it.  I suppose I can take another look at it some time, but I'm way too busy right now with exams and well life.  There isn't really much point to swimming across a single tile anyway is there?  You can always just use a second tile there with another terrain tag for "shallow water" and he'll walk over it.  Anyway, I know what a caterpillar script is, but I don't know how to manipulate them.