Author Topic: [XP] Teleportation Items  (Read 5645 times)

Offline mroedesigns

  • Ethereal Devastator
  • ****
  • Posts: 394
  • LV: 31
  • Gender: Male
  • I seeee you
    • View Profile
    • MRoe Designs
[XP] Teleportation Items
« on: January 08, 2011, 03:38:34 PM »
Teleportation Items
Authors: MRoeDesigns
Version: 1.2
Type: Custom Item System
Key Term: Custom Item System

Introduction
This script allows the player to use a certain item to be teleported to any given location. You can use script calls within events or other scripts to change the location of the teleport at any point in time.

Features
  • Allows players to be teleported using an item.

Screenshots
N/A

Demo
N/A

Script
(click to show/hide)

Instructions
In the script.

Compatibility
Working on the RMX-OS controller, not yet compatible.

Credits and Thanks
  • edwardthefma for the Town Scrolls script

Author's Notes
Free to use as long as credit is given.
This is my first script, so there's bound to be bugs. Let me know if you run into any, or if you have a question about something.
« Last Edit: January 09, 2011, 11:36:40 PM by mroedesigns »

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6585
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] Teleportation Items
« Reply #1 on: January 09, 2011, 12:51:32 PM »
This is made for RMX-OS only why?

Anyways nice job on a first script. :3

Offline mroedesigns

  • Ethereal Devastator
  • ****
  • Posts: 394
  • LV: 31
  • Gender: Male
  • I seeee you
    • View Profile
    • MRoe Designs
Re: [XP] Teleportation Items
« Reply #2 on: January 09, 2011, 12:53:50 PM »
This is made for RMX-OS only why?
/facepalm
My bad, forgot to take that out. Originally it was used for RMX-OS, but I for some reason can't figure out how to write the controller, so that's irrelivant.
Fixed, v 1.1 :p

Anyways nice job on a first script. :3
ty ^.^

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6585
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] Teleportation Items
« Reply #3 on: January 09, 2011, 01:07:37 PM »
Ha no problem. Also not to be a sarcastic ass, but technically there is no usable/accessible item with the id of zero. It starts at 1 and goes up. xP Just had to point that out sorry.

Futendra

  • Guest
Re: [XP] Teleportation Items
« Reply #4 on: January 09, 2011, 04:29:19 PM »
I was busy eventing this o.O strange xd

Well hmm, script or event?? which would be best....

Offline mroedesigns

  • Ethereal Devastator
  • ****
  • Posts: 394
  • LV: 31
  • Gender: Male
  • I seeee you
    • View Profile
    • MRoe Designs
Re: [XP] Teleportation Items
« Reply #5 on: January 09, 2011, 11:16:40 PM »
Ha no problem. Also not to be a sarcastic ass, but technically there is no usable/accessible item with the id of zero. It starts at 1 and goes up. xP Just had to point that out sorry.

It's not indexing through items, but rather checking the LocationID to see where it should transfer the player to.

IE in my game you have 4 different origins, or 'home towns' for players. So you can set 0 to teleport to the first hometown, 1 for the second, ect.

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3248
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Teleportation Items
« Reply #6 on: January 09, 2011, 11:33:07 PM »
Good job on your first script.

One question, though. What's the point of this?
Code: [Select]
 
  def initialize
    @LocationID = 0
  end

You use singleton methods to call, so the class is never instantized, making this method worthless.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline mroedesigns

  • Ethereal Devastator
  • ****
  • Posts: 394
  • LV: 31
  • Gender: Male
  • I seeee you
    • View Profile
    • MRoe Designs
Re: [XP] Teleportation Items
« Reply #7 on: January 09, 2011, 11:35:11 PM »
Good job on your first script.

One question, though. What's the point of this?
Code: [Select]
 
...

You use singleton methods to call, so the class is never instantized, making this method worthless.

^Shrug^ I was told to make sure I initialized it. I thought it was useless... thanks for confirming that :p

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3248
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Teleportation Items
« Reply #8 on: January 10, 2011, 12:23:06 AM »
You really only need to initialize objects if they are going to be referenced in a way they have to be a specific data type.

ex.
Code: [Select]
def initialize
  @name = 'zer0'
end

def main
  if @name.length <= 3
    # Since this is calling a method of the String class, which NilClass doesn't have, it would throw an error.
  end
end

In this case you don't need to initialize it, since the method actually does that for you.

Code: [Select]
def make_name
   @name = 'zer0'
end

Unlike C languages, etc., Ruby is pretty flexible and doesn't require you to declare variables ahead of time.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline mroedesigns

  • Ethereal Devastator
  • ****
  • Posts: 394
  • LV: 31
  • Gender: Male
  • I seeee you
    • View Profile
    • MRoe Designs
Re: [XP] Teleportation Items
« Reply #9 on: January 10, 2011, 12:58:06 AM »
That makes sense. Thanks!  :haha: