Linear Level Kit

A secret forum for people who preorder Overgrowth!
ZramuliZ
Posts: 108
Joined: Wed Jan 06, 2010 12:56 pm
Location: Finland

Linear Level Kit

Post by ZramuliZ » Fri May 27, 2011 8:05 am

I've noticed that many of the levels currently made are very linear and platforming oriented, so I thought they could benefit from a few new features.

I have no idea why there are massive black borders in that video

Features
  • Automatic respawn
  • Checkpoints
  • Lethal materials
How to use
Download and extract the attached zip, then copy the Data folder into your main Overgrowth folder.
If you create a level that uses this mod remember to pack these files with your level:
  • Data\Scripts\aschar.as
  • Data\Materials\kill.xml
  • Data\Materials\checkpoint.xml
  • Every object that uses kill or checkpoint material.
Creating checkpoints and lethal objects:
Image
Go to "Overgrowth\Data\Objects\" and choose the (custom or official) object you want to use as a checkpoint. Copy the object's XML file and rename it.

Image
Open the copied object file in your preferred text editor. Then write somewhere inside the <Object> tags:
(replace the material with one of the materials below)

<MaterialPath>Data/Materials/material_checkpoint.xml</MaterialPath>
Makes the object a checkpoint

<MaterialPath>Data/Materials/material_kill.xml</MaterialPath>
Makes the object kill player when in contact

Possible materials:
  • cloth_fabric
  • cloth_leather
  • default
  • dirt
  • dirtyrock
  • drygrass
  • grass
  • gravel
  • ice
  • rock
  • rocks
  • sand
  • snow
  • wood
Image
Then just choose your new object from "Load external object" and place it in Overgrowth.

Changing ground material to lethal or checkpoint
Image
Open your levels XML file in your preferred text editor. Inside the <DetailMap> tags and change the materialpath parameter to some special material. For example:
materialpath="Data/Materials/rock.xml" -> materialpath="Data/Materials/rock_kill.xml"
Then just reload your level.

Creating interactive materials
Image
Copy some material to use as base (preferrably a _kill or _checkpoint material, since they already contain the physics tag.

Image
Open the file in preferred text-editor. Change the friction to some value you want. It should be close to 1 if you want the default functionality, but if it's exactly 1 almost every material will trigger your script. Also remember that 1.001337 and 1.001336 are reserved for checkpoints and lethal materials.

Image
Open aschar.as and locate the friction check part. It's in the end of Update() function, about on line 388. Then just write the check of friction in there.
For example this material will set the health of an aschar to 1, if it's an player and if it's still awake.

Then just create an object that uses the material (explained how to do above)

Random Info
  • Checkpoints should be on center of a floor, since you can spawn off them if they are on edge of something
  • The script interacts with the materials through friction
  • Friction of lethal materials: 1.001337
  • Friction of checkpoints: 1.001336
To update the mod, just download the aschar.as below and replace the one you have in your Overgrowth\Data\Scripts\ folder.
Link for the a136 aschar.as: http://dl.dropbox.com/u/1267706/llk/aschar.as

I hope someone will find this mod useful.
Attachments
LinearLevelKit_03_a137.zip
(68.12 KiB) Downloaded 219 times
Last edited by ZramuliZ on Tue Jun 28, 2011 4:21 am, edited 13 times in total.

User avatar
Krabman318
Posts: 225
Joined: Wed Nov 03, 2010 3:34 am
Location: Planet Decapod 10

Re: Linear Level Kit

Post by Krabman318 » Fri May 27, 2011 8:38 am

Wow!
That´s truly awesome.

User avatar
Silverfish
Posts: 1451
Joined: Sun Oct 26, 2008 6:24 pm
Location: Sweden
Contact:

Re: Linear Level Kit

Post by Silverfish » Fri May 27, 2011 10:45 am

AMAZING!
QUICKLY, EVERYONE MAKE A LEVEL WITH CHECKPOINTS! :D:D:D

User avatar
Aaron
Posts: 595
Joined: Tue Feb 16, 2010 9:13 am
Location: About 2 hours away from Anton
Contact:

Re: Linear Level Kit

Post by Aaron » Fri May 27, 2011 11:30 am

Wow this is great! I was thinking about something will killzones/objects when I was in the shower this morning, looks like someone beat me to it ;)

ZramuliZ
Posts: 108
Joined: Wed Jan 06, 2010 12:56 pm
Location: Finland

Re: Linear Level Kit

Post by ZramuliZ » Fri May 27, 2011 11:55 am

Very happy to see positive response :)

But I still would like to make the enemies reset themselves when respawning from a checkpoint.
The problem is that I can't share a variable between the player and the enemies.
In pseudocode:

Code: Select all

if (controlled) //Player
{
   if (IsOnCheckPoint())
   {
       playerOnCheckpoint = true;
   }
   else
   {
       playerOnCheckpoint = false;
   }
}
else //Enemy
{
   if (playerOnCheckpoint)
   {
       SaveState();
   }
}
I'd need to share that playerOnCheckpoint variable between multiple instances of aschar.as.

Well, anyways, back to making my new map ;)

User avatar
Aaron
Posts: 595
Joined: Tue Feb 16, 2010 9:13 am
Location: About 2 hours away from Anton
Contact:

Re: Linear Level Kit

Post by Aaron » Fri May 27, 2011 12:43 pm

ZramuliZ wrote:I'd need to share that playerOnCheckpoint variable between multiple instances of aschar.as.

Well, anyways, back to making my new map ;)
I'm not sure if static/global variables are available to us in the scripting layer, have you tried to make one?

ZramuliZ
Posts: 108
Joined: Wed Jan 06, 2010 12:56 pm
Location: Finland

Re: Linear Level Kit

Post by ZramuliZ » Fri May 27, 2011 12:58 pm

Samusaaron3 wrote: I'm not sure if static/global variables are available to us in the scripting layer, have you tried to make one?
It seems that AngelScript doesn't support static variables, at least I get some errors with them.
I've also tried to make a module with getter and setter methods and then import that into aschar.as, but that just crashes the game.

User avatar
Anton
pretty cool guy
Posts: 3328
Joined: Fri Oct 17, 2008 8:16 pm
Location: Los Angeles
Contact:

Re: Linear Level Kit

Post by Anton » Fri May 27, 2011 10:23 pm

This mod truly amazing! Can't wait to see it in action!

User avatar
Anton
pretty cool guy
Posts: 3328
Joined: Fri Oct 17, 2008 8:16 pm
Location: Los Angeles
Contact:

Re: Linear Level Kit

Post by Anton » Sat May 28, 2011 12:09 pm

Sorry for the double post... the other thing that would be a cool addition to this mod (if possible) would be if there was an achievement object. That way, once you reach a certain goal (or a certain number of goals) you "win". I'm not sure if that's particularly easy or not, but it seems like it would fit in with the rest of this grouping...

ZramuliZ
Posts: 108
Joined: Wed Jan 06, 2010 12:56 pm
Location: Finland

Re: Linear Level Kit

Post by ZramuliZ » Sat May 28, 2011 12:24 pm

ariehl wrote:Sorry for the double post... the other thing that would be a cool addition to this mod (if possible) would be if there was an achievement object. That way, once you reach a certain goal (or a certain number of goals) you "win". I'm not sure if that's particularly easy or not, but it seems like it would fit in with the rest of this grouping...
That wouldn't be too hard to make. What should happen when you "win" a level?

User avatar
Anton
pretty cool guy
Posts: 3328
Joined: Fri Oct 17, 2008 8:16 pm
Location: Los Angeles
Contact:

Re: Linear Level Kit

Post by Anton » Sat May 28, 2011 12:31 pm

ZramuliZ wrote:
ariehl wrote:Sorry for the double post... the other thing that would be a cool addition to this mod (if possible) would be if there was an achievement object. That way, once you reach a certain goal (or a certain number of goals) you "win". I'm not sure if that's particularly easy or not, but it seems like it would fit in with the rest of this grouping...
That wouldn't be too hard to make. What should happen when you "win" a level?
That's the only part I haven't figured out... Ultimately it should reset the level to the starting point... but that might be a little annoying... What other options would we have? Change something on the level? Cause all enemies to respawn?
Would it be hard to automate something with the color picker too? Maybe the whole level could change colors every time you beat it... or something like that...


Edit... the thing I really want to do is make it so that you have to "collect" the eggs I've hidden around my levels, so you have to reach them all to "win" the level... as opposed to it just being "linear"...

ZramuliZ
Posts: 108
Joined: Wed Jan 06, 2010 12:56 pm
Location: Finland

Re: Linear Level Kit

Post by ZramuliZ » Sat May 28, 2011 1:11 pm

Goals like these should be implemented per level, since the script engine doesn't have any context of the level. I can implement something like that for your level if you want it.

User avatar
Anton
pretty cool guy
Posts: 3328
Joined: Fri Oct 17, 2008 8:16 pm
Location: Los Angeles
Contact:

Re: Linear Level Kit

Post by Anton » Sat May 28, 2011 1:16 pm

ZramuliZ wrote:Goals like these should be implemented per level, since the script engine doesn't have any context of the level. I can implement something like that for your level if you want.
I figured that would be the case, but I wondered if using your tools we would be able to then mod the level itself. It seems like the hardest part would just be learning how to make these objectives possible...

ZramuliZ
Posts: 108
Joined: Wed Jan 06, 2010 12:56 pm
Location: Finland

Re: Linear Level Kit

Post by ZramuliZ » Sat May 28, 2011 1:23 pm

Would it be useful if I made a few custom materials that the mappers could script the behavior of. For example I'd add a custom material with friction of 1.001338 then somewhere in the script would be:

Code: Select all

if (friction_new == 1.001338)
{
   //Insert custom behavior here!
}
But you could do this rather simply by yourself if you know how to script.

User avatar
Anton
pretty cool guy
Posts: 3328
Joined: Fri Oct 17, 2008 8:16 pm
Location: Los Angeles
Contact:

Re: Linear Level Kit

Post by Anton » Sat May 28, 2011 1:25 pm

That looks like it would add the correct functionality. Would be cool. :)

Post Reply