Bit Blot Forum

Aquaria => Modding => Topic started by: Hiro on October 20, 2008, 09:38:03 am

Title: Big Energy-Form Battle
Post by: Hiro on October 20, 2008, 09:38:03 am
Note: due to a mistake by me the 1.2 version was not readily playable. If you downloaded it please get the 1.2.1 version available now.

Sweet. Since I had today off and not that many mods for aquaria have been released, and I got aquaria back onto this computer (thanks Alec) I thought I'd have a go at setting an example for modding. Just a simple idea really, you start as naija, forced into energy form and in an arena filled with tons of bad guys. :D And its all done with resources that come with Aquaria.
Have fun trying to duke it out. This is really challenging. Its possible, but even I have some troubles and I know where all the enemies are. xD
It still needs tweaking. Probably needs more health lying around to keep you going. But it shouldn't be made too easy, this mod is purely battle and its supposed to test your reflexes and stuff.
Hopefully you guys like it. And even more hopefully maybe someone will be inspired to make something similar? Mods don't have to be huge or have storyline or something..
Maybe you could try making something similar but testing a different form's abilities.
My thanks go out to many people. Basicly, all the people that have been involved with aquaria modding. I used The Bear's maps as a basis for this mod to get all the tile and entity sets. The aquaria wiki was great help with the tutorials on how to do things. I used some scripting from Dolphin's Cry from the 'Form Trials' topic which is also partly where the idea from this mod came.
Etc., lots of sources helped me, so thank you all.

---------[EDIT]----------
Alright! I got Nautilus Prime working by looking through some of the script that makes her work. She shouldn't fly off the map now, she shouldn't change the music, she shouldn't stop the music when she dies and she shouldn't try to creat a map token anymore.  ;D Another big thanks to Dolphin for pointing out that script.
I've also tweaked the map a bit, the left side is now easier than the right (less enemies) so the difficulty is more progressive. I also wanted to make it a bit easier for a wider audience so I've added a bit more health lying around in more places.
To spice things up I put in some currents that go around. Not strong, you can go against them but it does make dodging harder if you try to fight the current too. *Evil laughter*  >:D This should make it interesting to try again even if you played the old version.
Also of note is that there are a few more enemies of different types. Sword fish and stuff. Those swordfish are actually pretty intense to watch out. :D
See below for the new download link. Its on box.net this time not freewebs so hopefully no one will need a mirror. Although I'd be honoured if you'd supply one again Alec.
Been a (actually quite educational) pleasure making this. Enjoy. :)

---------[EDIT2]----------
- I removed a fair bit of health from the map. It still seems too easy actually, but meh.
- I increased the health of the anglerfish at the bottom from 32 to 50. Makes him more like a real boss (although still much easier than the blaster (100 health   ) or NP, who can block your shots (but only has 40 health)). And to further enhance the 'boss' feel of the anglerfish, I gave him a camera lock on death, similar to what the big blaster and NP have (although for some reason I couldn't make Naija invincible while the camera was locked, even when I copied how its done in the other scripts...but I think its ok to be vulnerable for 1.3 seconds xD and I didn't force Naija to be idle in that time either  ).
- The big blaster's death scene will no longer try to make you look at her egg (a.k.a. (0,0) lol) so you no longer have to look at blackness for 2 seconds after killing her.
- And the real star update: As you play you will see your time in the bottom right, and your final time score will be displayed when you have killed everything (note: this includes Ekkrit at least for now). [Ekkrit can now live!] This awesome piece of script courtesy of Edwards.  :)
Let us know your best times!  ;D

My time with a live Ekkrit: 8:54.

NEW Download version 1.2.1: http://www.box.net/shared/jzb810nzfq
Version 1.2.1 mirror: http://rapidshare.com/files/272439864/Big_Energy_Battle_121.rar
Version 1.1: http://www.box.net/shared/17afvqub34
Version 1.0 [Thanks Alec]: http://zaphire.ca/AQ/big-energy-battle.rar
Title: Re: Big Energy-Form Battle
Post by: Xiagan on October 20, 2008, 10:13:22 am
Will try it as soon as I managed Aquaria to run under wine. :)
Title: Re: Big Energy-Form Battle
Post by: inkblob on October 21, 2008, 03:30:37 am
I'm going to check this out hopefully tonight Hiro  :)  sounds intriguing!
Title: Re: Big Energy-Form Battle
Post by: Hiro on October 21, 2008, 05:24:27 am
Awesome. Looking forward to the feedback. :)
Title: Re: Big Energy-Form Battle
Post by: Danger Mouse on October 21, 2008, 06:28:29 pm
Bummer! I really wanted to try this out, but when I click the link I get a restricted message. Freewebs is a banned domain from here. :/ maybe you can email it to me. :)
Title: Re: Big Energy-Form Battle
Post by: Alec on October 21, 2008, 09:43:45 pm
Mirror: http://zaphire.ca/AQ/big-energy-battle.rar

I haven't tried it yet though!
Title: Re: Big Energy-Form Battle
Post by: rinkuhero on October 21, 2008, 11:34:14 pm
This is a nice idea, I'll try it soon.
Title: Re: Big Energy-Form Battle
Post by: Hiro on October 22, 2008, 05:30:21 am
Awesome, thanks for that Alec, added to the top post.  ^-^

Any ideas for making NP work?
Title: Re: Big Energy-Form Battle
Post by: Danger Mouse on October 22, 2008, 11:19:01 am
Thanks for the mirror link Alec!! :)
Title: Re: Big Energy-Form Battle
Post by: silverflagon on October 23, 2008, 04:40:01 pm
I have been looking in on this post for a while and the mod sounds like it's great fun, but I wonder how fast I would die playing it lol
Title: Re: Big Energy-Form Battle
Post by: Danger Mouse on October 23, 2008, 06:26:48 pm
I've been able to download it thanks to Alec, but I have yet to transfer it to my computer to test it. I'm not expecting any new modding content, but it does sound like a fun little addon, I wouldn't go as far as saying it's a mod though.
Title: Re: Big Energy-Form Battle
Post by: Hiro on October 24, 2008, 05:18:10 am
Lol. Its just an arena map. ;) But it works under the modding section.

And BTW, I made this thing so I can remember pretty much where everything is, and it still takes me quite a while to finally beat up everything with some close calls, that is assuming I survive. :X
Title: Re: Big Energy-Form Battle
Post by: Danger Mouse on October 25, 2008, 06:21:31 am
Yeah, it took me 4 tries to kill everything without dying! It wouldn't have been that hard at all if there weren't things that poisoned you. That was my cause of death on the first 3 tries. Grr. :/
Title: Re: Big Energy-Form Battle
Post by: Hiro on October 27, 2008, 06:31:46 am
:D

They are the killer eh? Its 'cos the poison just doesn't go away for ages.

Good work getting it in four tries though. :) I thought it might be too hard to complete properly.

Did NP bug out with you too?
Title: Re: Big Energy-Form Battle
Post by: Danger Mouse on October 27, 2008, 02:31:22 pm
No, it worked, I killed it, but after I killed it and everything else I hit TAB to check out if there was anything I missed, secrets and stuff, and sure enough there was NP up in the top left most corner of the map in a non existent  area of the map. I have some awesome areas in my mod The Lost Treasures that are just insanely tough without certain forms, and I could probably transform those ideas into a small arena type map like you have done and release it. I liked how you included the script stuff for forcing a specific form. It will come in handy for making different modifications/addons. kudos Make more. :) Maybe with some other scripting goodies. :)
Title: Re:...
Post by: Jonas on November 24, 2008, 03:14:22 pm
I tried it, I liked it, but couldn't finish it due to the aformentioned bug with Nautilus Prime escaping at break-neck velocity to the upper left corner. The process was made easier by exploiting that if you look with the middle mouse button you can fire at enemies far away without them taking any form of action against you.

Still; good fun!
Title: Re: Big Energy-Form Battle
Post by: silverflagon on November 24, 2008, 09:49:54 pm
I've tried it once so far and I got killed very quickly lol
Title: Re: Big Energy-Form Battle
Post by: Dolphin's Cry on November 25, 2008, 09:44:49 pm
Nice mod, I had some time to check it out at the weekend. It's been so long since I had played some Aquaria... :)

Regarding Nautilus Prime: Her script needs a node called "NAUTILUSPRIME_LEAVEAREA". See the copy of nautilusprime.lua in guert_mod/scripts for details, especially lines 139 to 150:
Code: [Select]
if leaveDelay== 0 and not node_isEntityIn(leaveArea, getNaija()) then
updateMusic()
overrideZoom(0, 1)
bone_alpha(eye, 0)
entity_setPosition(me, node_x(leaveArea), node_y(leaveArea), 2) -- IMPORTANT PART
entity_setTarget(me, 0)
entity_rotate(me, 0, 10)
entity_clearVel(me)
entity_heal(me, 10)
debugLog("nautilusPrime heals 10")
return
end
Can you guess what happens when leaveArea is 0 (zero, i.e. not present)? ;)
Title: Re: Big Energy-Form Battle
Post by: Hiro on November 25, 2008, 10:18:01 pm
Eheheh.. So I'd have to change that somehow...
I have a tiny bit of understanding for some of this script stuff but I don't actually understand all of whats there..
It seems to be whats called when you get near NP I think.
I think...I have to make a node of type "NAUTILUSPRIME_LEAVEAREA" and make it the size of the area I want her to stay in is that right? xD I'll try it. Thanks for that very much Dolphin.  :-*

And DM, I didn't actually make that script for forcing a form, I just found it posted on these forums. xD But thanks all the same. I'd love to play someone else's arenas. :D

And Jonas, wow good idea man. I didn't even think of that. xD

[EDIT]
WOOHOO!!! I got it working. I was confused at first, and I didn't know what was going on. I thought that the leave area was the place where NP could go. Its actually the place where if Naija leaves, NP goes back to her start place (the co-ordinates of the leaveArea node) and heals. So I've made an empty node with the right name filling the entire area of the map and now its working properly! :D
I've stopped NP overriding the music, now I just need to keep the music playing after she dies (she stops the music when she dies).
Thank you very much Dolphin and everyone else!
Title: Re: Big Energy-Form Battle
Post by: Dolphin's Cry on November 27, 2008, 09:30:06 pm
Sorry for not spelling out what the leaveArea was for. I was in a bit of a hurry and hoped you'd be able to work it by yourself. And you did. ;)
Title: Re: Big Energy-Form Battle
Post by: Alec on November 27, 2008, 10:50:10 pm
This is really cool! (finally played it today)

Looking forward to the improved version as well. Once its done, we'll have to feature it on the main page.  ^-^
Title: Re: Big Energy-Form Battle
Post by: Hiro on November 28, 2008, 03:10:47 am
Oooo.. never thought I'd make the front page.  :o

I'll have to make a better picture for it.. and maybe tone it down a bit. At the moment its really a bit too hard.
I might try making a door too..

[EDIT]
Ok, scratched the door idea. Its pretty cool just being thrown in there.  ^-^ Although I did make the immediate area a bit more accomodating so you shouldn't be struggling straight off.
I also put in some circulating currents to make it more interesting.

Have a go. It might need more tweeks but it should at least be possible. I put in quite a bit extra health plants to use.
See first post for more details and the new download link. (Is box.net ok with everyone?)
Title: Re: Big Energy-Form Battle
Post by: Chibi on November 28, 2008, 06:52:25 am
Box.net is ok if it doesn't require signing up and is free  8) Too much of the media on this forum is off access because it requires a pricy signup.
Title: Re: Big Energy-Form Battle
Post by: Hiro on November 29, 2008, 10:37:07 am
Ow. I havn't seen anything like that here...
Box.net is free, and seems to have quite a good, fairly easy to use system so its a good choice if you need hosting I think.
And you certainly don't have to sign up to download the file.  O0
Title: Re: Big Energy-Form Battle
Post by: Chibi on November 29, 2008, 05:03:54 pm
Great to hear.  :) I've seen more sign up download websites than costly ones.

[EDIT]: Hiro, you are a born and raised sadist. Your mod is the work of the devil! *crosses self*  ;D That is a really smooth mod - I really enjoyed it even though I died in thirty seconds. My kudos to you and whoever is dexterous enough to finish your mod. Great job man! [flash=200,200] :)
Title: Re: Big Energy-Form Battle
Post by: Hiro on December 17, 2008, 12:16:26 pm
Haha, thanks man. Glad to know you liked it.

Yeah I didn't make it easy since the whole point of the mod is that its an epic battle arena, so it'd be boring if you could do it first try right? *Evil laughter*
I'm sure you can do it, if you try a few times. Heh, it even took me a few tries to be able to do it legitamately, and I made the stupid thing. >.>
My only advice is, try to take it slow. If you charge in and speed past everything shooting madly you'll only end up with a massive hoard chasing you. Better to consolidate territory...or something like that. xD
Good luck.
Title: Re: Big Energy-Form Battle
Post by: Edwards on December 28, 2008, 02:51:42 am
Nice little challenge, particularly on my second run-through when I lured the entire bottom half of the map into that little room on the right (now that's a lesson in evasion and careful use of health plants!).  I really like the currents- they make it just enough harder to maneuver that you need to think about directions, but it's still possible to outrun something by going upstream.  My personal opinion is that the current version has way too many health recharges, but judging from the other comments here, I'm in the minority (I rather like the health density in the old version :P).

Overall, great job!  I really enjoyed the mod.

- Edwards
Title: Re: Big Energy-Form Battle
Post by: Hiro on January 03, 2009, 01:54:42 pm
Thanks man.  ;D
Yeah, I figured that this one was a bit too easy too. But then I made it so I thought others might not think the same. xD
Nice going getting all those melee dudes in one spot too. That would be so hardcore.   O0
If you want a real challenge try: loading the mod, pressing tab to get the editor menu, going into entity edit mode and deleting all the health plants.
Muahahahahahaa!  >:D
Title: Re: Big Energy-Form Battle
Post by: Danger Mouse on January 03, 2009, 11:19:07 pm
                                       :D
                                                                                      :o
;D  Vote: Bigger Energy-Form Battle, or Big "Other"-Form Battle.   ;D
                                ::)
                                                                     :P
Title: Re: Big Energy-Form Battle
Post by: Hiro on January 04, 2009, 01:58:56 am
Hah, maybe maybe. Although I wouldn't mind if someone else had a go at making one of those, surely some of the new guys have some ideas? :D
Title: Re: Big Energy-Form Battle
Post by: Danger Mouse on January 04, 2009, 02:50:13 am
Hmm, we should make one in the style of zelda, where you have to kill all the creatures in a room to open the door to the next room. :)
Title: Re: Big Energy-Form Battle
Post by: Edwards on January 04, 2009, 05:44:44 am
Hmm, we should make one in the style of zelda, where you have to kill all the creatures in a room to open the door to the next room. :)
For that matter, do rooms like that for each of the forms.  The only one I can't work out a good mechanism for right off-hand is Fish Form, although Spirit Form would be a royal pain to get the coordination right on, and the Shield song would probably work better as a straight-up marksmanship test.

I leave it as an exercise for the reader to work out what these methods of killing things are. :P

If you want a real challenge try: loading the mod, pressing tab to get the editor menu, going into entity edit mode and deleting all the health plants.
Muahahahahahaa!  >:D
Yeah, that does make it a bit more interesting- with the health plants gone you need to really pay attention to which enemies drop health. :P  I haven't yet managed to beat it without picking up any health boosts, though.

One interesting thing I've noticed, playing through this map, is that once you've beaten it a few times, you gain the ability to swim through dense swarms of projectiles without hitting any of them, even if the gaps between them look far to small to allow you to pass.  I'm not sure I'll ever use the shield song again... :o

- Edwards
Title: Re: Big Energy-Form Battle
Post by: Xiagan on January 04, 2009, 10:48:57 am
Great idea!

You can use the swamp cake in fish form to slowly kill enemies. :D
Title: Re: Big Energy-Form Battle
Post by: Stalfos on January 04, 2009, 03:19:53 pm
Played it yesterday for the first time, and enjoyed it! I noticed that if you don't rush in... it is much easier!

There should be a timer for scoring points depending on the time you take...
Title: Re: Big Energy-Form Battle
Post by: Hiro on January 05, 2009, 04:27:15 am
Haha, yup, thats it right there. Not rushing in is the best technique I've heard of to beat the arena without being slammed.

As for adding a timer and stuff... Thats getting into scripting. I might possibly be able to do it by looking at the arnassi race scripts and stuff but at the moment I'm feeling really lazy so I wont be doing it.  :-X
Anyone who wants to tweak this or anything feel free though, I'm not holding onto any copyrights or anything.  ::) (Although, you know, a mention would be nice ;) )
Title: Re: Big Energy-Form Battle
Post by: Edwards on January 05, 2009, 09:01:22 am
As for adding a timer and stuff... Thats getting into scripting. I might possibly be able to do it by looking at the arnassi race scripts and stuff but at the moment I'm feeling really lazy so I wont be doing it.  :-X
Anyone who wants to tweak this or anything feel free though, I'm not holding onto any copyrights or anything.  ::) (Although, you know, a mention would be nice ;) )
Ask, and ye shall receive.  I rather like the scripting end of mod-making, and this made a nice break from bashing my head into a wall over "features" in dofile() and the animation editor.  Just put this code in a new lua file named timerbeast.lua, add timerbeast to entities.txt, and add a timerbeast to the level (note: it will be invisible, so be careful to only create one).  It will keep track of the time, and when all the enemies are destroyed, it will display the final time for a few seconds, and then exit to the main menu.

- Edwards

Code: [Select]
--[[
A relatively simple entity that will track whether there are any enemies
left in the Big Energy Battle map.  Note that should you want to use this
in a different map, you will need to delete or modify the if statements
that check whether the four bosses in the map exist.

Script by Edwards]]--
dofile("scripts/entities/entityinclude.lua")

timer = 0
ekkritdead = false
nautprimedead = false
blasterdead = false
anglerdead = false
winner = false
won = false

function init(me)
n = getNaija()
entity_setPosition(me, entity_x(n), entity_y(n))
setupEntity(me)
entity_alpha(me, 0)
entity_setType(me, ET_NEUTRAL)
end

function postInit(me)
--Display the timer
setTimerTextAlpha(1, 1)

--Failsafe in case multiple copies of the entity exist
local e = getFirstEntity()
while e ~= 0 do
if e ~= me and entity_isName(e, entity_getName(me)) then
entity_msg(e, "suicide")
end
e = getNextEntity()
end
end

function update(me, dt)
--Keep the entity on top of Naija, as an easy way to make sure it never goes out of culling distance.
x,y = entity_getPosition(n)
entity_setPosition(me, x, y)

--Short-circuit test to see if the player has killed the bosses.
--Yes, the game's really fast at executing scripts, but I still want to put as light
-- a load as possible on the script engine.
if nautprimedead or entity_getNearestEntity(me, "nautilusprime") == 0 then
nautprimedead = true
if blasterdead or entity_getNearestEntity(me, "bigblaster") == 0 then
blasterdead = true
if anglerdead or entity_getNearestEntity(me, "anglerfish") == 0 then
anglerdead = true
if ekkritdead or entity_getNearestEntity(me, "ekkrit") == 0 then
--The following code is a test to see whether any of the entities in the level are enemies.
local bad = false
local testEnt = getFirstEntity()
--local i = 0
while testEnt ~= 0 do
if entity_getEntityType(testEnt) == ET_ENEMY then
bad = true
--i = i + 1
--local xe,ye = entity_getPosition(testEnt)
end
testEnt = getNextEntity()
end
--xe = xe - x
--ye = ye - y
--setControlHint(string.format("%d entities exist!  Timer = %d  BadEntLoc = %d,%d", i, timer, xe,ye), 0, 0, 0, 1)
if not bad then winner = true end
end
end
end
end

-- Check if the player has won, otherwise increment the timer
if not won then
if winner then
won = true
--Generate the congratulatory text and time display
setTimerTextAlpha(0, 1)
mins = math.floor(timer/60)
secs = timer - (mins*60)
secs1 = math.floor(secs/10)
secs2 = secs - (secs1*10)
centerText(string.format("Congratulations!  Time: %d:%d%d", mins, secs1, secs2))

--Exit to main menu
wait(3)
watch(0.1)
fadeOutMusic(2)
toggleCursor(false)
fade(1, 3, 0, 0, 0)
watch(3)
watch(0.5)
goToTitle()
else
timer = timer + dt
setTimerText(timer)
end
end
end

--Failsafe in case extra copies were created
function msg(me, msg)
if msg == "suicide" then
entity_delete(me)
end
end
Title: Re: Big Energy-Form Battle
Post by: Hiro on January 05, 2009, 11:26:56 am
Like, wow dude, that was really fast.  8) You're awesome.
Time to add it, test it out, and re-upload.  ^-^

EDIT:
Dude, that is so awesome. It doesn't only tell you the time at the end, it has the time in the bottom right and everything.
My only gripe, if I can even call it that, is that the player has to kill that poor lost Ekkrit creature I put in there. I can't however find a way to let him live with this script.  :-\ Even if I remove all references to him he still has to die for the end to take effect... I think it might be because he is counted as an enemy? That would mean that he must die for the all-enemies-dead trigger too. Not sure how to change that... Oh well, I'll just leave him dying in for now at least.  ::)
I did make the wait at the end (the first line where its exiting to main menu) 5 rather than 3, just a little longer to check your score.  ;)

Oh, other updates:
- I removed a fair bit of health from the map. It still seems too easy actually, but meh.
- Since we now we have all the entity scripts from native, I increased the health of the anglerfish at the bottom from 32 to 50. Makes him more like a real boss (although still much easier than the blaster (100 health  :o :o) or NP, who can block your shots (but only has 40 health)).
And to further enhance the 'boss' feel of the anglerfish, I gave him a camera lock on death, similar to what the big blaster and NP have (although for some reason I couldn't make Naija invincible while the camera was locked, even when I copied how its done in the other scripts...but I think its ok to be vulnerable for 1.3 seconds xD and I didn't force Naija to be idle in that time either ;) ).
- The big blaster's death scene will no longer try to make you look at her egg (a.k.a. (0,0) lol). It was always rather off-putting staring at blackness for 2 seconds after killing a boss..

I think thats about it. These things are making this feel rather polished. I like it. :D
And with time records, people can compete!  >:D

I think I need to do one more test run just to make sure I reset all my trial-and-error scripting properly. xD Then I'll go for a new release.
Title: Re: Big Energy-Form Battle
Post by: Danger Mouse on January 05, 2009, 04:38:03 pm
That is awesome Hiro! And thanks very much Edwards for the helpful content here in the thread. Much appreciated!
Title: Re: Big Energy-Form Battle
Post by: Edwards on January 05, 2009, 08:28:54 pm
Dude, that is so awesome. It doesn't only tell you the time at the end, it has the time in the bottom right and everything.
My only gripe, if I can even call it that, is that the player has to kill that poor lost Ekkrit creature I put in there. I can't however find a way to let him live with this script.  :-\ Even if I remove all references to him he still has to die for the end to take effect... I think it might be because he is counted as an enemy? That would mean that he must die for the all-enemies-dead trigger too. Not sure how to change that... Oh well, I'll just leave him dying in for now at least.  ::)
To allow the ekkrit to live, you'll need to change a couple of lines.  Sorry, I hadn't realized the poor thing was supposed to be optional:
1) "if ekkritdead or entity_getNearestEntity(me, "ekkrit") == 0 then" should be removed, as should its corresponding "end" statement.
2) The line "if entity_getEntityType(testEnt) == ET_ENEMY then" should be changed to "if entity_getEntityType(testEnt) == ET_ENEMY and not entity_isName(testEnt, "ekkrit") then"

- The big blaster's death scene will no longer try to make you look at her egg (a.k.a. (0,0) lol). It was always rather off-putting staring at blackness for 2 seconds after killing a boss..
Ah, nice.  I'd been thinking of going after that little issue next- good to see you've already got it fixed. 

[EDIT] Here's the complete modified script, with a few extra tweaks for performance and the commented-out debugging code.  I haven't tested this myself, but it should work- I didn't make any major changes.
Code: [Select]
--[[A relatively simple entity that will track whether there are any enemies
left in the Big Energy Battle map.  Note that should you want to use this in a
different map, you may want to delete or modify the if statements that check
whether the bosses in the map exist.

Script by Edwards
]]--
dofile("scripts/entities/entityinclude.lua")

timer = 0
nautprimedead = false
blasterdead = false
anglerdead = false
winner = false
won = false

function init(me)
n = getNaija()
entity_setPosition(me, entity_x(n), entity_y(n))
setupEntity(me)
entity_alpha(me, 0)
entity_setType(me, ET_NEUTRAL)
end

function postInit(me)
--Display the timer
setTimerTextAlpha(1, 1)

--Failsafe in case multiple copies of the entity exist
local e = getFirstEntity()
while e ~= 0 do
if e ~= me and entity_isName(e, entity_getName(me)) then
entity_msg(e, "suicide")
end
e = getNextEntity()
end
end

function update(me, dt)
--Keep the entity on top of Naija, as an easy way to make sure it never goes out of culling distance.
x,y = entity_getPosition(n)
entity_setPosition(me, x, y)

--Short-circuit test to see if the player has killed the bosses.
--Yes, the game's really fast at executing scripts, but I still want to put as light
-- a load as possible on the script engine.
if nautprimedead or entity_getNearestEntity(me, "nautilusprime") == 0 then
nautprimedead = true
if blasterdead or entity_getNearestEntity(me, "bigblaster") == 0 then
blasterdead = true
if anglerdead or entity_getNearestEntity(me, "anglerfish") == 0 then
anglerdead = true
--The following code is a test to see whether any of the entities in the level are enemies.
local bad = false
local testEnt = getFirstEntity()
--local xe = x
--local ye == y
while testEnt ~= 0 do
if entity_getEntityType(testEnt) == ET_ENEMY and not entity_isName(testEnt, "ekkrit") then
bad = true
--xe,ye = entity_getPosition(testEnt)
break
end
testEnt = getNextEntity()
end
--xe = xe - x
--ye = ye - y
--setControlHint(string.format("Enemies exist!  Timer = %d  BadEntLoc = %d,%d", timer, xe,ye), 0, 0, 0, 1)
if not bad then winner = true end
end
end
end

-- Check if the player has won, otherwise increment the timer
if not won then
if winner then
won = true
--Generate the congratulatory text and time display
setTimerTextAlpha(0, 1)
mins = math.floor(timer/60)
secs = timer - (mins*60)
secs1 = math.floor(secs/10)
secs2 = secs - (secs1*10)
centerText(string.format("Congratulations!  Time: %d:%d%d", mins, secs1, secs2))

--Exit to main menu
wait(5)
watch(0.1)
fadeOutMusic(2)
toggleCursor(false)
fade(1, 3, 0, 0, 0)
watch(3)
watch(0.5)
goToTitle()
else
timer = timer + dt
setTimerText(timer)
end
end
end

--Failsafe in case extra copies were created
function msg(me, msg)
if msg == "suicide" then
entity_delete(me)
end
end

- Edwards
Title: Re: Big Energy-Form Battle
Post by: Hiro on January 06, 2009, 01:07:31 am
Hmm, before I try that script, doesn't it make it so that if the entity it looks at first is Ekkrit then the battle will end? It seems like it gets any entity and checks if its an enemy and its not ekkrit, then keeps the battle going. But it that entity was Ekkrit then would the battle just end, even though there are other enemies around? Sorry if its a hassle. xD
Title: Re: Big Energy-Form Battle
Post by: Edwards on January 06, 2009, 03:45:14 am
Hmm, before I try that script, doesn't it make it so that if the entity it looks at first is Ekkrit then the battle will end? It seems like it gets any entity and checks if its an enemy and its not ekkrit, then keeps the battle going. But it that entity was Ekkrit then would the battle just end, even though there are other enemies around? Sorry if its a hassle. xD
What you missed was the while loop that cycles through all entities in the level.  It gets the first entity, checks if it's an enemy and not an Ekkrit.  If it is an enemy non-Ekkrit, it toggles the "did not win" flag, and exits the while loop.  Otherwise, it goes on to the next entity, and repeats the process until it runs out of entities on the map.  Basically, what keeps the Ekkrit exception from breaking the script is the same thing that keeps it from breaking if it runs into a health plant first, or Naija.

- Edwards
Title: Re: Big Energy-Form Battle
Post by: Hiro on January 07, 2009, 08:19:00 am
Oooh nice. xD
Yeah, I'm not that good at the whole scripting thing.  :-X :-[
Thanks. :D

[EDIT]
Hey, I just realised that this could be used to make a series of maps that only open once you've killed all the enemies in one area, just like DM suggested. Since it triggers when you kill everything.

[EDIT2]
Alright, got the modified script in and a new version uploaded (good thing too, I'd made a mistake renaming the folder and the xml file differently so the mod wouldn't load properly with 1.2.  :-[ Fixed now for 1.2.1).

My time when testing to finish with Ekkrit alive: 8:54.  :)
Title: Re: Big Energy-Form Battle
Post by: Guy on January 07, 2009, 10:10:12 pm
8:09 :)
Title: Re: Big Energy-Form Battle
Post by: Danger Mouse on January 07, 2009, 11:02:36 pm
Ooo, I can't wait to test this out, and see further implications of the use of killing creatures to open new areas. :) Good Job to the both of you, Hiro and Edwards!
Title: Re: Big Energy-Form Battle
Post by: Alphasoldier on February 11, 2009, 03:26:37 am
4:04, second try, almost died when Ekkrit started absorbing all my shots, he died soon after. =[
If you're gonna let him stay in, make him not a target and make him immortal or something.

Also, proof I beat it at 4:04 (http://img15.imageshack.us/img15/5756/energybattle404yy2.jpg).
Don't you dare to say: "Page not found". >:[

Oh, and the square Naija is because I'm still working on my mod's graphics and dun want anyone to see it, making a power suit is hard. =[

But yeah, try beating that. ^^
Title: Re: Big Energy-Form Battle
Post by: Hiro on February 11, 2009, 04:32:42 am
Hahaha. Dam man, I wasn't expecting anyone to pwn me thaaat much.. Although I wasn't really trying.

And its part of the game having Ekkrit be a shield. A shield to you and a shield to your enemies  >:D

So you're adding your powersuit Naija to the BEB mod? Cool :D
Title: Re: Big Energy-Form Battle
Post by: Chibi on February 11, 2009, 04:54:57 am
I can assure you that your mod is thoroughly pwning me.  :)
Title: Re: Big Energy-Form Battle
Post by: Edwards on February 11, 2009, 04:56:07 am
4:04, second try, almost died when Ekkrit started absorbing all my shots, he died soon after. =[
Nice.  My current record is 7:58 (it would have been two minutes less, but a single blaster somehow managed to evade me for several complete sweeps of the map).  I almost kept the Ekkrit alive, too, but it jumped in front of my cursor when I was attempting to target something else, and there were too many nasty things shooting me to attempt to retarget.

- Edwards
Title: Re: Big Energy-Form Battle
Post by: Alphasoldier on February 11, 2009, 10:02:56 am
And its part of the game having Ekkrit be a shield. A shield to you and a shield to your enemies  >:D
Have you no heart? D:

And well, you have no idea how many times I tried to get the first vision, clearing it out, I think... about on my 11th try I actually got through.
It's a good training, just like this mod. ^^

EDIT: Also, BEB mod?
Title: Re: Big Energy-Form Battle
Post by: Hiro on February 12, 2009, 04:19:31 am
Big Energy-form Battle.  ;)
And I at least have heart enough to make it so you don't have to kill Ekkrit too...  ^-^

Mmm, I can see the link between the vision and this. Nice idea haha. I'm impressed that you got through though, I havn't.  :-X
Title: Re: Big Energy-Form Battle
Post by: Alphasoldier on February 12, 2009, 11:24:34 am
Naw, it was a graphics mod, I was altering the original files in the game so it would also appear in the main game. ^^
But I'm far from finished. ~_~

And, well, you should try the vision sometimes.
Title: Re: Big Energy-Form Battle
Post by: prestart on August 28, 2009, 06:41:45 am
Really want to try this out, isn't there a link of RapidShare :(? It seems I can't visit box.net form China.
Title: Re: Big Energy-Form Battle
Post by: Edwards on August 28, 2009, 07:05:47 am
RapidShare mirror of version 1.2.1 can be found here (http://rapidshare.com/files/272439864/Big_Energy_Battle_121.rar).  Perhaps we should set up some sort of central mod hosting location?

- Edwards
Title: Re: Big Energy-Form Battle
Post by: Hiro on August 29, 2009, 01:00:31 pm
Thanks again Edwards.   ^-^

There have been a couple of attempts at a modding wiki, but they all seem to have fallen through..
Title: Re: Big Energy-Form Battle
Post by: prestart on August 30, 2009, 12:57:07 pm
Appreciation for that v1.2.1 mirror link! I've download it successfully.
It looks good!!!
Title: Re: Big Energy-Form Battle
Post by: ryos on October 08, 2009, 11:46:35 pm
If it's spam, I can't figure out the hook...
Title: Re: Big Energy-Form Battle
Post by: Alphasoldier on October 09, 2009, 12:06:36 am
I think he posted with the illusion of being on another board, but I'm not sure.
Title: Re: Big Energy-Form Battle
Post by: Hiro on October 09, 2009, 02:06:56 am
I'm with you guys... whats that? XD
Probably intended for another forum.
Title: Re: Big Energy-Form Battle
Post by: calebj on November 07, 2009, 12:01:53 am
Nice mod.  Took me 7:17.  I've decided there aren't enough mods out there so I'm working on one that has many of the ideas expressed earlier.  You start out with no songs and go through a series of levels and gain more forms throughout.  I have no experience scripting (except rooting around through some of the .lua files) and was wondering if anyone could help me make a script where a door opens once an enemy is killed. 
Title: Re: Big Energy-Form Battle
Post by: Alec on November 07, 2009, 05:36:26 am
There are a few ways to do that... (its been a while, so this might have slightly wrong function names or something)

a] make a special door script that checks to see if an entity is around (checking to see if you can get the entity when its inside a node is a decent way of checking if its alive, if the entity in question has a unique name you can just see if you can getEntity("UniqueName") or not

b] make a node script that has access to the door and the entity, and the node is set up in such a way that it will catch the entity if its alive, inside its box

-- at top
done = false;

-- in start up
door = node_getNearestEntity(me, "Door");

-- in update
if ~done and node_getEntityInside(me, "BobTheEnemy") == 0 then
 -- entity is dead
 entity_setState(door, STATE_OPEN);
 done = true;
end
 
Title: Re: Big Energy-Form Battle
Post by: Hiro on November 07, 2009, 10:36:52 am
Ever the dutiful helpful developer.  ;)

Yeah, sorry calebj but I don't actually know scripting either (only some really basic understanding of how the system works) so I'm not the guy to ask. Good thing Alec is on the scene eh?  ^-^
Title: Re: Big Energy-Form Battle
Post by: calebj on November 08, 2009, 04:52:06 pm
Thanks Alec,

It took me a little while to figure out but I got it eventually. 
Title: Re: Big Energy-Form Battle
Post by: Alec on November 09, 2009, 08:59:41 pm
Thanks Alec,

It took me a little while to figure out but I got it eventually. 

Glad to hear it! :)
Title: Re: Big Energy-Form Battle
Post by: calebj on November 09, 2009, 11:17:13 pm
Ok, so I figured got how to get it to work if i type in the name of a specific entity but now I want the script to test if there are any enemies left at all.  I tried taking the part of edwards script for big energy-form battle but it still didn't work.  Any help would be appreciated.

Thanks, Caleb
Title: Re: Big Energy-Form Battle
Post by: TheBear on November 10, 2009, 01:18:16 am
Quote
dofile("scripts/entities/entityinclude.lua")

done = false
door = 0
numEnemies = 0

function init(me)   
   door = node_getNearestEntity(me, "energydoor")
end

function update(me, dt)
   if done == false then
      ent = getFirstEntity()
      while ent ~= 0 do
         if entity_getEntityType(ent) == ET_ENEMY then
            numEnemies = numEnemies + 1
         end   
         ent = getNextEntity()
      end   

      --all enemies killed -> open door
      if numEnemies == 0 then
         entity_setState(door, STATE_OPEN)
         done = true
      --reset for next test
      else
         numEnemies = 0
      end
   end
end
I suppose it'd be prettier to break out of the while loop as soon as you find an enemy but the script works (tested it out). The while loop finds exactly how many enemies are in the map each update and will open the door once there are none left.
Title: Re: Big Energy-Form Battle
Post by: calebj on November 11, 2009, 01:07:10 am
Thank you so much!  I couldn't get it working at first then I realized how stupid I was and that it wasn't saved as a .lua. 

-Caleb
Title: Re: Big Energy-Form Battle
Post by: calebj on November 11, 2009, 02:40:52 am
OK...sorry about all the questions and amendments  - you guys have been great.  One more thing (for now), so using Edwards' script you need to kill all of the enemies on the whole map to continue, but what if I only want to kill the enemies in a certain part of the map for the door to open?  I'd imagine you would have to specify what area the getFirstEntity should look in but I can't figure it out.  I think that's all the questions about this I have.
Title: Re: Big Energy-Form Battle
Post by: Yogoda on November 11, 2009, 09:06:05 am
getFirst/NextEntity return entities on the whole map, you have no way to change this.

But all you have to do is create a node covering the whole room where the enemies are. It can be the same node that is opening the door. Just make this small modification :

Quote
...
         if entity_getEntityType(ent) == ET_ENEMY and node_isEntityIn(me, ent) then
            numEnemies = numEnemies + 1
         end
...
Title: Re: Big Energy-Form Battle
Post by: TheBear on November 13, 2009, 03:52:47 am
Tag-team programming!
Title: Re: Big Energy-Form Battle
Post by: calebj on November 16, 2009, 01:35:53 am
YES!! And they win!  Thanks!