IHate211's Recent Forum Activity

  • Thanks this is just what I wanted, you misplaced some characters but I got it to work properly:

    Edit:

    Although on a second thought I think I want to isolate just the content of the command ignoring the [command][/command] like in Dop2000's example

  • I wanted to try regex because it would let me do it in 1 line and I totally forgot about tokens, but this works fine thanks.

  • I want to isolate commands from a string I have multiple commands in the same string and thought that regex was the best choice to isolate them from a string:

    from:

    "Hello[command]function1[/command] how are you doing?[command]function2[/command]"

    to:

    index 1-"[command]function1[/command]"

    index 2-"[command]function2[/command]"

    Can someone tell how to achieve this result? I can't make it stop on the first command.

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

IHate211's avatar

IHate211

Member since 30 Sep, 2018

None one is following IHate211 yet!

Connect with IHate211

Trophy Case

  • 6-Year Club
  • Email Verified

Progress

7/44
How to earn trophies