Eclipse
January 05, 2009, 09:53:25 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Chat Help Rules Arcade Search Calendar Gallery Login Register  
 
 
 
Recent Topics +-
Actual Map for the continents by Kreator
Today at 09:52:06 PM

Lostica [Project Revamp] by Kreator
Today at 09:49:49 PM

Disparity Recruiting by Peter
Today at 09:49:31 PM

Okay Questions (very noob person here) by The Roujo
Today at 09:48:45 PM

fun with photoshop by MrMiguu™
Today at 09:48:19 PM

stackable items? by MrMiguu™
Today at 09:45:06 PM

scripts? by MrMiguu™
Today at 09:44:14 PM

Party system : is it possible? by MrMiguu™
Today at 09:43:48 PM

Which version of eclipse do you like most for sadscripting? by Kainan54
Today at 09:42:38 PM

Count to 1,000,000! by The Roujo
Today at 09:41:11 PM

Members Online +-
10 Guests, 21 Users
Sablefalcon,
‪‫‬‭‮‪‫‬‭The Admiral,
Kreator,
Amperglyph,
waffletamer,
Haruhito,
Peter,
‪‫‬‭‮‪‫Kusy,
HawkStorm95,
The Roujo,
shakadaran,
Simius Cruentus,
hammer,
FS:CG Admin[Shadowwulf],
MrMiguu™,
dragonlord52,
dg1423,
Mitus,
Kainan54,
kira423,
Niko
Pages: [1]
  Print  
Author Topic: Map Copy Script  (Read 1012 times)
0 Members and 1 Guest are viewing this topic.
Ilnair
The Uber-Scriptor
Advanced Member
****
Offline Offline

Posts: 592


The Uber-Scriptor


View Profile WWW Email
« on: May 24, 2006, 04:55:49 AM »

Heya all, another script submission from me :D. I hope you like it, it certainly is usefull!

With /mapsave it will save the current map to a .ini file on the server.
With /mapload it will open the ini file, and copy it to your current map.

For example:
I got a nice forest map, and I want the next map to be exactly the same. So I go to the current forest map, and I enter /mapsave, I wait for it to finish, and then I go to the next map, and I use /mapload, and voila, I got a filled forest map.

WARNING, READ THIS!
This script will overwrite all current things in the map without asking! Please do not be angry at my if you screwed your game with this script, I can't help it. Be sure you are in a map that can be completely redone before you use the command!!!! Also, this script will ONLY copy BLOCKED and NPC AVOID atributes, to avoid any errors!!!

Warning 2: DO NOT EXIT GAME OR CHANGE MAP WHILE LOADING/SAVING, THIS WILL MOST LIKELY CAUSE YOUR SERVER TO CRASH!!!!



Installing the script:

Step 1: Copy this part at the bottom of your main:

Code: [Select]

'************************************************
'MAP COPY SCRIPT © Dinand Mentink (Ilnair) !!!!
'************************************************
Sub LoadMap(index, map)
If GetPlayerAccess(index) > 0 Then
Call PlayerMsg(index, "DO NOT EXIT OR CHANGE MAP!!!!!!", 12)
Else
Exit Sub
End If
Dim layer
Dim x
Dim y

Dim editx
Dim edity
Dim editset

x = 0
layer = 0
y = 0



Do While Layer < 9
Call PlayerMsg(index, layer & "0% DO NOT EXIT OR CHANGE MAP!!!!!!", 12)

Do While y < 15
Call PlayerMsg(index, layer & "0% DO NOT EXIT OR CHANGE MAP!!!!!!", 12)

Do While X < 20
editx = GetVar("playerhouse.ini", "house save", layer & " " & x & " " & y & " " & " " & "x")
edity = GetVar("playerhouse.ini", "house save", layer & " " & x & " " & y & " " & " " & "y")
editset = GetVar("playerhouse.ini", "house save", layer & " " & x & " " & y & " " & " " & "set")

Call SetTile(map, x, y, editx, edity, editset, layer)  



X = X + 1
Loop
y = y + 1
x = 0
Loop
layer = layer + 1
y = 0
x = 0
Loop

x = 0
y = 0

Do While Y < 15

Call PlayerMsg(index, "90% DO NOT EXIT OR CHANGE MAP!!!!!!", 12)

Do While x < 20

editset = GetVar("playerhouse.ini", "house save", "atribute" & " " & x & " " & y)

Call SetAttribute(GetPlayerMap(index),x,y,editset,0,0,0,"","","")
x = x + 1
loop
y = y + 1
x = 0
loop



Call PlayerMsg(index, "MAP LOAD SUCCESS!!!!!", 10)
End Sub


Sub SaveMap(index)
If GetPlayerAccess(index) > 0 Then
Call PlayerMsg(index, "DO NOT EXIT OR CHANGE MAP!!!!!!", 12)
Else
Exit Sub
End If
Dim layer
Dim x
Dim y

x = 0
layer = 0
y = 0



Do While Layer < 9
Do While y < 15
Call PlayerMsg(index, layer & "0% DO NOT EXIT OR CHANGE MAP!!!!!!", 12)

Do While X < 20

Call PutVar("playerhouse.ini", "house save", layer & " " & x & " " & y & " " & " " & "x",

GetTileX(GetPlayerMap(index), X, Y, layer))

Call PutVar("playerhouse.ini", "house save", layer & " " & x & " " & y & " " & " " & "y",

GetTileY(GetPlayerMap(index), X, Y, layer))

Call PutVar("playerhouse.ini", "house save", layer & " " & x & " " & y & " " & " " & "set",

GetTileSet(GetPlayerMap(index), X, Y, layer))
X = X + 1
Loop
y = y + 1
x = 0
Loop
layer = layer + 1
y = 0
x = 0


Loop


x = 0
y = 0

Do While Y < 15

Call PlayerMsg(index, "90% DO NOT EXIT OR CHANGE MAP!!!!!!", 12)

Do While x < 20
If GetAttribute(GetPlayerMap(index), x, y) = 1 or GetAttribute(GetPlayerMap(index), x, y) = 4 Then
Call PutVar("playerhouse.ini", "house save", "atribute" & " " & x & " " & y,

GetAttribute(GetPlayerMap(index), x, y) & "")
Else
Call PutVar("playerhouse.ini", "house save", "atribute" & " " & x & " " & y, "0")
End If
x = x + 1
loop
y = y + 1
x = 0
loop



Call PlayerMsg(index, "MAP SAVE SUCCESS!!!!!", 10)
End Sub
'**************************************************
'END OF MAP COPY SCRIPT! ©Dinand Mentink (Ilnair)
'**************************************************


And then add the folowing commands:


Code: [Select]
Case "/mapsave"
Call SaveMap(index)
Exit Sub

Case "/mapload"
Call LoadMap(index, GetPlayerMap(index))
Exit Sub



And that should do it!

1 more time:
I AM NOT RESPONSIBLE FOR ANY MAP LOSS BECAUSE OF THIS!!!!

The script will not cause any maps to be lost if used correctly, always use your head when using it!
Rogue
Veteran
Advanced Member
*
Offline Offline

Posts: 670


GARBLE GARBLE


View Profile WWW Email
« Reply #1 on: May 24, 2006, 06:54:27 AM »

i just use copy paste and rename the map is quicker and easier
Ilnair
The Uber-Scriptor
Advanced Member
****
Offline Offline

Posts: 592


The Uber-Scriptor


View Profile WWW Email
« Reply #2 on: May 24, 2006, 07:04:24 AM »

Yah, agreed, but you gotta restart server for that. Also, after installing this will be easyer ^^.

Btw, i'm also using this script in my playerhouse script, to reset all playerhouses monthly.


Well, just do with it what you want, I don't really care ^^.
Fulou
Uber Scripter.
Active Member
***
Offline Offline

Posts: 394


View Profile WWW Email
« Reply #3 on: May 24, 2006, 08:40:27 AM »

Everytime it runs though, it will lag the server drasically and no other scripts will run till it finishes. Im struggling with that at the moment -_-
Ilnair
The Uber-Scriptor
Advanced Member
****
Offline Offline

Posts: 592


The Uber-Scriptor


View Profile WWW Email
« Reply #4 on: May 24, 2006, 10:07:02 AM »

I know, that's why i said: use your head while using this script...
‪‫‬‭‮‪‫‬‭The Admiral
-_-'
Moderator
Advanced Eclipser
*
Online Online

Posts: 1,186


!deifieD


View Profile WWW Email
« Reply #5 on: July 28, 2008, 02:27:10 PM »

This topic is abit old, but I thought -- for newb's sake -- I should post this....

Someone said this script doesn't work, because there are some line breaks or something like that... Whether that is true or not, I decided to post it (what they claim as a working version) anyway:
Code: [Select]
'************************************************
'MAP COPY SCRIPT © Dinand Mentink (Ilnair) !!!!
'************************************************
Sub LoadMap(index, map)
If GetPlayerAccess(index) > 0 Then
Call PlayerMsg(index, "DO NOT EXIT OR CHANGE MAP!!!!!!", 12)
Else
Exit Sub
End If
Dim layer
Dim x
Dim y

Dim editx
Dim edity
Dim editset

x = 0
layer = 0
y = 0



Do While Layer < 9
Call PlayerMsg(index, layer & "0% DO NOT EXIT OR CHANGE MAP!!!!!!", 12)

Do While y < 15
Call PlayerMsg(index, layer & "0% DO NOT EXIT OR CHANGE MAP!!!!!!", 12)

Do While X < 20
editx = GetVar("playerhouse.ini", "house save", layer & " " & x & " " & y & " " & " " & "x")
edity = GetVar("playerhouse.ini", "house save", layer & " " & x & " " & y & " " & " " & "y")
editset = GetVar("playerhouse.ini", "house save", layer & " " & x & " " & y & " " & " " & "set")

Call SetTile(map, x, y, editx, edity, editset, layer)



X = X + 1
Loop
y = y + 1
x = 0
Loop
layer = layer + 1
y = 0
x = 0
Loop

x = 0
y = 0

Do While Y < 15

Call PlayerMsg(index, "90% DO NOT EXIT OR CHANGE MAP!!!!!!", 12)

Do While x < 20

editset = GetVar("playerhouse.ini", "house save", "atribute" & " " & x & " " & y)

Call SetAttribute(GetPlayerMap(index),x,y,editset,0,0,0,"","","")
x = x + 1
loop
y = y + 1
x = 0
loop



Call PlayerMsg(index, "MAP LOAD SUCCESS!!!!!", 10)
End Sub


Sub SaveMap(index)
If GetPlayerAccess(index) > 0 Then
Call PlayerMsg(index, "DO NOT EXIT OR CHANGE MAP!!!!!!", 12)
Else
Exit Sub
End If
Dim layer
Dim x
Dim y

x = 0
layer = 0
y = 0



Do While Layer < 9
Do While y < 15
Call PlayerMsg(index, layer & "0% DO NOT EXIT OR CHANGE MAP!!!!!!", 12)

Do While X < 20

Call PutVar("playerhouse.ini", "house save", layer & " " & x & " " & y & " " & " " & "x", GetTileX(GetPlayerMap(index), X, Y, layer))

Call PutVar("playerhouse.ini", "house save", layer & " " & x & " " & y & " " & " " & "y", GetTileY(GetPlayerMap(index), X, Y, layer))

Call PutVar("playerhouse.ini", "house save", layer & " " & x & " " & y & " " & " " & "set", GetTileSet(GetPlayerMap(index), X, Y, layer))
X = X + 1
Loop
y = y + 1
x = 0
Loop
layer = layer + 1
y = 0
x = 0


Loop


x = 0
y = 0

Do While Y < 15

Call PlayerMsg(index, "90% DO NOT EXIT OR CHANGE MAP!!!!!!", 12)

Do While x < 20
If GetAttribute(GetPlayerMap(index), x, y) = 1 or GetAttribute(GetPlayerMap(index), x, y) = 4 Then
Call PutVar("playerhouse.ini", "house save", "atribute" & " " & x & " " & y,

GetAttribute(GetPlayerMap(index), x, y) & "")
Else
Call PutVar("playerhouse.ini", "house save", "atribute" & " " & x & " " & y, "0")
End If
x = x + 1
loop
y = y + 1
x = 0
loop



Call PlayerMsg(index, "MAP SAVE SUCCESS!!!!!", 10)
End Sub
'**************************************************
'END OF MAP COPY SCRIPT! ©Dinand Mentink (Ilnair)
'**************************************************
Thank Rotales for fixing it (I think).
Pages: [1]
  Print  
 
 

Powered by EzPortal
Powered by MySQL Powered by PHP Powered by SMF 2.0 Beta 4 | SMF © 2006–2008, Simple Machines LLC | Sitemap Valid XHTML 1.0! Valid CSS!
Page created in 5.609 seconds with 34 queries.