1. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

How to have 2 items/blocks on the same tile?

Discussion in 'Modding Help' started by king-george, Jan 25, 2014.

  1. king-george

    king-george Haxor Staff Alumni Tester

    Messages:
    284
    I have seen many maps with bushes underwater, and in the same tile water...
    I wonder how they do it.
     
  2. king-george

    king-george Haxor Staff Alumni Tester

    Messages:
    284
  3. Sgnt_Sneeky-Pants

    Sgnt_Sneeky-Pants Insanity Incarnate Donator

    Messages:
    100
    Water will fill in the tile with the bush on it upon loading the map. This works the same with any object or tile placed in water. Unfortunately, there is no way to place a block with a background behind it, with exception to dirt.
     
  4. king-george

    king-george Haxor Staff Alumni Tester

    Messages:
    284
    that's weird, I have seen caves with bushes(background dirt behind them)
     
  5. Sgnt_Sneeky-Pants

    Sgnt_Sneeky-Pants Insanity Incarnate Donator

    Messages:
    100
    Dirt backgrounds are kinda weird. It seems like the game fills in dirt backgrounds if the item/tile/object is surrounded by dirt background. However, this doesn't work all the time, and not for all items.
     
  6. king-george

    king-george Haxor Staff Alumni Tester

    Messages:
    284
    aha
    --- Double Post Merged, Jan 26, 2014, Original Post Date: Jan 26, 2014 ---
    also, i have seen bushes in grass...or flowers
     
  7. ZeroZ30o

    ZeroZ30o Haxor

    Messages:
    119
    You can add your own colors on the PNG loader and make it spawn several blobs/tiles. There was another method I don't know about, I believe you gave a file the coords/name of the blob to spawn it.
    Anyway, hope that helped!
     
  8. king-george

    king-george Haxor Staff Alumni Tester

    Messages:
    284
    I didn't understand anything you just said...
     
  9. ZeroZ30o

    ZeroZ30o Haxor

    Messages:
    119
    Basically, the png images don't "load themselves", there is a file under Scripts>MapLoaders>BasePNGLoader, which has colors and tells the game to spawn certain blobs/tiles at those colors.
    But really, you could do anything when a color appears. For example, if there is pure black on the png map, then you could make it so there's only archers by changing certain variables... etc etc. My point is, you can add to those colors, or modify the existing ones to spawn any blob OR combination of blobs you want, for example, a catapult with wood background behind it.
     
  10. king-george

    king-george Haxor Staff Alumni Tester

    Messages:
    284
    Now I understand, but how to change these variables?
     
  11. ZeroZ30o

    ZeroZ30o Haxor

    Messages:
    119
    Basically, you would store a variable under CRules, for example, 1 if you want knights only, 0 for all classes, and then you would, to put it simply, make it check if that variable is 1, and if it is, don't add archer and builder to the change class menu. Oh, and kill all player tagged archer or builder.
     
  12. king-george

    king-george Haxor Staff Alumni Tester

    Messages:
    284
    I wish I new c++, but I know only a bit python :3
     
  13. ZeroZ30o

    ZeroZ30o Haxor

    Messages:
    119
  14. king-george

    king-george Haxor Staff Alumni Tester

    Messages:
    284
  15. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    (fwiw if you want to be a programmer you'll need to have many more than 1 language in your head)

    KAG doesn't use C++ for scripting, it uses Angelscript - AS is very similar to C++ but not the same, main differences being that there are handles instead of pointers (eg CBlob@ instead of CBlob*), AS has an "is" keyword for checking if two handles are or are not equivalent ( eg if(someBlob !is null) instead of if(someBlob != NULL) ), and AS has support for properties in classes (complicated to explain).

    http://www.angelcode.com/angelscript/sdk/docs/manual/doc_script.html is a tutorial on the scripting side of AS. You can also open any .as files from KAG and read the source.
     
  16. ZeroZ30o

    ZeroZ30o Haxor

    Messages:
    119
    You can also try looking at LUA, it has a lot of similarities, like "for" loops. I don't think it has arrays or pointers so it's a bit easier.
    There's a mod for it in Minecraft called Computercraft, which uses it, if you're into that -if you are, I suggest looking at the FTB modpack. It's pretty fun :D.