Hey, we have forums!

Author Topic: Big Energy-Form Battle  (Read 67917 times)

0 Members and 1 Guest are viewing this topic.

Offline Danger Mouse

  • Hero Bit
  • *********
  • Posts: 624
  • Shush.
    • View Profile
    • Danger Mouse
Re: Big Energy-Form Battle
« Reply #30 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. :)

Offline Edwards

  • Bit Bit
  • ****
  • Posts: 93
    • View Profile
Re: Big Energy-Form Battle
« Reply #31 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
You should only need one canister shell to bag your deer using your howitzer, but assemble more than one if  you have a mind to.1

Offline Xiagan

  • Global Moderator
  • Dream Bit
  • **********
  • Posts: 1452
  • "Does absolution lie above the waves?"
    • View Profile
Re: Big Energy-Form Battle
« Reply #32 on: January 04, 2009, 10:48:57 am »
Great idea!

You can use the swamp cake in fish form to slowly kill enemies. :D
"Sire, I had no need of that hypothesis." (Laplace)

~ www.xiagan.net ~

Stalfos

  • Guest
Re: Big Energy-Form Battle
« Reply #33 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...

Offline Hiro

  • Hero Bit
  • *********
  • Posts: 674
  • Kriel's Legionary
    • View Profile
    • The Rat Hole
Re: Big Energy-Form Battle
« Reply #34 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 ;) )
My site is: http://www.therathole.co.nr/
Where I put pictures and blog posts and stuff..

Offline Edwards

  • Bit Bit
  • ****
  • Posts: 93
    • View Profile
Re: Big Energy-Form Battle
« Reply #35 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
« Last Edit: January 05, 2009, 09:04:36 am by Edwards »
You should only need one canister shell to bag your deer using your howitzer, but assemble more than one if  you have a mind to.1

Offline Hiro

  • Hero Bit
  • *********
  • Posts: 674
  • Kriel's Legionary
    • View Profile
    • The Rat Hole
Re: Big Energy-Form Battle
« Reply #36 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.
« Last Edit: January 05, 2009, 01:50:54 pm by Hiro »
My site is: http://www.therathole.co.nr/
Where I put pictures and blog posts and stuff..

Offline Danger Mouse

  • Hero Bit
  • *********
  • Posts: 624
  • Shush.
    • View Profile
    • Danger Mouse
Re: Big Energy-Form Battle
« Reply #37 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!

Offline Edwards

  • Bit Bit
  • ****
  • Posts: 93
    • View Profile
Re: Big Energy-Form Battle
« Reply #38 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
« Last Edit: January 05, 2009, 09:10:17 pm by Edwards »
You should only need one canister shell to bag your deer using your howitzer, but assemble more than one if  you have a mind to.1

Offline Hiro

  • Hero Bit
  • *********
  • Posts: 674
  • Kriel's Legionary
    • View Profile
    • The Rat Hole
Re: Big Energy-Form Battle
« Reply #39 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
My site is: http://www.therathole.co.nr/
Where I put pictures and blog posts and stuff..

Offline Edwards

  • Bit Bit
  • ****
  • Posts: 93
    • View Profile
Re: Big Energy-Form Battle
« Reply #40 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
You should only need one canister shell to bag your deer using your howitzer, but assemble more than one if  you have a mind to.1

Offline Hiro

  • Hero Bit
  • *********
  • Posts: 674
  • Kriel's Legionary
    • View Profile
    • The Rat Hole
Re: Big Energy-Form Battle
« Reply #41 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.  :)
« Last Edit: January 07, 2009, 11:30:46 am by Hiro »
My site is: http://www.therathole.co.nr/
Where I put pictures and blog posts and stuff..

Offline Guy

  • Bit Bit
  • ****
  • Posts: 62
    • View Profile
Re: Big Energy-Form Battle
« Reply #42 on: January 07, 2009, 10:10:12 pm »
8:09 :)

Offline Danger Mouse

  • Hero Bit
  • *********
  • Posts: 624
  • Shush.
    • View Profile
    • Danger Mouse
Re: Big Energy-Form Battle
« Reply #43 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!

Offline Alphasoldier

  • Dream Bit
  • **********
  • Posts: 1810
  • Zero Suit!
    • View Profile
Re: Big Energy-Form Battle
« Reply #44 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.
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. ^^
God sees and knows everything, but at least he won't gossip about it.