Print Page | Close Window

Portal Warp

Printed From: Mirage Source
Category: Tutorials
Forum Name: Approved Tutorials
Forum Discription: All tutorials shown to actually work with MSE are moved here.
URL: http://ms.shannaracorp.com/backup-forums/forum_posts.asp?TID=26
Printed Date: 20 December 2006 at 6:00pm
Software Version: Web Wiz Forums 8.01 - http://www.webwizforums.com


Topic: Portal Warp
Posted By: Sync
Subject: Portal Warp
Date Posted: 07 February 2006 at 5:10pm
Originally posted by PresiseFA

Difficulty - Easy 1/5

Created by: map210690
Modified/Cleaned up by: PresiseFA

Client Side -

find -

Sub HandleKeyPresses


somewhere in there, add -

        ' Portal code
        If LCase(Mid(MyText, 1, 10)) = "/setportal" Then
             Call SendData("setportal" & SEP_CHAR & END_CHAR)
             MyText = ""
             Exit Sub
        End If
       
        If LCase(Mid(MyText, 1, 7)) = "/portal" Then
             Call SendData("portal" & SEP_CHAR & END_CHAR)
             MyText = ""
             Exit Sub
        End If


thats it for the client.

Server Side -

find -

Sub HandleData


at the top, add -

Dim CNum As Long


then somewhere in there, add -

    ' Portals Code
    For CNum = 1 To MAX_CHARS
   
    If LCase(Parse(0)) = "setportal" Then
             If GetPlayerAccess(Index) > "0" Then
                 Call PutVar(App.Path & "\accounts\" & GetPlayerLogin(Index) & ".ini", "char" & CNum, "portal", 1)
                 Call PlayerMsg(Index, "You have created a portal opening at this spot! You may now return to this spot at any time by typing /portal", 6)
                 Call PutVar(App.Path & "\accounts\" & GetPlayerLogin(Index) & ".ini", "char" & CNum, "pmap", GetPlayerMap(Index))
                 Call PutVar(App.Path & "\accounts\" & GetPlayerLogin(Index) & ".ini", "char" & CNum, "px", GetPlayerX(Index))
                 Call PutVar(App.Path & "\accounts\" & GetPlayerLogin(Index) & ".ini", "char" & CNum, "py", GetPlayerY(Index))
             Else
                 Call PlayerMsg(Index, "You do not have that ability.", 4)
             End If
        Exit Sub
    End If
       
    If LCase(Parse(0)) = "portal" Then
             If GetVar(App.Path & "\accounts\" & GetPlayerLogin(Index) & ".ini", "char" & CNum, "portal") = 1 Then
           Call SetPlayerMap(Index, GetVar(App.Path & "\accounts\" & GetPlayerLogin(Index) & ".ini", "char" & CNum, "pmap"))
                 Call SetPlayerY(Index, GetVar(App.Path & "\accounts\" & GetPlayerLogin(Index) & ".ini", "char" & CNum, "py"))
           Call SetPlayerX(Index, GetVar(App.Path & "\accounts\" & GetPlayerLogin(Index) & ".ini", "char" & CNum, "px"))
                 Call SendPlayerData(Index)
             ElseIf GetVar(App.Path & "\accounts\" & GetPlayerLogin(Index) & ".ini", "char" & CNum, "portal") = 0 Then
                 Call PlayerMsg(Index, "You do not have a portal set.", 4)
             End If
        Exit Sub
    End If
    Next CNum


there you guys go, what this does, is you type /setportal, and it records your location, and anytime later, you can warp to that location by typing /portal.

all i did, was modify this to work with MS.. enjoy.




Replies:
Posted By: Sync
Date Posted: 07 February 2006 at 5:10pm
Approved


Posted By: Da Undead
Date Posted: 05 March 2006 at 12:33pm

Is this for admins only or is this for any member?



Posted By: tosuxo
Date Posted: 05 March 2006 at 1:04pm
             If GetPlayerAccess(Index) > "0" Then

please read things.... yet another copy & paste "programmer"


Posted By: Renegade
Date Posted: 05 March 2006 at 2:21pm
This doesnt work without some editing undead so get ready =)

-------------
Eternia online, Coming soon to a movie i mean computer near you!


Posted By: Da Undead
Date Posted: 05 March 2006 at 2:22pm

I read that and I just got into Mirage, im switching from Elysium to Mirage. And i was wandering because the variables are different in Elysium than Mirage...

So if i change that "0" to "2", mappers + can use it only?



Posted By: Misunderstood
Date Posted: 05 March 2006 at 4:05pm
just change it to the admin_mapper constant(if its called something different than look it up)

Also, this looks like it was made for elysium and it uses getvar to find the players info, it should be changed to just directly access the players data already in memory player(index).crap


Posted By: Da Undead
Date Posted: 15 March 2006 at 9:57am

Tried it with elysium and it didn't work.

Think you can debug it for elysium format?



Posted By: Misunderstood
Date Posted: 15 March 2006 at 10:40am
I think this was made for elysiums sadscript anywyay, not for MS, otherwise the constant use of getvar and putvar will really slow down your game(even in the sadscript)


Posted By: Da Undead
Date Posted: 15 March 2006 at 12:49pm

well this doesn't work for Elysium!

 

lol...



Posted By: Misunderstood
Date Posted: 15 March 2006 at 1:36pm
then try modifying it to work with it. Its not like you just copy and paste code or anything.


Posted By: Renegade
Date Posted: 16 March 2006 at 5:22am

Ok this is the last time im saying this CALMLY

1. Tell us the error
2. Explain where the error happens
3. WHEN it happens

Thanks =)



-------------
Eternia online, Coming soon to a movie i mean computer near you!


Posted By: DarkAngel
Date Posted: 16 March 2006 at 6:57am
You're completely right...this is from the OOLLLDDD Konfuze Forums.

-DA


Posted By: Renegade
Date Posted: 16 March 2006 at 9:02am
Konfuze is Miragesource just edited! jesus. Anyway Undead msn me mailto:Renagade246@hotmail.com - Renagade246@hotmail.com come to me with errors and then post ok!

-------------
Eternia online, Coming soon to a movie i mean computer near you!


Posted By: funkynut
Date Posted: 16 March 2006 at 10:45am
lmfao, this situation with undead is getting kinda funny, besides, there really isnt much code to edit


Posted By: Da Undead
Date Posted: 16 March 2006 at 5:20pm
I found this is already in the main.txt so im guessing I won't need this


Posted By: DarkAngel
Date Posted: 17 March 2006 at 1:31am
Renegade, thanks for the un-needed history lesson.

Listen, this tut was posted on www.konfuze.com about, oh a year or more ago. This tut was for the sad script system just like Mis stated. That's all I was saying.

-DA


Posted By: funkynut
Date Posted: 17 March 2006 at 7:22am
un needed history lesson, where?


Posted By: DarkAngel
Date Posted: 17 March 2006 at 8:23am
"Konfuze is Miragesource just edited! jesus."

Right there...and by the way, it was sarcasm...

-DA


-------------
http://requiem.thefmp.com">


Posted By: funkynut
Date Posted: 17 March 2006 at 9:34am
Ah, sounded like you were taking a cheap shot, and I cant let anyone do that to my dear renagade 


Posted By: Renegade
Date Posted: 17 March 2006 at 11:14am
Undead i had it working fine on my game i dont see how errors come to you. Your like my mate bullets are attracted to his head. Maybe bug are attrected to your code =p

-------------
Eternia online, Coming soon to a movie i mean computer near you!



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums version 8.01 - http://www.webwizforums.com
Copyright ©2001-2006 Web Wiz Guide - http://www.webwizguide.info