Hey, we have forums!

Author Topic: Form modification/Creation  (Read 33651 times)

0 Members and 1 Guest are viewing this topic.

Offline Titch

  • Bit Bit
  • ****
  • Posts: 55
  • Aquatic Rocket Scientist
    • View Profile
Form modification/Creation
« on: January 08, 2009, 01:32:38 pm »
I want to get into modding, so I thought I would start by modifying one of the existing forms and perhaps creating a new one based on the modifications I've made.

I do know a bit about scripting. I've done quite a bit of programing and scripting before, including some LUA based stuff and ActionScript as well as doing a total conversion mod for Unreal. I'm just having trouble identifying which script files I should be looking at to be able to change a forms abilities and stats.

Basically my plan is to add a new right click ability to Sunlight form and some kind of rock throwing skill to Beast form, although it may change if these things turn out to be too complicated. It's mostly so I can do some interesting things whilst I get to grips with the scripting system than for any kind of full blown mod.

Thanks in advance for any help :)
« Last Edit: January 08, 2009, 01:36:30 pm by Titch »

Offline Chibi

  • Dream Bit
  • **********
  • Posts: 1443
  • Deus Ex Aquaria
    • View Profile
    • Prize Rebel ($50 dollars earned in two months)
Re: Form modification/Creation
« Reply #1 on: January 08, 2009, 03:12:48 pm »
You can already throw rocks in Beast Form, but you have to eat the creatures that live in rock huts and lob stones at Naija.

Life is a sexually transmitted disease with a 100% mortality rate. [Click the signature for +1 health!]

Offline Titch

  • Bit Bit
  • ****
  • Posts: 55
  • Aquatic Rocket Scientist
    • View Profile
Re: Form modification/Creation
« Reply #2 on: January 08, 2009, 04:22:27 pm »
I mean the big rock objects you pick up using Bind. I'm thinking something along the lines of being able to kick them by springing off them or similar. It might lead to some broken physics but it could make for some fun aquabatics.

Offline Danger Mouse

  • Hero Bit
  • *********
  • Posts: 624
  • Shush.
    • View Profile
    • Danger Mouse
Re: Form modification/Creation
« Reply #3 on: January 08, 2009, 04:35:13 pm »
I think that would kind of detract from the current beast form since it's designed around eating other creatures for their abilities... but if you can get some practice at scripting to accomplish your goal, I can't see how that could hurt. At least you'll have some experience towards making new forms. I eventually will be getting to that point in my mod as well. So I'll definitely be watching your progress really closely as I am already working on other aspects of my mod. Share your creations with us and ask questions if you are having trouble. Good Luck! :)

Offline Titch

  • Bit Bit
  • ****
  • Posts: 55
  • Aquatic Rocket Scientist
    • View Profile
Re: Form modification/Creation
« Reply #4 on: January 08, 2009, 04:41:50 pm »
Well I agree it would make beast form over featured, but it doesn't really seem to fit well with any of the other forms. It might work with Nature/Sun form since they both have really limited combat capability but doesn't really make logical sense. If I can at least get it going I'll probably integrate it into some new form designed specifically for ninja like aquatic maneuvers or the like.

Offline Danger Mouse

  • Hero Bit
  • *********
  • Posts: 624
  • Shush.
    • View Profile
    • Danger Mouse
Re: Form modification/Creation
« Reply #5 on: January 08, 2009, 04:53:15 pm »
Hmmm, Ninja Naija.... lol :) If you want to see some more ideas that have been made by me in the mods section, check out my thread for Aquaria: Lost Treasures. Maybe those would give you some more ideas, or if you even wanted you could try to make them. As I haven't gotten to that point in the mod creation process yet.

Offline Titch

  • Bit Bit
  • ****
  • Posts: 55
  • Aquatic Rocket Scientist
    • View Profile
Re: Form modification/Creation
« Reply #6 on: January 08, 2009, 09:52:36 pm »
Yeah, I've seen the various mods in process. I'm hoping I'll be able to offer some help once I'm more at home with scripting for Aquaria. It is what I'm naturally inclined to do anyway.

Anywho. I've managed to make a song and bind it up with a callback in game, so singing it will change your form. I've made a few bits for the skin for the form. I'm still not sure how to make new forms though or examine . There doesn't seem to be an XML file with a list and they don't seem to be in the entities of common folder, there isn't a template for them either. You could fake it with a setCostume(). Even doing that I'm not sure how to tie up inputs/abilities with costumes, it could mean a pretty ugly hack to get it working.

Offline Hiro

  • Hero Bit
  • *********
  • Posts: 674
  • Kriel's Legionary
    • View Profile
    • The Rat Hole
Re: Form modification/Creation
« Reply #7 on: January 08, 2009, 11:37:29 pm »
I know what you mean. I've seen the file that has a list of all the songs, but I've never found a way to change what the songs do... I think its something we might need Alec's help with. They did say you'd be able to make your own songs, so surely there must be a way to make them do things.
My site is: http://www.therathole.co.nr/
Where I put pictures and blog posts and stuff..

Offline Titch

  • Bit Bit
  • ****
  • Posts: 55
  • Aquatic Rocket Scientist
    • View Profile
Re: Form modification/Creation
« Reply #8 on: January 09, 2009, 12:02:59 am »
Well I've got it recognizing my own song. It's actually programing the functions of the new form state without having to do a horrible kludge that bothers me.

In songs.xml :
<Song idx="101" name="Ninja Form" slot="12" notes="4 5 3 2" script="1" vox="ninja"/>

Which is N,NW,NE,S notes (I wish their where note smilies so I could write them out better, oh well).

In songs.lua
Code: [Select]
dofile("scripts/entities/entityinclude.lua")

n=0

function castSong(index)
    n=getNaija()
    if index == 100 then
        spawnParticleEffect("bigredexplode",entity_x(n),entity_y(n))
        playSfx("ninja", 1000)
        setCostume("ninja_naija")
    end
end
EDIT 6-Billion : I worked out that my script wasn't working because I wrote najia instead of naija. Dyslexia + Programming. Not the best of bed partners.

In node_learnsong.lua
Code: [Select]
n= 0
isNinjalearned=false

function init(me)
n = getNaija()     
end


function update(me, dt)

if isNinjalearned==false then
 if node_isEntityIn(me, n) then
   setControlHint("You've found a new song! You can now use NINJA form!", 0, 0, 0, 16)
   learnSong(101)
   learnSong(102)
   isNinjalearned=True
 end
end

end

So now I've got a song that triggers a costume change and a special effect, I even got it to bring up and icon by looking at the copy of the native mod stuff. Now I've got to work out the callback for when Naija is being clicked on so I can switch the costume back and re-enable singing so it seems like a form. Once I've got that stuff I guess I'll post my progress. :)
« Last Edit: January 09, 2009, 01:03:45 am by Titch »

Offline Hiro

  • Hero Bit
  • *********
  • Posts: 674
  • Kriel's Legionary
    • View Profile
    • The Rat Hole
Re: Form modification/Creation
« Reply #9 on: January 09, 2009, 02:29:56 am »
Well, looks like you're beyond me already (and that's even with Edwards' help for the Native mod song).
But even with what you have with the costume change, I still have no idea how you're gonna change what right click does (ie. for like the form shot or something rather than singing)...
My site is: http://www.therathole.co.nr/
Where I put pictures and blog posts and stuff..

Offline Titch

  • Bit Bit
  • ****
  • Posts: 55
  • Aquatic Rocket Scientist
    • View Profile
Re: Form modification/Creation
« Reply #10 on: January 09, 2009, 02:33:28 am »
Well I'm busy scraping the google cache of the old Wiki together and dumping it into the new Wiki so hopefully I can find out. I have a feeling the Naija entity will make a callback when it's clicked on with the right and left mouse buttons, its just a case of working out what that callback is...

Offline Danger Mouse

  • Hero Bit
  • *********
  • Posts: 624
  • Shush.
    • View Profile
    • Danger Mouse
Re: Form modification/Creation
« Reply #11 on: January 09, 2009, 05:05:32 am »
That's really amazing stuff there titch... maybe you could help me with the forms for my mod?

The more talent I'm seeing around here for scripting the more I'm thinking that we should all put our heads together and assign jobs within a project, and make a colaberated mod. I'm sure it would end up really impressive instead of just the work of one individual. After all, even Alec had a couple of partners. :)

Offline Edwards

  • Bit Bit
  • ****
  • Posts: 93
    • View Profile
Re: Form modification/Creation
« Reply #12 on: January 09, 2009, 05:35:46 am »
Well I'm busy scraping the google cache of the old Wiki together and dumping it into the new Wiki so hopefully I can find out. I have a feeling the Naija entity will make a callback when it's clicked on with the right and left mouse buttons, its just a case of working out what that callback is...
This may or may not help, but if Naija is in a form that can be charged, calling avatar_getSpellCharge() returns the time that the player has been holding down the charge button.  I'm still trying to find some way to use it (or something similar) in a non-charging form (such as the normal form).

Regarding callbacks, I can't find any reference anywhere to callbacks for clicking on Naija, or even for files where said callbacks might be used.  I suspect some degree of kludging might be needed.  (Admittedly, I don't have the wiki on-hand, but I do have a list of all the functions.)

[EDIT] changeForm() can set you to forms 8 and up (unused in the main game) without crashing, although no change in appearance occurs.  You stop being able to sing, though, so you probably are actually in a new form.  There may be a file somewhere that will allow you to take advantage of this- I'm looking for that right now

- Edwards
« Last Edit: January 09, 2009, 05:53:41 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 Danger Mouse

  • Hero Bit
  • *********
  • Posts: 624
  • Shush.
    • View Profile
    • Danger Mouse
Re: Form modification/Creation
« Reply #13 on: January 09, 2009, 06:09:32 am »
Ooo,... that could be useful. :)

Offline Edwards

  • Bit Bit
  • ****
  • Posts: 93
    • View Profile
Re: Form modification/Creation
« Reply #14 on: January 09, 2009, 07:48:05 am »
So, yeah- the best I can come up with is an unpleasant kludge involving setCostume(), changeForm(), and either nodes using isRightMouse(), timerBeast-like entities (see Big Energy Battle version 1.2.1) with the activation property set (see seahorse.lua), or some combination of the two.  On the plus side, it would probably be functional, and would interface passably with the existing form system, due to the use of changeForm()-  just have whatever the helper node/entity is change the costume back if it notices that Naija's form has been set back to normal.  As a warning, using setCostume when Naija is not in normal form will revert her to normal form, so you'll need to keep track of that.

As for changing existing forms, that would be an even uglier kludge- adding abilities wouldn't be too bad, but changing existing abilities (except those that spawn new entities, like Nature Form) would likely be most easily done by creating an entirely new form. :-\

- 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