CrazyVulcan's Forum Posts

  • The tiles may be 32x32 but when you click on the tilemap object in the tree and look to the detail panel on the left dose that say your tiles are 32x32?

  • Form controls can be set with CSS, in a list you can set "FontStyle:Comic Sans;FontColor:Pink" or however you fancy. I am right now working on how to get my form controllers to look great. However remember that this is built in HTML5 meaning that it has web standards that must be met. here is a complete list of all css commands and while they don't work for every form they will give you a good idea of how css works without having to learn how style sheets work.

    http://www.w3schools.com/css/default.asp

    edit<< As I am still working out CSS3 I found this that might be of intresst to you http://www.w3schools.com/css/css3_fonts.asp

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Both var1 and var2 will be set to 1 but C2 works in a cascading hierarchy. When a layout is started C2 reads down the list top to bottom going through each event so long as the conditions are meet. The important thing to understand about the coding is what events take priority over others.

    So if you have something like a bomb we are detonating at random

    On Layout Start -> Set var1 == 0

    For EveryTick -> Set var1 == round(random(0,9))

    On Function "Boom" -> Destroy SpriteBomb & Play Boom sound clip

    If var 1 == 5 -> Then do function "Boom"

    In this case c2 looks from top to bottom for conditions it first sees On Layout Start which has a green arrow, meaning it is done first. So var1 is set to 0, this is also a condition that triggers once and is done unless the layout is restarted.

    next going down it sees EveryTIck, Every Tick is a way to say "Always do this till I say stop" so every moment the game is running it is setting var1 to a random number between 0 and 9, it is also being rounded to a whole number. This event will continue to do its own thing without the program really having to do anything

    Next is a Function called "Boom" Since it has not had it triggered it skips it entirely

    Next is a condition seeing if var1 is equal to 5. It will bounce back in forth between the Everytick and this condition till the condition is meet. once var1=5 then the function is called and it skips straight to it. Note "Boom" is specific so you can have as many functions in a event sheet as you want and know that one trigger can do more than one action provided that each on function matches the string that the function is called

    Finally there is a exploding animation then the sprite is destroyed and then a sound fx is played in that order

    Events only matter what order they come in if they have either the same trigger. otherwise most of your event sheet will be inactive but c2 runs that checklist constantly till a condition is meet

    I hope this was helpfull

    CrazyVulcan

  • So far I think I have got the pure rear/above and front/above perspectives down, but still no idea how I could get the side angles working smoothly...

    Is there someway I can use Construct 2 to slowly warp between the 2 images when turning/cornering/rotating, so it gives the illusion of it being seen from a different angle/perspective?

    Thanks

    I assume that you are making a isometric tank. Not the easiest to do with just the free version of C2 but I will try. Attach a instance variable to your tank sprite, call it Direction. Then you need to have your tank sprite set up for using animation frames. Just the one animation for now but all it is an series of shots of your tank facing Right ie 0deg and have frames rotating around at 30deg increments. Basicly what we will be doing is change frame based on what direction we are moving. Now the fun part, set up a condition trees

    If Direction = 0 Then set frame for TankSprite.imageframe = 0

    If Direction = 30 Then set frame for TankSprite.imageframe = 1

    If Direction = 60 Then set frame for TankSprite.imageframe = 2

    If Direction = 90 Then set frame for TankSprite.imageframe = 3

    etc

    Really all that is left is making conditions for turning. Just Add +or- 30 to Direction for each mark of turning Left or Right. You can just have the sprite move along the same path as it is facing with little problem. By decreasing the size of the turn you can get smoother turning but you only have 100 events so space is precious.

    edit- One more thing

    Dont mistake Direction to be == to SpriteTank.Angel you are not actually rotating your sprite you are in fact just animating it to appear so. You can still use Direction for moving the spire with Move SpriteTank at angel = Direction

  • Have you looked into using functions? Use one function for each menu? and then call them independently.

  • That seems so much like it should work... but I must still be doing something wrong because after the first element (of 3) gets added, I get a Javascript error about being unable to read property 0 of undefined.

    My JSON looks like this (and it matches EXACTLY what I got when I hard-coded the values and output it using asJson):

    {
    	"c2array" : true,
    	"size" : [3, 1, 1],
    	"data" : [[["Item1"], ["Item2"], ["Item3"]]]
    }[/code:1yh3p4sx]
    
    I know this is stupid, but exactly how hard would it be to add a behavior for Selects that lets it import a 1D JSON array? I think this might be handy for other people as well. Keep in mind I'm somewhat experienced with JS but have never written a C2 plugin before.
    
    P.S. In your example, one of the dimensions is 0. Shouldn't that make the array have a net size of 0?
    
    EDIT: Ha! I got it to work by switching two dimensions in my size. From [3, 1, 1] to [1, 3, 1]. Thanks a ton.
    

    Your welcome, I should have mentioned that "size":[row,column,depth], sorry for the confusion.

  • CrazyVulcan

    hey I made this code

    "{""c2array"":true,""size"":[4,6,1],""data"":[[[""Click on the Blue""],[""Red#0""],[""Green#1""],[""Blue#2""],[""Yellow#3""],[2]],[[""Click on the number Two""],[""Two#4""],[""One#5""],[""Three#6""],[""Four#7""],[4]],[[""Click on the Star""],[""Circle#8""],[""Triangle#9""],[""Star#10""],[""Square#11""],[8]],[[""Click on the Purple""],[""Circle#12""],[""Triangle#13""],[""Star#14""],[""Square#15""],[13]]]}"

    the problem is, that the question number 4 doesn't want to appear. It's just showing 3QA

    please help me

    I don't suppose you would mind linking a Dropbox link to a .capax of what you are trying to do. From your example I am not really sure what you are trying to do or how you plan to use it in your game.

    Going back to my example in a game you would have your array and your screen will have four text boxes. You will also need a global variable to sort though the array. Just when you want the next question use "Set Value = random(0,10)" and then use that to call the needed row in your array.

    Then it is a matter of changing the text of each text object to the corresponding section of the array. You will also need to run a For Each loop where you "row# = Global Variable"

    If I find the time I will make a demo .capax to show you but it may be a day or two till I get to it.

  • For a array to load properly from a .json it needs to be formatted in a particular way

    {"c2array": true, "Size:"[2,3,0], "Data":[ [ ["Item Text 1"],["Item Text 2"],["Item Text 3"] ],[ ["Item Text 4"],["Item Text 5"],["Item Text 6"] ]]}

    Load that with Ajax.LastData and you are on your way.

    https://www.scirra.com/forum/why-can-c2-not-read-a-json-files-it-itself-makes-solved_t150889

    I ask much the same question recently.

  • Oh yeah, I think I actually saw it, but since I did not have the required plugin, it failed to open. I was at work, and already had spent to much time goofing around with Construct so I kept it for later then forgot all about it... D:

    Dont worry about it lol it's all good

  • If you had posted a capx, we would have seen it immediately. Just sayin'

    Third post my friend

    It was a edit in about 15min after the original post so it could have been easy to miss.

  • Indeed korbaach you are correct as it was I was trying to load json string immediately after calling it with out the n completed step, thank you.

  • Simplest way I can think to do trivia is build an array. With columns and as many rows as you need. You will need to either manually design the array with each item when the game starts but since this is potently a large array writing a JSON file would be simplest. If you are using windows a simple notepad file saved as UTF-8 and named like "MyTriviaList.json" Then in C2 right click on ProjectFiles and add new and save the .json file there.

    The JSON looks much like this

    {"c2array":true,"size":[2,4,1],"data":[
         [["This is the first question"],["A: This is answer A"],["B: This is answer B"],["C: This is answer C"]]
         [["This is the Second question"],["A: This is answer A"],["B: This is answer B"],["C: This is answer C"]]
    ]}
    [/code:ds556wwz]
    
    Then inside C2 use AJAX to load project file then on complete load your array from JSON using Ajax.LastData. Form then its more art and personal choice of design and I can not help you there.
    
    Best of luck
    
    ps "size":[row,column,depth] make sure that is the correct size or it will not work.
  • CrazyVulcan

    I am not sure the whole procedure of your case. You might post a very simple capx file or a screen shot of events.

    I guess that you had missing "condition:On completed" in Ajax object.

    I managed a work around but it could vary well be error on my part. The missing OnCompleat step could be what was wrong.

  • It's a stretch but try saving your text file in UTF-8 encoding... we never know ! Also, make sure to remove any trailing of leading characters from the file.

    Just resaved the project file for UTF-8 and tried both escaped and non escaped to no success

  • Are you using project files or inputing the string as a litteral ? If it's a litteral string, you need to escape double quotes with another double quotes. Otherwise it might be some kind of encoding problem...

    "{""c2array"":true,""size"":[3,3,1],""data"":[ [ [""Red""],[""Blue""],[""Blue""] ],[ [""Red""],[""Red""],[""Blue""] ],[ [""Green""],[""Green""],[""Blue""] ] ] }"

    Haveing done that I now It will work if I put it directly into Load From JSON but once Ajax get involved it will not work. I check the AJAX tool in debug and it will put the text exactaly as is from the project folder. So I really dont know.

    edit - here is a demo of what I am trying to do. Needs Rex-Board-Core plugin

    https://www.dropbox.com/s/ggoezgt1gdf8ipr/TileMapDemo.capx?dl=0