CrazyVulcan's Recent Forum Activity

  • I have done this for my game but I fear its not a simple proses. If the play space is 1000u x 1000u and your viewport is 300u x 100u then you will need to set up a number of conditions. For scrolling left

    For every tick MouseX is less than or equal to ScreenX-50u & If ScreenX is Less than or equal to LayoutX 0u. Then scroll 10u at 180deg (Left).

    //

    this will move the screen 10 units to the left every tick(or smaller depending on scale) As long as your mouse's X position is to the left 50u to the screens center. And the second condition will stop it moving left as again your view port has a X,Y coordinate. So if your screen's X is less than or equal to your viewports X it will keep moving left every tick till the second condition is rendered false

    This is then repeated for Right 0deg, Up 90deg, and Down 270deg. And I hope this helps

    //

    *u in this case is just "units" be they pixils or inches

  • I can't help you with your game question but I can touch on the website part.

    I just finished testing my game using the html export option.

    Uploading to a webhost is extremely easy, I just copied and pasted the files and boom my game was up.

    It comes embedded on a standard html file that you could edit and integrate into your website.

    Saving and reading from your website storage should't be an issue.

    Huh, I could export a test file to see what happens, thanks. As a newcomer to web development could you explain what steps I need to store that data? I have not looked at XML yet for storing my data but you can save those. So just put all the JSONs of each player in their XML file and call that when they log in.

    I will look again at the tutorials here but any resource/tips will be welcome

  • Simplest way I know is to create a sprite that has your splash animation at the point of contact with the water. You throw a rock and it touches the water. at that moment create a sprite at x=Rock(X) Y=Rock(Y) and have it play the splash animation. Then destroy the sprite after the animation.

    Or with a balloon hitting the wall, same idea only you could just have your balloon stop at the point of contacting the wall and just play the popping animation and then destroy it after that has run

  • 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

  • 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

  • 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 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.

CrazyVulcan's avatar

CrazyVulcan

Member since 22 Dec, 2013

None one is following CrazyVulcan yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies