RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Swimming Script!

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 88
Patriots all the way!!
What you mean add it to your character?
Im to cool to have my own signature!!!

pokeball :)OfflineMale
********
Cheese
Rep:
Level 95
?
sweeeeetness! nice update.
Watch out for: HaloOfTheSun

**
Rep:
Level 87
What you mean add it to your character?
you know...tools>database>actors double click the picture and select a new one?

**
Rep:
Level 88
Patriots all the way!!
Oh, you got to make a whole new character?
Im to cool to have my own signature!!!

**
Rep:
Level 87
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)

**
Rep:
Level 88
Patriots all the way!!
Ok, I'll try out what you said.
Im to cool to have my own signature!!!

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

**
Rep:
Level 87
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.

**
Rep: +0/-0Level 87
I just tried the script and for some reason it just wont work. ???
I'm watching you!

**
Rep:
Level 87
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.

**
Rep: +0/-0Level 87
Theres an error and yes I did follow the instrucions.
I'm watching you!

*****
<3
Rep:
Level 90
Awesome script and very unique! Rep +

~Winged



**
Rep:
Level 87
Okay...so what is the error?

**
Rep: +0/-0Level 87
It comes up saying that it's unaccessable. If it makes any difference I use Postality Knights.
I'm watching you!

**
Rep:
Level 87
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!

**
Rep:
Level 87
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.

**
Rep:
Level 87
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?
Code: [Select]
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?
« Last Edit: March 07, 2007, 07:15:38 PM by toriverly »

**
Rep: +0/-0Level 87
I'm watching you!

**
Rep: +0/-0Level 87
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.
« Last Edit: March 09, 2007, 12:47:06 AM by zzboy »
I'm watching you!

**
Rep: +0/-0Level 87
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.

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

Spoiler for if you want the characters to learn faster::

Code: [Select]
# 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
Although I don't have rmxp on this computer and I haven't scripted in ages, i'm fairly certain that should work.
enjoy :)

**
Rep: +0/-0Level 87
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. ;/

**
Rep:
Level 87
  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.

**
Rep: +0/-0Level 87
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. ;/

**
Rep:
Level 87
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.