I've seen a lot of confused posts around here. Most of you make understandable assumptions about the extensions to Aleph One, Lua and MML. It is pretty easy to find out what each can or can't do by looking at the documentation, which is always included in the Aleph One download (although most Mac users probably only copy the App):

However, many of you probably don't take the time to read the above documentation. Believe me, it's not that complicated; I had no programming experience a year ago, and I picked up Lua and got very far within six months--I had finished AORPG by then and was doing some work on Juggernauts.

For those of you who are still daunted by these extension languages--or just lazy--I'm going to include a few rules of thumb that can help you determine whether or not Lua or MML can make something possible.

Look at MML if you want to...

add substitute graphics or sounds (à la Texture Enhancement Package)

change a lot of defaults that are hard-coded in the engine (gravity, liquid color, strings, map colors, damage flash colors, other stuff)

release a modification that requires download to use (Including new shapes or something like that)--as long as both players are guaranteed to have the MML file. (In other words, you can prevent OOS by ensuring that all players in a multi-player game will have the same version of the MML

As you can see, MML is usually for static, configuration-like changes to the engine, such as those often used to make Total Conversions, etc. Lua, on the other hand, is useful for hacking in-game parameters in a dynamic fashion. Obviously, I haven't covered everything, but you can post here or simply look at the documentation if you really want to know about something. Both languages are still changing, but not neccessarily very quickly. If I encounter a new "rule of thumb," I'll add it here so that everyone can see. I'll try to keep this list up-to-date as well.

Gao, if "instagib" is what I think it is (starting all players with some powerful weapon and ensuring that they die in one hit), it's easy to use a physics file only to make this "mode." Just make the pistol item give the player a super-powerful weapon that will kill in one shot.

Recoil the way I suspect Legacy means it, that is, making the view inch up as the player fires shots, is possible, but shoddy at best. And Legacy, you can't change physics files in-game.

Gao, if "instagib" is what I think it is (starting all players with some powerful weapon and ensuring that they die in one hit), it's easy to use a physics file only to make this "mode." Just make the pistol item give the player a super-powerful weapon that will kill in one shot.

I thought of that first, but then I decided to use lua to let the player choose their beam/gun style. (Like in AORPG, different class, different weapons)

(There'll be Light Blue, Green, Flame, Yellow, Soul, Simulacrum, Poison warhead and BALL!, each beams will have different damage type and appearance, but have SAME AMOUNT of damage.)

Each guns will use SAME kind of ammo, though.

Still in testing...(Forgot to decrease the theta error, forgot to change "alien weapon" contrail back to "lamp breaking" and change the soul to be a missile contrail since grenade was too small.)

Last edited by assassingao on Jun 20th '06, 16:45, edited 1 time in total.

If your weapons are Lua controlled to begin with, then you can actually use Lua to change weapon behavior mid-game. You can use counters to determine values for a weapon, and if you wanted to have these values saved in a saved game, then convert them to Forge parameters. I usually used lights to save booleans, and platforms to save numeric values.

To some degree, recoil can be emulated with Lua. The actual burst count from a gun cannot be altered, but you could have projectiles spawn other projectiles, and then change that value as the level progresses.

While there are limitations, I still think there is much more that can be done with Lua that people have yet to tap into. It requires a lot of creativity to work around the engine restrictions. It's a lot of fun when you get something working.

You can spawn them in a number of ways. You can make the Forge projectile activate immediately, and upon activation, spawn a creature the sends out multiple projectiles (and then change the creature that gets spawned as the level progresses).

You can also spawn a normal projectile on detonation. For example, when Merlin's wand uses the firestorm spell, I could have made the spell more powerful as the level continued by:

A) spawning more fires for each fireball that landed, and extended the life of the fire, and C) actually change the spawned fire creature to another one that emits hotter fire.

I mean that instead of using an invisible immediate projectile to spawn a creature, you can also use a normal projectile. In my example, the fireball is a standard projectile in the game, but for this particular spell, it spawns fire creatures upon detonation.

Is there a way to have the player be interlevel warped from any polygon immediately after finishing the objective?Also, how do I get a monster to warp in only if X happens, like I kill a trooper or something?

Your first request is easy: teleport_player_to_level(player, level). The second is not so easy, because monsters can't normally teleport, unless they've reached a goal polygon or get activated (teleporting out immediately).

The lua guide i found here(http://www.cebix.net/viewcvs/alephone/a ... ml?rev=1.6) is very unclear at some points, and the fact that it contains remarks everywhere makes me think it can be edited somehow. Im wondering, is this possible and how? I think we could spare a lot of double work if everyone that uses the guide helps to extend it. The wiki principle actually... But currently the wiki points at this guide.

You can send patches to me as diffs against the files in CVS, and I'll commit them. Or, you can re-write the guide in Wiki format on s.b.o., and I'll include a printable version in releases.

The first way is less work for me (because CVS version control makes it easier to figure out what Lua and MML is available in what release). The second way might encourage people to help out, or, like the manual, it might go a little ways then die.

Last edited by treellama on Jun 28th '07, 19:03, edited 1 time in total.

Just flipping through the LUA documentation, it seems like there's no trigger for simply checking to see if a switch has been used at all, the only triggers are for players hitting the action key. Why would this be, and/or could there be a trigger for if the switch has been used by anything?