Jump to content




How to make and install Lua resource packs


75 replies to this topic

#41 BlankWolf

  • Members
  • 51 posts

Posted 19 July 2013 - 01:23 AM

View PostPixelToast, on 18 July 2013 - 09:15 PM, said:

could you please upload the resoursepack?
did you follow the same format as the one dan uploaded?
I used the resourcepack from dan. I just add the apis folder in rom and my api in it.

#42 Pharap

  • Members
  • 816 posts
  • LocationEngland

Posted 19 July 2013 - 10:36 PM

View PostPixelToast, on 18 July 2013 - 11:03 AM, said:

View PostElvishJerricco, on 18 July 2013 - 08:32 AM, said:

View Postdent308, on 17 July 2013 - 08:18 PM, said:

The main thing about editing files in the ROM folder is I can setup a 'project' in a proper editor or IDE and bang away at code full speed.
Editing in the saves folder is less than optimal because they move about as computers / turtles are created or destroyed.

I'm not sure if Windows can do this, but any UNIX or Linux system has symlinks. Basically like a shortcut, except the entire operating system sees it as actually being a folder. So you can create the symlink .../computer/{id} and have it point to ~/Documents/MyProject, and going to .../computer/{id}/somefolder will lead to MyProject/somefolder. So just keep the project in your documents and symlink to it in your saves.
making symlinks wouldnt help much because we would have to create them for every id we want them on, this is useful for editing all the files on computers at once but its still a pain in the ass to manage, and most people use windows / mac for minecraft

Try using perl, it values linking so highly it has a built in operator for it.
A simple foreach and you're good to go.

#43 NeverCast

  • Members
  • 400 posts
  • LocationChristchurch, New Zealand

Posted 21 July 2013 - 10:46 PM

You can symlink in all major operating systems, including Windows.
Mklink or Junction ( Vista+, Windows 2000+ respectively )

#44 BlankWolf

  • Members
  • 51 posts

Posted 22 July 2013 - 07:42 AM

View PostBlankWolf, on 18 July 2013 - 02:06 PM, said:

Well I have tried to add an api to the example resourcepack.
I put an "apis" folder in "rom" and my api in the "apis" folder.
But now my computers don't load. I just get a blackscreen and I can't find any error in mc luncher console.

View PostBlankWolf, on 19 July 2013 - 01:23 AM, said:

View PostPixelToast, on 18 July 2013 - 09:15 PM, said:

could you please upload the resoursepack?
did you follow the same format as the one dan uploaded?
I used the resourcepack from dan. I just add the apis folder in rom and my api in it.

Well... I hope I don't nerve, but my question is not answered yet and I wanna know what I'm doing wrong.

#45 GravityScore

  • Members
  • 796 posts
  • LocationLand of Meh

Posted 22 July 2013 - 07:49 AM

View PostBlankWolf, on 22 July 2013 - 07:42 AM, said:

Well... I hope I don't nerve, but my question is not answered yet and I wanna know what I'm doing wrong.

It's working for everyone else, so you can't be doing it exactly the same way we are. Maybe try re-downloading a fresh Minecraft, install forge/CC, and try loading the resource pack again, making sure you follow exactly what's described in the install steps for everything.

#46 coaster3000

  • Members
  • 25 posts
  • LocationNew Jersey USA

Posted 25 July 2013 - 02:52 PM

I have had problems before this update where an api loaded into rom breaks when put there...

You have to check all the code in the api to make sure it still matches the directory.

Its a little odd. But was my problem when I had black screen problems

Example fixing steps:

You have the api code loading this api.
 os.loadAPI("apis/api1")
That is just putting it on computer. And it will work.

However if loaded via rom same with other api.

This change would fix it.
 os.loadAPI("rom/apis/api1")


#47 Pharap

  • Members
  • 816 posts
  • LocationEngland

Posted 29 July 2013 - 12:31 AM

View PostNeverCast, on 21 July 2013 - 10:46 PM, said:

You can symlink in all major operating systems, including Windows.
Mklink or Junction ( Vista+, Windows 2000+ respectively )
Do you happen to know the dll and/or function call required to programatically create symlinks in windows?

#48 TorakTu

  • Members
  • 231 posts

Posted 06 August 2013 - 01:40 PM

Something I have done with my other physical computer sitting here on my other desktop is my own OS from scratch written in Assembly and C. Now that TorNet is under way and half way working, I was looking around at a complete API replacement for an OS of my own in ComputerCraft. I want to add TorNet as a HTTP gateway into my OS so computers can talk to each other like Windows, Mac and Linux does.

So this resource pack idea is interesting. I'll have to play around with it and see how this works. Thanks for posting this info.

#49 TorakTu

  • Members
  • 231 posts

Posted 07 August 2013 - 10:50 PM

OK Question... please keep in mind, I think the resource pack is a cool idea, so that you can go back to the default CraftOS if you need too. But.. Is there a way with the Resource Pack to replace the Bios.lua file with it ? I tried to do it, but it didn't work. I can still see the example file in the demonstration ZIP file that dan posted, but the Bios.Lua file didn't get replaced. Is this on purpose ?

Or is there some special place where it should go that I might not know about ?

#50 GravityScore

  • Members
  • 796 posts
  • LocationLand of Meh

Posted 08 August 2013 - 02:36 AM

View PostTorakTu, on 07 August 2013 - 10:50 PM, said:

OK Question... please keep in mind, I think the resource pack is a cool idea, so that you can go back to the default CraftOS if you need too. But.. Is there a way with the Resource Pack to replace the Bios.lua file with it ? I tried to do it, but it didn't work. I can still see the example file in the demonstration ZIP file that dan posted, but the Bios.Lua file didn't get replaced. Is this on purpose ?

Or is there some special place where it should go that I might not know about ?

The BIOS can't be replaced in the resource pack system :(

#51 TorakTu

  • Members
  • 231 posts

Posted 08 August 2013 - 06:38 AM

View PostGravityScore, on 08 August 2013 - 02:36 AM, said:

The BIOS can't be replaced in the resource pack system :(

Ahh ok. I'll just have to do it manually inside the minecraft ZIP file and then use the resource pack for everything else. It also means anyone who uses my OS would need to do that same thing. Thanks for the info.

#52 BlankWolf

  • Members
  • 51 posts

Posted 09 August 2013 - 01:16 AM

View PostGravityScore, on 22 July 2013 - 07:49 AM, said:

View PostBlankWolf, on 22 July 2013 - 07:42 AM, said:

Well... I hope I don't nerve, but my question is not answered yet and I wanna know what I'm doing wrong.

It's working for everyone else, so you can't be doing it exactly the same way we are. Maybe try re-downloading a fresh Minecraft, install forge/CC, and try loading the resource pack again, making sure you follow exactly what's described in the install steps for everything.

Thanks for the help. It don't worked but now I know what was wrong.
I used other api's like the color & term api but (thanks to Grim Reaper) my api was loaded BEFOR the color api loads.
So I called functions and values who don't exists.

#53 Ryltarr

  • Members
  • 4 posts

Posted 10 August 2013 - 12:19 PM

What about if I want to bundle a program with the mod for players on a server?

#54 gollark8

  • Members
  • 207 posts

Posted 15 September 2013 - 11:55 AM

View PostRyltarr, on 10 August 2013 - 12:19 PM, said:

What about if I want to bundle a program with the mod for players on a server?
Server textures and resource packs could help.

#55 frostthejack

  • Members
  • 16 posts

Posted 21 October 2013 - 06:22 AM

How has no one mentioned this. Some one used modifying red net as an example. Boot up minecraft place computer type cp ROM/APIs/Redstone Redstone or whatever the api is called then open your save folder find that computer find the api edit it in your ide of choice save back in your save folder it updates instantly then test it makes sure it works if it works make a resource pack plop it in there name it properly so it overwrites the old one and tada you have successfully edited the program without having to reboot until you were completely done with it. Do the same thing for everything you want to edit when they all work properly then place in resource folder and restart game.

You only need to restart once and that's when you have finished editing the programs.

Create yourself a creative world for the soul purpose of fixing your programs it's extremely simple.

Honestly this is the coolest feature ever it has made adding programs to cc idiot proof

#56 awsmazinggenius

  • Members
  • 930 posts
  • LocationCanada

Posted 10 November 2013 - 08:53 PM

Just one question...

Is it possible, by means of an extra file (probably in .mcmeta format) to choose the color of the disk and it's label (say, "awesomness" by awsmazinggenius, just like any label on any other disk?) If not, it would probably work well as a feature as treasure-disk submitters could label their program and choose a color themselves.

Thanks

#57 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 10 November 2013 - 09:48 PM

View Postawsmazinggenius, on 10 November 2013 - 08:53 PM, said:

-snip-
As far as I can tell, the label is the name of the program in the resource pack.

#58 TheWhoAreYouPerson

  • Members
  • 5 posts

Posted 25 December 2013 - 12:56 AM

View PostPharap, on 29 July 2013 - 12:31 AM, said:

View PostNeverCast, on 21 July 2013 - 10:46 PM, said:

You can symlink in all major operating systems, including Windows.
Mklink or Junction ( Vista+, Windows 2000+ respectively )
Do you happen to know the dll and/or function call required to programatically create symlinks in windows?

View Postfrostthejack, on 21 October 2013 - 06:22 AM, said:

How has no one mentioned this. Some one used modifying red net as an example. Boot up minecraft place computer type cp ROM/APIs/Redstone Redstone or whatever the api is called then open your save folder find that computer find the api edit it in your ide of choice save back in your save folder it updates instantly then test it makes sure it works if it works make a resource pack plop it in there name it properly so it overwrites the old one and tada you have successfully edited the program without having to reboot until you were completely done with it. Do the same thing for everything you want to edit when they all work properly then place in resource folder and restart game.

You only need to restart once and that's when you have finished editing the programs.

Create yourself a creative world for the soul purpose of fixing your programs it's extremely simple.

Honestly this is the coolest feature ever it has made adding programs to cc idiot proof

The part where you say "You only need to restart once and that's when you have finished editing the programs." is why everyone is complaining, unless you are used to dealing with problems in big batches, you NEED to edit the file to do a bugfix/change setting then restart minecraft EVERY SINGLE time. Imagine having a 1 billion line long program with one thousand errors in it. You would need to start MC back up one thousand times to squash each and every bug, now would you like to deal with that or would you like to make a quick change in an external IDE, save and run the program again to find the next error (Which is what we are now un-able to do)?

View PostPharap, on 29 July 2013 - 12:31 AM, said:

View PostNeverCast, on 21 July 2013 - 10:46 PM, said:

You can symlink in all major operating systems, including Windows.
Mklink or Junction ( Vista+, Windows 2000+ respectively )
Do you happen to know the dll and/or function call required to programatically create symlinks in windows?
You can do it easily in the command prompt.
MKLINK /D %PathOfFileYouWant% %PathOfFileToSymlink%
Of course replacing the "%PathOfFileYouWant%" with something like "C:\Users\Pharap\AppData\roaming\.minecraft\saves\CCTestin\
computer\4" and replacing %pathOfFileToSymlink% with something like "C:\Users\Pharap\Desktop\MyCustomAPIFolderOrFile".
You would also need to know batch if you want to do extremly fancy things with it (make a symlink for every file/folder at a location to another, etc) but if you want just static links, drop that in a .bat file and your good to go (or the command prompt)

#59 MrChoffe

  • New Members
  • 1 posts

Posted 08 February 2014 - 09:53 AM

(Computercraft version 1.53)

Hello everyone.
This is my first post and I'm new to LUA so please be gentle ;)

I'm starting (sort of) to get a hand of things and I have made my first couple of programs saving them locally in mining turtles labelling the turtle.
Writing code and longer programs is sort of inefficient and I would much rather work in notepad outside of the game and then insert my programs to globally affect all turtles.

I have ready this entire thread and have so far been succesful in adding a program in the modpack.zip and uploaded it to the server overwriting the modpack serverside. This however makes the turtle OS dark (no prompt) and after a server restart the change is brought into the world.
However since I'm new to LUA programming I will be wanting to test the programs frequently and so far my "solution" would require an unmotivated large amounts of server restarts.

In short:
I want to write programs using eg. notepad
I want to move them into the game affecting all turtles (they are able to run them)
Optimally this would not require a server restart for the effect to take place.

Question:
Is there a better way of doing this? I read just a littlebit about pastebin but are unsure about how that link using http: server protocol.
Any help is appreciated :)

Cheers
MrChoffe

#60 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 08 February 2014 - 08:35 PM

Unfortunately, use of your current method (or even correct use of resource packs) is gonna require one restart per edit. It's not an ideal system in that regard.

If you really want to make frequent edits to scripts that are available to all turtles, then what I recommend is this:

Create one script which all turtles can access, set it up as part of a resource pack or whatever. All this script does is grab another script off Pastebin and download it to whichever turtle runs it.

That second script should, if used, download a list of other pastes - one for each of the other scripts you want on your turtles.

So, whenever you place a new turtle, you just run the first installer script to get the second, and the second installer script to get up to date versions of all your other scripts. In this manner you'll never have to do a server restart, as all changes to your code from that point forward go through Pastebin.

Whether or not these "updates" are performed automatically or manually is entirely up to how you wish to code things. Personally I wouldn't want every turtle hammering Pastebin every time they start up. Depends how many scripts you're changing and how often, but I'm sure you'll work out a system to suit you.

In regards to actually using pastebin with ComputerCraft, there's a script included which handles that for you (which is just called "pastebin"). When I want to call it from within my scripts, I tend to do so with shell.run(), eg like so:

shell.run("pastebin","get","<pasteID>","<scriptName>")

Note that it won't automatically overwrite existing scripts - you'll need to make sure old versions are deleted first, if present.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users