IHate211's Forum Posts

  • I know about those expressions but what I wasn't concerned about the dice roll but the drop chance every object has. I also want the decimals for comparing.

    I already read your post but in concept, they work just the same you just added a step before to see which bag of items had every enemy which is one of the many ways for dropping items.

    but let's say I want to drop equipment from your example:

    -I have 100/6 chances to get an owl

    -from that 100/6 I have a 15% chance to drop something

    -That chance is then divided equally between the number of objects on the bag (rarity=bag)

    -so 15%/6 chances to drop equipment per roll

    If I'm not wrong (I suck at math so probably) equipment has a 0,41% chances to drop.

    If I want to add a 25% chances to drop to the equipment it's not as easy as adding 25 to its rarity It just makes it drop on more enemies, but that's not what I want.

    Think of it as If you opening a pack on a game of cards: common(52%), rare(44%), epic(4%).

    and I want to add a 20% boost to rare chances because of an item or skill.

    roll<=obj1_drop_rate

    else roll<=(obj1_drop_rate + obj2_drop_rate)

    else roll<=(obj1_drop_rate + obj2_drop_rate)+ obj3_drop_rate

    roll<=4

    else roll<=44

    else roll<=100

    That's what the math on the first post was for, substracting drop chance from the other objects depending on their drop chance.

    I don't need to make tables for that, and I can certainly just do it as I've been doing it until now I was just curious about if there are better ways to do it.

    I probably can't explain myself properly sorry.

  • Until now I've been using random(101) combined with <= >= to get my drop rates but unless I'm missing something they are a bit nonintuitive because the "rates" I compare the roll to are not the real %

    variable to random(101)

    roll<=5 |object1

    else roll<=15 |object2

    else roll<=46 |object3

    else roll<=75 |object4

    But the real rates are : 5%, 10%, 31%, 29%

    is there any other way to do this that is more straight forward because if the percentages have decimals and the numbers are dynamic it gets confusing really quickly

    I also want to make the drop rates dynamic, so you can add or subtract drop rate from the objects

    let's say I want to add a 25% chance to the object3

    object3 has 10% chance to drop

    what I did was:

    divide 10 between the number of objects.

    and add it to the other objects drop chance

    now divide the result for the sum of all the objects drop rates

    (maybe you only have 2 drops and have low ratios so it doesn't add up to 100 like on my example)

    now I multiply for the amount of chance I wanted to add to object3's drop chance and subtract the result to the other objects%

    so now every object got reduced depending on their drop chance% of the drop chance added to object3

    So is there any better ways to do this?

  • Wow, this is great! also easily customizable I played around with it and made some modifications to fit my project better, first I made 12 bars instead of 15 for convenient storage in the array where I have all the month's information so I can associate every bar with a month and just save the data.height with their corresponding month to use the formula. It makes the curve less accurate but It's not a big deal.

    But since I was fascinated by the graph I played around while trying to understand the maths ended up adding tracking for the days displaying all the information for each day as the dot moves at increments of graphwidth/365 days.

    https://www.dropbox.com/s/9606sl492rrtv5j/custom_curve_mod.capx?dl=0

    The dot moves to 365 positions representing the days of the year, I don't know why but there's sometimes a weird 0,01 window of error on the temperature value from using the keyboard or the play bottom vs using the mouse.

    Anyway, thanks Rojo awesome tricks Learnt a lot!

  • You do not have permission to view this post

  • Thanks for answering Rojo I ended up with this for calculating every day's temperature:

    cosp(-12,28,(DayCount%(365+leapyear))*1.8/(365+leapyear))

    I ended up with 1.8 from just testing trying to get the temperatures I wanted in the right months.

    As it is it could work but I'm wondering how could I make it so higher temperatures have more "priority"?

    I don't know the correct term, make lower temperatures last less than the higher temperatures.

    Thanks in advance.

  • I'm trying to set temperatures for every day and I would like to make a sine that helps me add or subtract temperature from every day with a given max and min temperatures. It doesn't need to be an accurate representation of a real-world scenario it works for me if it's mirrored and simple.

    Something like this:

    How can I make a formula to create that sine?

  • I don't know if I'm really dumb or what but I'm not able to make the "no selectable" work I tried the combinations that could make a difference like: Read-only, Disabled, Context Menu off, but I can still select the text while holding click and dragging the mouse over the text. Changing the option with events or on the property panel doesn't seem to make any difference, in this case, "select all text" works fine.

    What am I missing?

  • bump

    I'm just looking for a general orientation, not a specific way can someone help me?

  • I wanted to create my own cheat menu inside the game to test out things on the spot.

    The one I created is working out of 5 variables and an array.

    The problem is that not all submenus work the same way, some have confirmation boxes, inputs, or have more depth than others.

    This is my menu:

    dropbox.com/s/ejfp08nv94kfhfi/debugmenuv2.capx

    There are various Submenus but right now only this paths are implemented:

    Add>Add Item>Number of Items to add

    Savefile>Slots>Save/Load>Name slot (Load is not implemented)

    Don't worry about them not working I just plugged this from my project and it's missing all the functions that make them work properly, all I care is about how to make a better menu system that is adaptable.

    If you're interested and want to take your hands on to your head, this is how mine is working

    Variables:

    - ConfigMenu: This variable acts like a boolean it goes 1 if the menu has inputs and 0 if not.

    - ActiveMenu: This variable acts when an option on a submenu is selected this keeps track of it.

    - MenuLvl: Since the menu has limited keybindings I need this one so construct knows what to do with every

    key on different levels.

    - DebugMenus: This is a string which holds all the submenus of the selected MenuNumber

    - MenuNumber: It's a number that goes from 1 to the number of tokens at the DebugMenu string With the Up and Down Arrows

    I pop and push the names of the selected submenus into the array, to be able to back to the previous menu.

    after a while all this variables became really bothersome, having events for every submenu + their lvls etc it looks as messy as it sounds I'm also using text position and others to keep track of the options and I don't feel like that's a really good way to do it, so I was wondering how you would approach this kind of menu, thanks beforehand.

  • This doesn't work the way you want in fact it works the other way around but just in case you didn't know there's this Ashley's tutorial about"Continuous Preview"

    Again not what you wanted but it can come in handy at times.

  • Idk why the local variables wouldn't work were they at static mode? They work on my end...

    I like the wave effect but what I was trying to do was to implement it only on the digits that changed, so for example, if I added 100 coins only the 3 first digits would jump, but not immediately first the numbers would start rolling until they caught up.

    But I like the small delay you added on yours so the numbers take turns to jump instead of jumping at the same time when they update I'll try to emulate that idea thanks. I'll keep working on it if I come up with something I'll update this post.

    Edit:

    I've achieved what I wanted but the formula is hardcoded, I would like to have some kind of formula that let me control how long would it take for the digits to update depending on the amount to add, as it's now it works but I guess I'll try to polish it a bit more, especially the speed at which the numbers update I would like to space more the time between update so you can distinguish the number, I think it has something to do with the "For each" If I add a delay on top of that only the first digit will update

    Updated Capx With LiteTween:

    dropbox.com/s/irha9lmwy7kb0zn/Animated%20Counter%20LiteTween%20Version%20V.2.capx

  • Different tile or different tile position? either way, you could save that data after clicking in a variable and compare on click to the one you're currently on if it's the same as your variable ignore the command.

  • I'm working on a Money counter since I wanted to animate every digit separately I ended up turning the Money Integral into a String and using "len", and "mid" (which can only be used on strings) to display the correct value for every SpriteFont.

    More recently I wanted every digit to not just change to the correct one, but to update the digit's value as it increased until reaching the total value. I was able to accomplish the task but since I just started "programming" I would like to hear the opinion of more experienced users, I was also trying to implement a lerp expression so if I were to add 1 Million Coins I won't have to wait for years until the digits caught up, but it's not working properly as it's now. Do I even need a function? Since I can't use it to update digits because it does everything in 1 tick and it won't look like an animation?

    I'm using the plugin LiteTween for the jumping animations, has nothing to do with the main problem (If I'm doing something wrong related to that please just say so)

    Here are my capx, There's a version with and without LiteTween:

    dropbox.com/sh/gsqcxalkd0822r4/AAAJFiDNDnjfuTQPg22Tbvsea

    P.D: Ignore The add and subtract parameters I probably don't need them.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads