April 16, 2014, 03:59:08 PM
News: Hey, we have forums!
  Pages: [1]
Print
Author Topic: Modding Guide  (Read 14276 times)
Derek
Administrator
Giant Bit
**********
Posts: 242



View Profile Email
« on: December 09, 2007, 10:30:15 PM »

We were originally going to include some documentation with the game itself, but time constraints meant that we didn't get to flesh them out as much as needed to.  But I think they're still very helpful for those starting out, so I put them online.  Just keep in mind that there may be some misinformation in them, since the structure of the mod framework changed a bit right before we release!

http://www.bit-blot.com/aquaria/mods/modguide.html

Once we have more time we'll get some proper docs up.  Maybe a wiki. Afro
Logged
Alec
Administrator
Dream Bit
**********
Posts: 2210



View Profile Email
« Reply #1 on: December 09, 2007, 10:45:29 PM »

Some warnings

  • Don't go to animation editor, or particle viewer unless you've saved your map. You'll lose your last changes otherwise.
  • Deleting objects that are "in use" can cause a crash. (e.g. if you delete a rock that Naija has cast the bind song on)

I'll post some more of these when I remember them.  Roll Eyes
Logged

deb
Mini Bit
**
Posts: 7


View Profile
« Reply #2 on: March 03, 2008, 02:23:05 PM »

I am a newbie at modding and Lua although I have programming experience. I would like to writeLua scripts for Aquaria modding. How do I go about it? I mean do I need to donwload just the simple Lua library for Windows or do I need to have some C/C++ compiler? In other words what kind of tools do I need to write scripts in Lua and produce aquaria mods? Any pointers would be appreciated

deb
Logged
Alec
Administrator
Dream Bit
**********
Posts: 2210



View Profile Email
« Reply #3 on: March 03, 2008, 02:26:28 PM »

Hi Deb, welcome to the forums!

You just need a text editor to edit lua scripts. I recommend Notepad++.

Scripting works kinda like... you edit the files, then reload the level. You don't need to compile them. Smiley
Logged

deb
Mini Bit
**
Posts: 7


View Profile
« Reply #4 on: March 03, 2008, 03:03:25 PM »

Thanks Alec. I assume this means that the level editor that comes with the game has the Lua interpreter then?

deb
Logged
Alec
Administrator
Dream Bit
**********
Posts: 2210



View Profile Email
« Reply #5 on: March 03, 2008, 04:13:20 PM »

The game interprets the scripts, yep.
Logged

Aërendyll
Extra Bit
*****
Posts: 109

Love hurts


View Profile WWW
« Reply #6 on: March 11, 2008, 01:14:46 PM »

I'm kind of wondering: are there specific tutorials about creating Forms, Songs and Recipes for people who are very new to scripting and who are still practising? I am a scripting newbie myself and I can do a little programming, but I get confused when I need to type out large amounts of codes. (These tutorials could also be snippets of codes that are explained per snippet on what they do and where to place them. )
Logged

Just when we thought we've seen everything...
Malidictus
Bit
***
Posts: 22


View Profile Email
« Reply #7 on: March 22, 2010, 05:47:26 PM »

I realise this is, what... Over two years old? But it's still a bit disheartening even two years down the line Smiley I first heard of Lua when a friend of mine asked me to research WoW macros, and from what I hear it's a proper programming language. That's good on one hand, as it ought to allow modders great control over the game. On the other hand, I'm really not up to learning yet another programming language at this time. They just take far too much time to truly grasp, and I just know it'd bug me to know be fully aware of the whole process.

I was interested in what the process was, and the tutorial mod does do a pretty good job of explaining it, actually, but towards the end, it's actually pretty skinny on the finer details of active objects. I assumed that the game interprets their names as function calls with their parameters, but not knowing what the functions are kind of kills me. And even if I did, I was impressed by the conversation menus someone had made for a mod (I think it was Sacrifice, but I'm not sure), and I just KNOW those can't be made to work with just basic knowledge.

I guess I'll stick to replaying the game itself Smiley
Logged
Yogoda
Extra Bit
*****
Posts: 144



View Profile Email
« Reply #8 on: March 22, 2010, 07:00:26 PM »

Really, lua is easy to learn. You just need to know how to do the basics : function calls, conditions, loops, nothing more.

Here is the modding Wiki, you have all explained here. If there is something you want to be added, just ask  Wink !
http://aquariawiki.ryanballantyne.name/wiki/index.php/Main_Page

What takes time however, is learning the functions. You can start with the list of the most used functions here :
http://aquariawiki.ryanballantyne.name/wiki/index.php/Most_used_functions

I see you have trouble scripting the nodes, here is probably what you are looking for :
http://aquariawiki.ryanballantyne.name/wiki/index.php/Create_a_trigger_node

Here are all the callback functions for nodes and entities :
http://aquariawiki.ryanballantyne.name/wiki/index.php/Callback_Functions

I put a lot of time and effort to try to make it easier for people wanting to learn the scripting, but I realize there is something wrong.

You can help us make things better ! Tell me what we should change to makes it easier Wink Was it easy to find the modding Wiki ? Maybe I should write a tutorial explaining the basics of Lua too.

I can assure you, scripting basic things like trigger nodes is not hard. But don't try to create a new GUI now, start with easy things. If you have a problem, ask, we are always available for help.
« Last Edit: March 22, 2010, 08:29:39 PM by Yogoda » Logged
Yogoda
Extra Bit
*****
Posts: 144



View Profile Email
« Reply #9 on: March 22, 2010, 08:30:40 PM »

Ok, here it is :

http://aquariawiki.ryanballantyne.name/wiki/index.php/Learn_Lua

It won't take you more than 15 minutes to learn all you need to know with Lua Wink
Logged
Malidictus
Bit
***
Posts: 22


View Profile Email
« Reply #10 on: March 22, 2010, 09:05:03 PM »

Ok, here it is :

http://aquariawiki.ryanballantyne.name/wiki/index.php/Learn_Lua

It won't take you more than 15 minutes to learn all you need to know with Lua Wink

So, basically I'm looking at an object-oriented structure with each script being its own object? From what I can see, it looks like you have a constructor defined as init that gets auto-called on creation (I'm guessing here) and an update function that's basically what the entity does constantly. Can I write other functions into it? Can other objects call them, or is it strictly on an object-per-object basis?

If this is the Lua language, then it actually reminds me of Java, but with Perl's non-specific variable definitions, which is always something that bugged me in Perl. Since I can't enforce variable type, a few functions will either refuse to work or be prone to returning unpredictable results.

Also the function of the, err... Specific functions is a bit hard to follow, though that's probably just me not knowing which way the bolt turns. For instance, I see a function described as "entity_velx(ent)," and I'm not sure what that does. From the name, I can assume it returns the entity's horizontal velocity to be used for physics calculations, but even then I'm not sure what "ent" is in terms of data type. Since the function requires a variable to call it, I'm assuming I have to specify it? Can I just nest... Let's see what that was... Can I nest, say, getNaija() in it for a total of entity_velx(getNaija())? I'm assuming the get function would return a pointer for the entity function to use, but again, I'm guessing over not much background.

See, if I can wrap my head around the architecture used to hold things together in Aquaria, I'll probably be able to put something together, but again, that's a LOT to take in. It doesn't seem like a lot, and it probably isn't too much in terms of raw information, but it's actually a lot to process, because it is... Well, fairly serious programming. As... Serious as you want to make it, undoubtedly, but I like to know the systems I use.

P.S.
In the Learning Lua article, it seems a bit... Mean to leave people guessing what the given code block would do Smiley In my experience, especially for illustrative examples, it pays to explain the actual function step by step. I... Think I can sort of follow the steps with a LOT of guessing on my part, but I'm still largely in the dark, and there is no Light Form in sight! Smiley
Logged
Yogoda
Extra Bit
*****
Posts: 144



View Profile Email
« Reply #11 on: March 23, 2010, 07:21:48 AM »

It seems to me you want to go too much into the details.

The core game is written in C++, Lua is used because it removes all the layers of complexity, and make it much more easier and faster to define the entities and nodes behavior, and removes the needed to compile. Under the scene you have of course C++ objects, and constructors.

The lua files are loaded when the C++ objects are constructed, and the lua callback functions are called at specific places. I guess the init(me) is called at the end of the constructor, and the me is in fact a pointer to the C++ object.

When you call a function, for example entity_velx(me), it calls a C++ method on the object me

But again, you really don't need to know all the complexity that is behind. A Lua script is not an object, and has no constructor, it is not object oriented.

Here is the detailed list of all the functions :
http://aquariawiki.ryanballantyne.name/wiki/index.php/Category:Functions

The functions that apply on a entity have the prefix entity_
Those that apply on nodes have the prefix node_
And so on.

In the Learning Lua article, it seems a bit... Mean to leave people guessing what the given code block would do Smiley In my experience, especially for illustrative examples, it pays to explain the actual function step by step. I... Think I can sort of follow the steps with a LOT of guessing on my part, but I'm still largely in the dark, and there is no Light Form in sight! Smiley

Well, this is an example to try ingame. I think if you see Naija turn blue then transparent you have no problem guessing what entity_color(n, 0, 0, 1) and entity_alpha(n, 0.2) do. You learn a lot by trying to guess things by yourself, and most of the functions are documented anyway.
« Last Edit: March 23, 2010, 07:46:22 AM by Yogoda » Logged
Malidictus
Bit
***
Posts: 22


View Profile Email
« Reply #12 on: March 23, 2010, 01:16:34 PM »

Right. I apologise for muddying the waters, as it were. It's just that education and work responsibilities have taken me through half a dozen programming languages (some more involved than others), to the point where I can't help but see things as "Ah, so this is like that in this language, but that's like the other thing in that other language." I've actually spent the most time on C++ and Java of all the languages I know, which is why I tend to see most things in an object-oriented context, whether that context actually exists or not. That's kind of why I say I need some time to wrap my head around Lua itself and the setup of the functions as defined.

For what it's worth, I'm GLAD I don't have to deal with object-oriented programming in C++. Work with pointers there is just opaque. But that just means that I know practically nothing coming in, since I'm starting with preconceived notions which seem to either be wrong or not apply as I think they should, and it will take me a while to work it out. I do appreciate the help with this, and your patience. At first glance, it looks like too much to learn with what free time I have, but I don't know. I just might end up going for it. After all, there's no telling when I might need to know Lua in the future. This is the second time it's come up for me so far, after all. (Just between you and me, I'm not a fan of the Pascal-style block definition with "END" tags. I much preferred curly brackets.)

So, yeah. Looking through the system definitions is probably my priority for the moment. I did miss that link with all the functions, so that will be a good place to start.
Logged
Dolphin's Cry
Bit Bit
****
Posts: 61


View Profile
« Reply #13 on: May 30, 2010, 07:50:09 PM »

If you want to compare Lua with other programming language, it would probably go like this: Lua is very similar to Scheme, but with less parentheses and with (associative) tables instead of lists. Both have lexical scoping (i.e. closures), are dynamically type-safe (i.e. variables do not have types but all values do), and are relatively easy to learn (i.e. just a few simple concepts). The types in Lua are Nil, Booleans, strings, numbers, tables, functions, coroutines and user objects. User objects can only be created from C/C++ and are used to implement user-defined types.

Lua is not object-oriented as-is, but provides mechanisms that allow the implementation of object systems in the language itself. Then again, the Lua scripts in Aquaria do not make use of that. I have seen people have problems understanding Lua because they tried to compare it to C++ and Java too much.

As far as the types of application-specific objects in Aquaria go, there are entities and nodes. There are functions that return a reference to one of these types. They return 0 (the number zero) to indicate that a requested object does not exist. A more natural choice would have been to make those functions return nil in that case, but that's how things are. I would recommend to not make any assumptions about the Lua type of references to valid objects. Just don't pass in a node reference where an entity reference is required, or vice versa.

For more information about Lua itself, I would recommend the Lua Reference Manual or the book Programming in Lua. Especially the latter is nice to read, quite unlike "The Programming Language C++" by Bjarne Stroustrup which I would not recommend to just anyone.
Logged

Can you hear the dolphin's cry?
Michaelmype
Bit
***
Posts: 23

184188325 michaelet43@hotmail.com
View Profile
« Reply #14 on: April 05, 2014, 09:12:49 AM »

Wisconsin Gov. Scott Walker vetoed a budget provision that would have banned the nonprofit news organization from working in its offices on the Madison campus and forbid university employees, including journalism school instructors, from working with it.  cheap ray bans   In order to avoid any of these pitfalls, you should be sure to buy shoes that have plenty of ventilation for your feet. You will be able to spot this easily enough. Properly ventilated shoes will have little mesh windows surrounding all sides of each shoe. These allow your feet to breathe and remain cool throughout all of your workout sessions. If you are not convinced, try an unventilated shoe with one that is fully ventilated and compare the difference after your workout. The difference is quite clear.锘縏he Importance Of Wearing Decent Clothing  ran ban wayfarer  "Marathon County is ranked number one for the amount of radon gas in the homes in the state," said Sara Brown, a radon specialist with the Marathon County Health Department. "It's because of geological formations beneath the ground, all of the granite that we have creates the radon gas and there's a lot of uranium in the granite."  chanel replica  The events surrounding that tragic day, May 7, 1990, ultimately set Cynthia on a journey to discover who she was and for what purpose she was on this earth. In short, it brought about a spiritual awakening. Cynthia recounts this amazing journey in her recently published book, Searching for the Open Door: A Womans Struggle for Survival After a Traumatic Brain Injury. When people experience any kind of misfortune, devastating disease, or loss, it is not unusual for them to end up bitter and angry. Cynthia, too, continued to be bitter and angry for years. Then, one Sunday, about a year after her release from Magee Rehabilitation Hospital, Cynthia attended a church in San Antonio, Texas where the pastor delivered a sermon about a shepherd and one sheep that was always running off into the woods, getting lost or otherwise getting into mischief. After several failed attempts at discipline, the shepherd finally broke the sheeps legs and then carried him on his back until the sheeps legs healed. From that moment forward, the sheep never strayed far from his masters side. That sermon really spoke to Cynthia, because, in many respects, the story of that sheep was, from Cynthias standpoint, her story.  chanel replica  "Corretta" properly identified the cause of the issue, she simply didn't recognize the "root cause". A man protecting himself from being assaulted simply isn't that root. The sooner the black community repudiates their hatebaiters, the sooner the black community focuses their children on the wonders of Americas' exceptionalism, on the unparallel opportunities that abound for them; the sooner American children will stop idolizing the thuglife, and the sooner those children will begin to live longer lives.锘縅acksonville tops in cheap party pads near EverBank Field  chanel replica  In addition, your business structure will also affect the taxes for which you may be liable, and a solid bakery business plan will help you to better plan for those taxes, and keep them at a minimum.  hermes replica  But neglected teeth can lead to a mouthful of problems. So on Friday the going rate for a seat in the dentist's chair at will be free. No strings attached. on Feb. 18 at their dentistry office in Ryders Lane shopping plaza.  hermes sale outlet  She said approximately 500 families receive financial assistance per year, but donations vary from year to year.  cheap ray bans  Today's most readToday's most commented  replica hermes  Next year, McCall is thinking about doing a Predatorthemed game, based on the dreadlocked humanhunting aliens first seem in the 1987 Arnold Schwarzenegger film.锘緼rchitect Works To Make Traditional Touches Affordable  replica hermes  That move, led by Contador's SaxoTinkoff squad, raised further questions over the strength of Froome's supporting cast at the Tour as injury and elimination have hit Team Sky, and this morning Froome told Sky News he was regretting the absence of last year's winner Sir Bradley Wiggins through injury.  hermes replica  This game was added to the Wii's bestseller collection. You can score it for a mere $20 at the moment and if you missed out, it's definitely worth the score.  cheap ray ban aviators  9. Show your prospects a sample page out of your ebook. Just black out some of the important info. This will make your prospects curious to buy.  cheap michael kors  Town of Madison Fire Chief Dave Bloom says it's actually pretty cheap protection when you consider the consequences. Carbon monoxide is called the silent killer because it's an odorless, tasteless gas that's highly toxic. This material may not be published, broadcast, rewritten or redistributed.锘緾arbon tax smells like amalgamation  karen millen dresses  Now through the efforts of newly installed President Paul Vallone, the Lions are in the process of a comeback. The Lions International is the world largest service organization, with more than 1.35 million members in 206 countries in the world. I was so impressed I signed up and became a charter member. If you are interested in joining, they will not meet again until the first Wednesday in September, as there are no meetings in July and August.  cheap ray ban aviators  Short wedding dresses have been gaining po rity and favor among the modern generations They are not only economical but they are also comfortable and convenient They are the most sought after wedding dress styles across the globe for a variety of reasons One of the most important reasons is that they are convenient and comfortable They can also be customized according to the theme and location of the wedding They can also be worn on other occasions too fit for hot or humid weather 
 
http://ptnote.acosys.dk/activity/p/4801/
http://www.doctorflix.com/node/409589
http://tcoclub.net/thread-292869-1-1.html
http://keyworddissection.com/forum/viewtopic.php?f=14&t=39543
http://myurlmark.com/node/4#comment-493432
Logged

  Pages: [1]
Print
Jump to: