Welcome to The MoparScape Forums
November 22, 2009, 04:34:37 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
News: We hope you enjoy your stay and follow all rules!
 
  Home Help Search Staff List Login Register  

[TuT] How to add portals and make them work [Explained]


Pages: [1]
  Print  
Author Topic: [TuT] How to add portals and make them work [Explained]  (Read 234 times)
red da dev
Cba To Post
*

Rep 0
Offline Offline

Posts: 1


View Profile Email
« on: February 21, 2008, 02:19:32 pm »

Original Post: Moparscape
NOTE:I AM REDFRODUDE27
Objective:To add a portal and make it teleport you
Server Base:Any
Difficulty:1/10
Assumed Knowledge:Being able to read and understand basic java
Files Modified:Client.java
In this tut I will show you how to add a portal and make it teleport you somewhere.

Beginning of tut:
You should have used Fedexers tut.  If not here is one that is very simple:
http://www.sythe.org/showthread.php?t=365648
I got a few errors when I first used it but it would work god for all of you guys.  If you get errors post 'em.

So once you have done that tut do this:
First, to add the portal search for:

Code:
public void NewObjects()

Than you should see something like this:
Code:
makeGlobalObject(3004, 3383, 2469, 0, 10);//portal
I will tell you which part means what.
The '3004' is the X axis and the '3383' is the Y axis.  The '2469' is the portal ID.  The '0' is the face and the '10' is the Object Type.  This should help for that stuff:
Code:
//FACE: 0= WEST | -1 = NORTH | -2 = EAST | -3 = SOUTH
//ObjectType: 0-3 wall objects, 4-8 wall decoration, 9: diag. walls, 10-11 world objects, 12-21: roofs, 22: floor decoration
See very easy!!!
Here is the object list if you need to pick a portal: http://uppit.com/X8GAGC
NOTE: I added it as an attachment just in case this link gets deleted or messed up
I posted on this site the attachment if you need: http://moparscape.org/smf/index.php/topic,240371.0.html

Now it is time to do the teleporting portal stuff.
Ok now search for:
Code:
case ####
Replace #### with the portal's ID.  If it is not there create it by adding:
Code:
case ####:
break;
Replace #### with the portal's ID.
Than add this in between the case and break:
Code:
if(actionTimer == 0) {
teleportToX = ####;
teleportToY = &&&&;
sendMessage("Your message here");
updateRequired = true;
appearanceUpdateRequired = true;
actionTimer = 5;
}
The #### is the X axis of where you want to teleport and the &&&& is the Y axis of where you want to teleport. Than put your message in the "your message here" area. I know there was a telportToX and Y thing but I felt like saying that =] It's easier
So, I advise you to put your X, Y, and message in the spots I told you.

NOTE: Make sure that the case is the portals ID. 

And if you want it to make an emote or gfx use this:
Code:
stillgfx(gfxID, absY, absX);
That is for the GFX which you should replace with a GFX's ID
This is for the emotes:
Code:
setAnimation(ID);
And replace the ID with the emote's ID.
Here is a GFX list: http://s1.uppit.com/d/DTXFQM
And here is the emote list: http://s1.uppit.com/d/3MX46D

So you finished product should look like this:
Code:
case ####:
if(actionTimer == 0) {
stillgfx(gfxID, absY, absX);
setAnimation(ID);
teleportToX = ####;
teleportToY = &&&&;
sendMessage("Your message here");
updateRequired = true;
appearanceUpdateRequired = true;
actionTimer = 5;
}
break;
But I suggest that you only use either the GFX or emote.  It may lag if you do one.  So if you want it to not lag remove it.

Credits:10% to Fedexer on how to add object's.  And 90% to me for showing you guys how =]

This is very easy so please post your feedback. =]
« Last Edit: February 21, 2008, 02:25:29 pm by red da dev » Report Spam   Logged
pisleowner
Cba To Post
*

Rep 0
Offline Offline

Posts: 1


View Profile
« Reply #1 on: April 04, 2008, 10:53:39 am »

heywhen i do it it sais "orphaned case" ...can u help plzz???
i donno the prob...can u maybe fix a video?
Report Spam   Logged


Pages: [1]
  Print  
 
Jump to:  

Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2006, Simple Machines LLC
ServerBeach Coupon
Page created in 0.129 seconds with 12 queries.