H5 transferring scripts

Maps and the art of mapmaking.
Sarvi
Leprechaun
Leprechaun
Posts: 46
Joined: 29 Sep 2006

H5 transferring scripts

Unread postby Sarvi » 03 Jan 2009, 02:54

Does anyone know how to export a script from a H5 map and then import it (or pieces of it) into the script of another map??
It would save a lot of work: re-typing, weeding out errors, etc.
I often use similar commands in different maps, (such as PlayVisualEffect or Play2DSound) with just small alterations required...
Ach wie schoen das niemand weiss....

User avatar
Asheera
Round Table Knight
Round Table Knight
Posts: 4506
Joined: 06 Jul 2008
Location: The Shadows
Contact:

Unread postby Asheera » 03 Jan 2009, 12:15

You could make a Mod to hold your file and then, at the beginning of your map script, write:

Code: Select all

doFile("/scripts/maps-common.lua")
(let's assume your common script is name maps-common.lua and you placed it in a scripts folder inside a mod)

You could as well put it in one of the Maps (outside the "Maps" folder in the .h5m file, create a "scripts" folder and place the maps-common.lua file there), though I'm not sure if this one works...
No matter how powerful one becomes, there is always someone stronger. That's why I'm in a constant pursuit of power, so I can be prepared when an enemy tries to take advantage of me.

Sarvi
Leprechaun
Leprechaun
Posts: 46
Joined: 29 Sep 2006

script file export

Unread postby Sarvi » 05 Jan 2009, 06:35

Thanks for your ideas...
Since I posted this message it occurred to me that its actually very simple!
Just unzip the map file and extract the MapScript.lua file to your documents or somewhere. You can then read the script file with NotePad or other text editor, cut, paste, and copy pieces, etc.
No problem!
Ach wie schoen das niemand weiss....

User avatar
Asheera
Round Table Knight
Round Table Knight
Posts: 4506
Joined: 06 Jul 2008
Location: The Shadows
Contact:

Unread postby Asheera » 05 Jan 2009, 21:47

Yes that was what I was talking about. And if you need to share it between multiple maps you can just place it in one of them and write that doFile line I said above at the start of the map scripts.
No matter how powerful one becomes, there is always someone stronger. That's why I'm in a constant pursuit of power, so I can be prepared when an enemy tries to take advantage of me.


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 9 guests