Narayana's Recent Forum Activity

  • I intend to have a lot of classes and units in my game with base stats and other variables. I then want the player to be able to get one of the classes, and as it gains exp and levels up, its stats changes.

    Hence it will use a lot of variables to keep track of base stats, and each instance.

    Whats the easiest way to keep track of this easily with C2 while working?

    A ton of arrays? Binding variables to sprites? From a veterans point of view, how do you go at it?

  • Do you perhaps still have that example, i cant download it because the link gives me a dead end ^^;

    Im trying to get something similar to what you described here to work, but i cant really grasp the concept of how to control a sprite with a specific ID of a touch.

  • Im trying to make a game work on my android tablet using cocoonJS, and while everything seems nice, im just having trouble figuring out how to have the game constantly knowing which touch is which.

    When searching around on the forums, I found something about problems with assigning touch IDs in some ways, but apart from that i didnt get much. I found something about moving blocks around but that wasnt simultaneous (And even so sort of bugged)

    What do i have to do to have one sprite follow the finger that touched it, and have another sprite follow the finger that touched it while the first finger is still holding?

    And when one object is released from touch, the other object shouldnt be affected at all.

    What i tried so far:

    * Drag & Drop: It works, but it makes it hard for me to control how fast the object is supposed to follow the finger (as in lerped movement speed) and other various movement-controls depending on other factors. Unless i can control Drag&Drop in advanced ways which i dont see.

    * When being touched, assigning a global variable the ID of the touch, and then set movement to the touch.XatID and YatID while still in touch. But this gives my objects some reeeeally strange behaviour just running off screen and stuff.

    However, i might just be really bad at figuring out how to use the touch id thingy, which is why i researched but didnt find much that helped me :/

    Any help appreciated as always, and sorry if this is covered somewhere i just didnt find yet.

    /Mike

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I want to be able to have things moving quite quickly, and most of the time it works well, but every 3 seconds or so, the fps dips (why im not sure of tho) and the bullet just skips past the wall that it may not pass :/ Sometimes the bullet isnt even really fast, and fps dips make it pass.

    I searched around and it seems quite hard to make it work, and im not sure if and how i can make a failsafe to bring the bullet back and bounce normally even if it skipped where it wasnt supposed to.

    Thanks~

  • Short follow-up question if you dont mind helping me understand the lerp and clamping a bit better? ^^;

    If i want to have a sprite follow the cursor over a grid, but lock into the middle of the square of which the cursor is currently over, should i go with your zone-system in some way, or is it easier to like:

    Each tick: Set <sprite> to Mouse.X(Magical math), Mouse.Y(Magical math) or something based on how big the grid is?

    Or something even simpler like "when mouse-over=gridtile, set <sprite> position to gridtile" and then just fill the grid with tile sprites?

  • Wow, thanks for the explanation, i think i actually understood it all. Im still a bit confused as to _how_ the lerp does what it does, but i understand the thought behind it ^^;; I think.

    And i see why it becomes more complex to use non-rectangular zones then :/

    Now im just brain-storming here so if this is more difficult than i thought please do tell me, but shouldnt it be possible somehow (with some more magical math perhaps :D) to have 3 zones overlapping, and have the scroll variable calculate only from the zone that you are inside the clamp area of?

    <img src="https://dl.dropboxusercontent.com/u/15195355/various%20crap/example4.png" border="0" /> (Schmexxeh photoshop skills~)

    So like, as long as the character is more inside of zone 1 than 2, it does the clamp-lerping based on zone1, but if the character is more inside 2 than 1, it switches the clamp-lerping to zone 2, but should (and here's where my logic might be flawed) technicly be in the same spot?

    But i just realized while writing this that even if my thinking works, it still is the problem with the corners you mentioned... err...

    Guess it might be best for me to keep this one based on your wonderful zone-system, and while i level up my math and C2-skills i might find a working solution that isnt advanced over my head ^^

  • Ahh i can look at your file now, and tho it seems really simple, things turned very mathematical, very quickly.

    I have a fairly ok grasp of how to use the engine in many basic ways, but i start to realize that im not really bound in what i want to do because of the engine, but because my mathematical skills are not up to the test. I guess i should try to evolve my mathematical skills so i can use all the lerp:ing, derp:ing and other values correctly ^^

    I loved the zone thing, tho i dont understand the math behind it clearly yet, i will look into it.

    If i could understand it, maybe i could create something like this (which is basicly what i was working on myself, but havent been able to get working fully):

    <img src="https://dl.dropboxusercontent.com/u/15195355/various%20crap/example2.PNG" border="0" />

    (Again, its a bit crude, but i hope my point is clear ^^;; )

    Basicly the purple box is my camera control item that has the "Scroll to" behaviour. The yellow box is the player. The lines are how im trying to get the object to simultaneously move. The red enclosure is again a theoretical place where i can only enter by the "door" and until then the camera wont go in.

    So im trying to keep the player free to move (except into the enclosure), while keeping the purple camera object locked by not being able to leave the blue area. I tried using some sort of pathfinding, but then i would have to use solid objects in strange ways, and that would stop my player as well in very strange ways.

    Is this system possible, or is using your zones the way i should try and create things? ^^

  • zatyka, that is what i was looking for yes! ^_____^

    I havent updated to r131 yet and my internet is pretty slow so it will take a while to check your capx it seems. Might have to sleep before i can look at it :<

    Its a huge leap forward compared to what i had accomplished myself, i really appreciate it ^^ Id really like it if it was possible to have like T-shaped zones as well connected to rectangular ones, but i guess that might be tricky?

  • Im not sure if my question was a bit confusing, but i dont really understand your answer compared to what i asked :<

    I dont want the camera to view outside of the layout, and im not sure what "set scroll to camera" means ^^; Rather than unbound, i want the camera super-bound and sort of on a rail :P

    <img src="https://dl.dropboxusercontent.com/u/15195355/various%20crap/example.PNG" border="0" />

    In the crude example created above, i want to be able to break up one single layout into several partitions, and want the camera to be able to scroll along the blue lines without line of sight leaking into the red enclosed area.

    And then when entering from the purple arrow, have the camera jump into the enclosure, but not be able to have the line of sight leaking out of the enclosure.

    I have an object (several objects in various tests actually) that keeps control of the camera already, im just not sure how to control it so it doesnt pan into "restricted" areas. Or rather, how to restrict areas in the first place in a way that stops the scrolling only into that area while still moving freely where there is no restriction.

    dl.dropboxusercontent.com/u/15195355/RikardRemake/index.html

    One system (NES-Zelda style, moves when you move to the edges)

    dl.dropboxusercontent.com/u/15195355/RikardRemake2/index.html

    The second system (Free-roaming camera)

    I sort of want to mix them so i have free-roaming except for the parts that are shut off, and when the enclosure in the picture i posted is entered, the camera goes in NES-Zelda style and stays in there. Which doesnt really work very well if i have to start switching layouts and stuff.

    Any hint is appreciated ^^;

  • I have tried finding several ways of doing this, searched the forum and looked at all the plugins, and maybe i have missed something but i dont get this to work.

    Basicly i want a movement-system in terms of Zelda: A Link to the past. In such a way that you can move around one square, and the camera doesnt go into the next square, until you actually enter that door or whatever.

    Now, i can do this (and have done this) easily when all rooms / camera-views are the same size. The problem comes when for example 3/4 of the layout is supposed to be one part, with the 4th part being alone.

    How to stop the camera from scrolling downwards while still scrolling right for example, even tho there's technicly still layout-space downwards as well? If i can just figure that out, the rest isnt much of a problem.

    I just need a way to "shut out" the camera from scrolling into certain areas, while still following the character as best as possible.

    Thanks in advance

    /Mike

  • Thanks for the link and the information, i have been thinking a bit and together with what you said i think i know how to go from here, much appreciated! ^^

  • This is partly a plea for help to make a mathematical algorithm rather than only Construct 2 based help. I always think from the wrong perspective when doing algorithms and end up making some really crazy stuff.

    What im doing right now is a sort of event-rolling algorithm that i want to be able to change the outcomes % by just changing numbers. I'll try to explain the problem as good as i can:

    Lets say i have 5 different levels of stuff that can happen, ranging from A,B,C,D,E. A being most common and E being extremely rare. And then make a roll to see which it becomes.

    Initially the roll has like a 7/10 to become A and 2/10 to become B, and a 1/10 to become C. But then i add a sort of luck+1 factor, and suddenly A is 6/10, B is 3/10 and C is 1/10. If i add another +1 luck factor, A becomes 5/10, B becomes 3/10 and C becomes 2/10. Another +1 makes A 4/10, B 3/10, C 2/10 and D 1/10. And the more luck factors are put in, the bigger chance for a better outcome.

    I did this initially with rolling a random 10, and A was 0-8, B was 9+, C was 13+, D was 16+ and so forth and so on. But i quickly realized this was an extremely flawed system, since if the luck factor became too high, the chance of it becoming A vanished completely which was something i didnt want.

    So basicly what im trying to figure out is how to calculate the chances in a good scaleable way, so as that when the higher level letters chance increases, the lower chances becomes smaller, but never dissapears completely.

    Also having specific luck factors to skew the results is also something i would like to have, like B-luck +2, which increases the chance of the B result by quite a bit, while only taking away % from letters that are already inside the chance scale.

    I havent played around much with weighting chance factors like this before, so im sorry if its either too easy or too hard for people to help me figure this out ^^;; The only things that come up in my head is some sort of system that takes the weights of all letters that have a variable of 1+ and then scale the % of each letter as a % of how many weights it has compared to all the weights on the scale. But im not sure how to implement that >_<

    Any help or hints are appreciated!

    /Mike

Narayana's avatar

Narayana

Member since 26 Oct, 2012

None one is following Narayana yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies