CrazyVulcan's Forum Posts

  • Ive never tired it but what if you had a "danger zone" sprite. Invisible but script it so every time a #4 Tile is created, create a DangerZone sprite at that location. Then just script it so when the player clips that sprite they die/take damage.

    So if every tile #4 is the spikes, after the map is finished seeding have a for loop for every & Tile=Tile#4 create DangerZoneSprite at X=Tile4Instance0(X) Y=Tile4Instance0(Y) and have a variable ++1 for every time the loop runs and using that for which instance of the tile in question

    But I have never tried it so I may need tweaking.

  • Hello,

    I am having trouble with my game but is not exactly C2 related. I currently have a mostly working prototype that with it I plan to move my game into a Alpha state. The Game is a browser based game with a navel table top war game esq play style. I also have a lot of customizing ability mostly with choosing a crew with attributes to man each ship. Also a mostly working custom character maker. The game will have a multiplayer function to. Which will allow the players to play each other with their fleets. I also will at some point incorporate a persistent war element where players play matches to claim territory.

    Anyway

    The issue I have right now is that I can not find a way to save the player data so when they relaunch the game they will be able to access their game data. I have been using JSON with the webstorage but am having trouble getting it to stick. The custom character maker for an example. I am trying to save that to somewhere and then come back to it after relaunching. I have a sprite with empty frames and when I click a button to save it the game will take a screenshot of the character and then set the frame of the sprite to that screenshot. Then it is suppose to save that sprite to local storage with a key called "(PlayerName)MyCharacters" and have it be the JSON of that sprite.

    When you go into a MP match on a different layout, it will call that sprite and display it. So your crewman "Bobby" will then now be playable and can even face off with your opponents "Sally". Having just one sprite store all your custom made crew just with a different face on each frame will greatly save time and how much resources are needed. I did start with trying tilemaps but I could not find a way to change the image of just one tile, but this will do, hopefully.

    So seeing as I cant get the JSON to save how should I approach the problem? I do at some point want to host my own website that will securely store all the data. I do not want the player to keep the files. However I really don't want to build the website in parallel to the game, least this prototype so I am mostly looking for a patch so I can move on.

    Which brings up another but separate point, C2 allows for exporting to a number of hosting sites but those are not built for what I have in mind for this project. Is it even feasible to take my C2 game and host it myself. I know the basics of HTML and a pinch of CSS so actually building the site is not really a issue just how to marry C2 and the Website.

    All of which brings back to storage. Do I slap a Website together and then go back to the game? If so than how do you store data on 3rd party web server? Or is there a way that I can keep it small scale and still get my data to play nice.

    Thank You,

    CrazyVulcan

  • I have run into another problem with tilemap that I hope to find answers. I would like to do basic animation using my tiles. Rotate, transform, scale etc and now find that I can not use tilemaps in this way. I have a tilemap of 80 or so cards that I would like to do things with and with 80 of them a tilemap seemed to be the most efficient way of doing them. As opposed of having 80 sprites which would make just as much lag but with less headache. Is there a plugin that I am not seeing to do this or will I have to result to having a large number of sprites.

    Or possibly is there a way to change a sprites image to match a tile on the map? If I could just say Sprite1 = Tilemap.Tile3 that will solve many of my problems but i am unaware of how.

    Thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hello,

    I am currently playing with snapshots and have a question on how to utilize this tool. What I want is to have a tilemap object with x number of tiles. And when I take the snapshot use it to change the image of that tile of the tilemap. For sprites I can do this with the Load Image From URL command however I do not see this as an option for tilemaps.

    I do see where you can erase a tile, so to me it seems reasonable to allow you to append a tile. And in the process chose a Image while doing so. Or even do so without appending a tile by simply laying over a new image on that tile.

    Is this even possible in the current build? First is this something I can request be added to C2, second is there a reasonable way to get what I am trying to do another way?

    Thank you for your time.

    -EDIT-

    Ok so I have been left laying awake for a while and I just thought of a idea to do this and I am writing it here more so I will remember in the morning. Animation Frames. I could have a sprite with a animation with the hundred or so frames containing each image. I can even have different animations for each type of character I wish and leading to a animation for custom characters with x blank frames. I could try having when I take the snapshot change the animation to the custom character one and set the frame to the number slot that I am overwriting.

    So if I was saving in the third save slot I would take a snapshot of the portrait. Set the animation of the sprite to the custom animation and set the active frame to 2 and load image form URL for the sprite and then save the sprite to the project file. (Still working on how to do this)

    If I have the custom stats assigned in the character creator then I can have my CSV sheet change the value for each in the 3rd row.

    I feel optimistic about this now to see if I can get some sleep

  • Hello, I am just posting back here having finally solved the list of things I needed to figure out. And now it works exactly as I wanted I will write a tutorial when I get the spare time but for now this is a list of what I did to get this to work.

    To start here are the items you need to bring into the view port. A go button and blank avatar. A tileset with all your characters on it and one clone plus how many slots you plan to make. I made 3 so that is 4 clones of a tile set. A menu box, a tile for your avatars to sit on and highlight the stats of each. A CSV, found in the extensions from RexRainbow. And some text items to show your stats.

    For the tile you will need to make it a container holding all the text items that go with each stat.

    CODE===

    //First we need to destroy the first tileset and the sprite backround for our tiles as the math we will be doing can be thrown if they are present after the layout is loaded.

    On start of layout

    Destroy Tileset

    & Destroy Tile

    & Load CSV Table form String}

    CSV String

    ",Name,Unlock,Strength,Speed,Mana

    0,Bob,T,0,0,0

    1,Tim,T,0,0,0

    2,Sue,T,0,0,0

    //etc for each tile in your tile set. be sure that you list each character in sequence and tile 0 tile 1 and tile 2 will not only correspond to each image but will allow you to link that image to the CSV table for easy access to your stats.

    //now we have the tile as a container for all out text items (also I have tied my tiles to the avatars so you can scroll through the list so know you can also do it the other way)

    Every Tick

    Tile - Set position to X: Tilemap.TileToPositionX(0) Y: Tilemap.TileToPositionY(0)

    TextName - Set Position to Tile Image Point (1)

    TextStrength- Set Position to Tile Image Point (2)

    }

    //you get it

    Global Var's

    Total - value of 0

    TileSelect - value -1

    ActiveSlot - value -1

    Mouse LeftClick Slot0{

    Set Var ActiveSlot to 0

    Call Function "Menu1"}

    //repeat for as many slots you will want

    Function on "Menu1"{

    Set background to position 500,100

    >>>

    CSV For Each Row

    &

    Compair CSV.At("Unlock",CSV.CurRow)="T"{

    Add 1 to Total

    Create Obj Tilemap on Layer(1) At X: Background.ImagePointX(0) Y: Background.ImagePointY(0)+(150*Total)-150

    //This will add one to every run of the loop spacing out the placement of each avatar and tile

    Set Tilemap - to int(CSV.CurRow)

    Creat Obj - Tile on Layer(1) X: Tilemap.TileToPosition(0) Y: TileToPosition(0)+(150*Total)-150

    TextName - Set Text CSV.At("Name", CSV.CurRow)

    ValuStrength - Set Text to CSV.At("Strength", CSV.CurRow)

    //and so on

    Tile - Move to bottom of layer

    Background Move to Bottom of layer}

    }

    Mouse - LeftClick on Tilemap

    &

    ActiveSlot = 1{

    Set TileSelect to{ X: Tilemap.TileAt(Tilemap.PositionToTileX(Mouse.X)) Y: Tilemap.TileAt(Tilemap.PositionToTileY(Mouse.Y)}

    //let me go over this one real quick. Tile select is a Var that is used to note which image I click on. So looking back at the CSV, and note that each row is numbered. So by clicking on Sue the var TileSelect will be set to 2 and later you will see that by having row 2 and Sue's image on the tile map the same this allows me to quickly know where my data is coming from.

    Set Tileset to (TileSelect)

    //then set the text items next to slot one to each stat

    Set ActiveSlot to -1

    Destroy Obj Tile

    Set Total to 0

    CallFunction "Destroy Tiles"

    On Fun "DestroyTiles"

    Destroy Obj Tilemap

    Move Backround to -100,0

    //this function is there because when I have it in the other block it will only destroy the tile that I selected. This allows me to get rid of all of them.

    Repeat the last block for each slot that you have. This is all there is to it and I am happy that I managed to do this all with 13 blocks and 3 variables

    .CAPX needs CSV by RexRainbow to open

  • ramones thank you so very much, to think it was something so small. I will work on the next part of my problem and report back on my progress later. In fact I may go back to arrays given that now I know where in the issue lies.

    Thank you all for your help.

  • nimos100 I really do appreciate you helping me but I really need someone to open the .CAPX to see if something is wrong on my end. The only plugin you would need is Rexrainbows CSVtoDictinary and all that I am trying to do is at the start of the layout add CSV's to five Dictionary's. Then when you right click run a foreachkey loop that is only looking for the value "T". Each Dictionary has 4 keys with values.

    the exact keys are

    "UNLOCK, T

    A, 1

    B, 2

    C, 3"

    With five dictionary's when I run a for each key loop I have a var add one for each key giving me a value of 20. But when I add a condition for only values with the string "T" I get 0 when I run the loop.

    I honestly can not think of any simpler way to show what I am trying to do without someone looking at the .cpax

  • OK, I am approaching this from a new angle. That being instead of having a array for each character I now have a Dictionary for each one.

    Each Dictionary has 7 values and having 3 Dictionary when I run the for each Key where adding 1 to a variable gives me 21. However now when I try to narrow down that list to only add 1 for each key that has the string "T" in it I should get 3. Instead It will not run the block and my debug var stays at 0. I have tried using compare values, in both the dictionary and system. As well as compare current value that is in the for each loop section.

    I am starting to feel that I may have a bug as everything I try that should work will not in the way I understand it.

    EDT<<

    Damn, I just opened a new empty project and only added what I absolutely needed to test it and it worked just great. Sooo that means to the best of my knowledge all my problems more likely than not are instances where C2 is bugged.

    PS How many dictionary's can I have and the game still function? Because I may need a lot.

    EDIT2<<

    And now making yet another new file I now can not do the exact same thing I just did in the last new file Ive noticed a *at the end of my project name on the right hand side. Does this mean anything?

  • Ok so if I understand you correct you have X amount of characters available, at some point during the game, the player can unlock these, and use them in later games if they wish. So when the player starts a new game you would like to load each unlocked character and show them in a selection menu, which is a tilemap?

    Yes that is in fact what I am trying to achieve. I am however having trouble with the tilemap obj. When I load a sheet of sprites to it and set the cell size and position all I get is a empty sprite in my workspace. I can not figure out what is not working as no matter what image I load every sprite object I place in the level is blank. I have made sure that initial visibility is true and that the tiles are the right size and place. the manual does not really go into troubleshooting this.

    So after you have started the game, and found out that character 1 and character 2 is available, you can make a function that get the stats for each character. If you also need it to be placed at a certain position, you can pass this as well, so:

    Requires:

    Parameter 0 = Character.UID

    Parameter 1 = Position

    Function "Load character stats"

    Sub event 1:

    Pick character1.UID = Function.Param(0) (Will only select character1 if the passed UID matches it, else it will just skip it)

    --------- If Function.Param(1) = 1 (Will place character 1 at position 1)

    Set textbox_CharacterName_1 = Character1.Name

    Set textbox_CharacterHealth_1 = Character1. Health

    Set Tile.At(0.0) to Tile1 (Assuming that this hold the image of character 1)

    --------- if Function.Param(1) = 2 (Will place character 1 at position 2)

    Set textbox_CharacterName_2 = Character1.Name

    Set textbox_CharacterHealth_2 = Character1. Health

    Set Tile.At(1.0) to Tile1 (Assuming that this hold the image of character 1)

    Sub event 2:

    Pick character2.UID = Function.Param(0) (Will only select character2 if the passed UID matches it, else it will just skip it)

    --------- If Function.Param(1) = 1 (Will place character 2 at position 1)

    Set textbox_CharacterName_1 = Character2.Name

    Set textbox_CharacterHealth_1 = Character2. Health

    Set Tile.At(0.0) to Tile2 (Assuming that this hold the image of character 2)

    --------- if Function.Param(1) = 2 (Will place character 2 at position 2)

    Set textbox_CharacterName_2 = Character2.Name

    Set textbox_CharacterHealth_2 = Character2. Health

    Set Tile.At(1.0) to Tile2 (Assuming that this hold the image of character 2)

    Then you just create one for each character and each position. And then you just call this function every time you need to load a character.

    Call function("Load character stats", <FamilyCharacter.UID or specific character UID>, <Position of where you would like the character to be loaded to>)

    If I read your example correctly you are suggesting that I create a function for each character with which sprite to chose and all. However when I will scale this up that is a lot of data for the engine to chew though and I am looking for a way to automate this proses as it is just a menu and I can not budget too many resources to it.

    Which brings me back to using a array. With a array I can have one object that contains all the needed data for any character. That or using the CSV plugin. I want a way to have the program call the array and say OK rows 1,2,4,and6 are valad and row one is this character and column 2, 3 and 4 are attributes for this one person. So this tile that has just been created will be the sprite for person form row one column one. and there are three textbox on this tile that are pulled form row one column 2,3 and 4. Then repeat for a new tile for row 2 onward for each row that that contains "true" in the column for "unlocked"

    But I am completely lost for how to say for each row in column "unlocked" where CSV.at("unlocked",CSV.CurRow) = "True" and then match each row to a associated sprite and text box that are created dynamically for each row and then move on to the next row and repeat till there is one tile for each row in the array.

    The img is a screen of my current layout, showing the empty tile map and a idea of what I am trying to do for those who did not download the .cpax. the brown tile and black avatar is destroyed at the start and I am trying again to create each with the needed info one at a time when I click the blue bttn.

  • Im not really sure what you are trying to do.

    [quote:3h7aws6w]The problem I am running into is that I can not link my array and family. Meaning that I cant run though the array and have each row correlate to a member of the family. I have tried having each row being the UID of each member but I can not find a way to automate that idea. And simply having Bob.UID in the first part of each row does not work.

    I don't understand what you mean that you want to link the array and family?

    The array hold whatever data you add to it, and can not be linked to anything, in theory any object in your game can use these data if you want them to, depending on your conditions for reading and making use of the content in the array. If what you mean is that you have stored some data to the array at some point and then when a character is available you want to use this to set some settings for the character, then you have to make sure that these characters UID matches the ones stored in the array, which it could sound like it doesn't.

    I get the impression that this is what you have been trying. But its very hard to troubleshoot when not sure how and what you store in the array.

    The family is also something that you cant link anything to, it more or less just a wrapper that can hold a group of other objects of different kinds but which share some common attributes, and therefore makes it easier to work on several different types of objects at the same time. So I don't understand what you mean with linking to it? If your characters are part of the family they are already "linked" to it through that and can be selected using:

    Pick Random FamilyCharacters

    Character1.UID = FamilyCharacters.UID (Assuming that the random Familycharacters chosen is a character1)

    Can you try to explain what you want to use the family for and when, and what the array hold of data that you need. And how and when you store the data, in correlation to when you need to read from it, think that would make it easier to help you?

    Thank you for replying,

    It very well could be that I am approaching the entire problem wrong but when I say I need to link the array and the family I simply mean that I wish to have a group of objects (Character Images/Avatars) and sort them so that they will appear in order on my menu.

    example if I have a array

    Name, Stat1, Stat2, Unlocked

    Bill,2,1,False

    Ted,1,3,True

    Sue,2,2,True

    And then have a command to build a populate a menu I need it to only list Ted and Sue, and exclude Bill. I also want it to on each menu tile to list Stat One and Stat Two in a textbox. Now each Avatar is located off screen and I need to pull them in and place them on every tile that is generated.

    So what I have done is make a sprite for each tile and move the sprite family to a pin point on that tile. How ever it will grab all the tiles and place them on the last tile generated. I have tied to use pick instance random and it will do as I wish, well it will place one avatar on each tile somewhat. But unless i want to create a family variable for all the sprites It will not work efficiently when I scale this up.

    I have tried using the UID (TedSprite.UID) and placing them in the array so I can say that when running a loop in the array the avatar sprite is linked that particular row in the array

    What I really want is to have a generic avatar that will be created for each tile and then change the sprite img form a URL in my project files. So using the above example I will create 2 tiles in my menu. Each tile will have the generic avatar pinned along with a textbox. Then tile0 will change the avatar to Ted and the text box will update with Ted's stats. then the next tile in the menu will be Sue's again doing the same.

    So to answer you question no, I do not really need the family but what I need is to be able to sort the array and have it correspond to a sprite. As I write this the idea came to me that instead of using the UID of sprites or IID of the avatar family. I will look into just having the avatars in a folder in my project file and pull their img form there to replace a generic avatar. thus negating the need of a family. Worth a shot so give me some time and I will report back

    Though if anyone has a solution that I am over looking please post.

    Thanks,

    CrazyVulcan

  • Some time back I was tinkering with a custom character maker and needed to do the same thing as you when trying to dynamical change color. Here is my solution, One make a gray scale sprite that will be your base as starting with a colored sprite will make tuning the HSL difficult. Next make a variable called ColorTyp set to zero and also add the Adjust HSL Effect to your sprite.

    In your events make a every tick block and place a number of sub branch's below that. Using the system compare pram set it for if ColorType=0, =1, =2 etc. the actions of each of those branch's you will use the "set effect "AdjustHSL" pram 0 to (Number)" repeat for pram 1 and 2.

    Having done that and adjusted the 3 parameters for the sprites HSL effect all you have to then do is change that ColorTyp var to dynamically change the sprite.

    But again you would have to do this on a sprite by sprite bases but have you looked into containers? if you put all the sprites into a container that should cut down of the cost of having all these sprites

    <><><>example

    Every Tick | ___________

    ColorTyp=0 | Effect Adjust HSL param 0 to 50| Effect Adjust HSL param 1 to 50| Effect Adjust HSL param 2 to 50

    ColorTyp=1 | Effect Adjust HSL param 0 to 10| Effect Adjust HSL param 1 to 75| Effect Adjust HSL param 2 to 50

    ColorTyp=2 | Effect Adjust HSL param 0 to 100| Effect Adjust HSL param 1 to 25| Effect Adjust HSL param 2 to 80

  • Family's & Arrays, A question of item sorting and selection.

    Howdy,

    This is a problem for my game that I have been struggling with off and on for a good three months now and have come to ask for assistance in getting this part of my game nailed down so I can move on.

    Below is provided a .cpax of my game that is the core issue I am trying to work though. The goal is that I can have a roster of items (Party Members) that is filtered so the only things you see in the menu is what you have available. The full game will be a multi player combat arena where each person will bring in groups and have them fight in tactical turn based combat. However first I must have it so you can only select the party members based on what you have unlocked/awarded. Listed below is a number of avenues that I have tried to use but still can not get to work.

    Remember that scalability is key as the final game will have 100+ choices and I also need the ability to update this list server side to add to that number. But we'll just get the foundation set before going crazy.

    I have each party member in a family with a family instance variable of either true or false. When the scene loads I run though a 2darray that includes every member in the family and based on that loop set the variable for each unlocked family member to True. Then when you select a slot for any of your slot a menu pops up that you can scroll though that lists all available persons. Chosen by a for loop for each family member that their varable="T"

    The problem I am running into is that I can not link my array and family. Meaning that I cant run though the array and have each row correlate to a member of the family. I have tried having each row being the UID of each member but I can not find a way to automate that idea. And simply having Bob.UID in the first part of each row does not work.

    I have also tinkered with RexRainbow's CSV plugin's hoping that later down the road each player can have a JSON string that can pull form a master file and self update when something like unlocking a new party member happens.

    But again how would I link the CSV and the Family? I can only put the CSV in as one string so I can not place variables embedded inside the string that the engine can read and use.

    I have looked into XML but it is still too new to me for me to understand what exactly I need to do in order to get the desired result.

    TLDR; How do I filter a family by a array or CSV string.

    Thank you for your time,

    CrazyVulcan

  • Howdy,

    I do not know if or how recently this has been bought up but I use C2 Full though my Steam client. I was browsing the community section a short time ago and noticed that there are 36 threads and a single screenshot. I do not know how many of us use Steam to access their C2 but I is a shame that there is not exactly a lot of liveliness over there.

    I use royalty free assets to prototype and the thought occurred to me that if one could use Steam Workshop items to import them directly into the program this might draw more traffic though there. Would this be a possibility in the future? I know Fusion and I believe Game Maker have this and it would be great if Construct had this as well.

  • This is great, thank you!

  • Just make ever layer transparent (the one created by default isn't transparent), so the screenshot has a tyransparent background (however, the display will still show black at the background, but the saved snapshot will not have it)

    Hello, have a few quick questions. One how do you select just the layers that you want to save. The snapshot canvas tool only is allowing me to chose my file format and the name of the file. I can not find any options to save just say Layer 3 or crop options or other ways to limit where the snapshot happens.(Width and Height of image)

    Thank you for your time