YesNoOk

Recent Posts

    

Re: How to assign a variable a random integer

 May 24, 2018, 07:22:52 pm View in topic context
#1
 Posted by Jesuszilla  in How to assign a variable a random integer (Started by The_Eraser May 24, 2018, 03:35:21 pm
 Board: M.U.G.E.N Development Help

Yeah, VarRandom is better-suited for this sort of task, and it has more randomness than the Random trigger IINM.
    

Re: Random Topic V10

 May 24, 2018, 07:16:14 pm View in topic context
#2
 Posted by Bastard Mami  in Random Topic V10 (Started by Orochi Gill July 09, 2016, 05:00:44 am
 Board: All That's Left

    

Re: How to assign a variable a random integer

 May 24, 2018, 06:45:17 pm View in topic context
#3
 Posted by XGargoyle  in How to assign a variable a random integer (Started by The_Eraser May 24, 2018, 03:35:21 pm
 Board: M.U.G.E.N Development Help

Use VarRandom
    

Eternal Defense

 May 24, 2018, 06:29:53 pm View in topic context
#4
 Posted by Akito  in Eternal Defense (Started by Akito May 24, 2018, 06:29:53 pm
 Board: M.U.G.E.N Configuration Help

Hi, I making a CVS char, but, I have a problem:

In defense, the P2 hits the P1 and him don't move from place! 
This allows P2 to continue beating relentlessly until P1 gets 0 HP and loses the fight.

What do I need to change in CNS so that it can be solved?

Thanks for advice.
    

Re: Ikemen Plus

 May 24, 2018, 06:15:05 pm View in topic context
#5
 Posted by GaziraAgain  in Ikemen Plus (Started by ShinLucho November 20, 2017, 12:45:35 am
 Board: IKEMEN Releases

Good to read this! Mugen needs new functions in the system and fight files, I want to see what will be, and about the animated portraits it´s a good idea always that can do the palette selection with it please... Aproximative date for the go release? Thank you very much.
    

Re: Character of the Month: April 2018 Nominations

 May 24, 2018, 05:56:39 pm View in topic context
#6
avatar  Posted by GarfieldfanMUGEN  in Character of the Month: April 2018 Nominations (Started by Jmorphman May 16, 2018, 02:34:02 am
 Board: M.U.G.E.N Discussion

Android 18 by Ryon - 2
The Root Pack by Dark Ruler - 2
    

Re: How to assign a variable a random integer

 May 24, 2018, 05:42:55 pm View in topic context
#7
 Posted by altoiddealer  in How to assign a variable a random integer (Started by The_Eraser May 24, 2018, 03:35:21 pm
 Board: M.U.G.E.N Development Help

Just tried that and it didn't work. The player is always released after 1 struggle :(

This is because that snippet of code is picking a random number every tick (60 ticks per second), so it is very quickly picking "1"

For this, I would advise using another variable so it gets logged only 1 time.

Do you want to set a minimum/maximum amount of struggles?  Such as, must struggle 2 times / chance of triggering at 3-7 / definitely trigger at 8?

So what I'm suggesting would be:
Code:
[state 1004] ;pick random from 2-7
type = VarSet
trigger1 = !time
var(6) = Random%6 + 3

[state 1004] ;release
type = changestate
triggerall = numtarget
triggerall = target, alive
trigger1 = var(4) > 7 && var(5) = 1
trigger2 = var(4) = var(6) && var(5) = 1
trigger3 = roundstate = 3
value = 1012

Quick note, the way % (modulo) is typically used, like here, the range is one less than you might expect.
Random%6 means it would pick 0-5.  Slap a +2 on there and you have 2-7


Use Ctrl + F (SEARCH) to search the character's code for "var(6)".  If it finds something, that means the character is already using that variable for something else.
So you would then repeat for var(7), var(8), etc... until you find one that is not being used
    

Re: Random Topic V10

 May 24, 2018, 05:40:01 pm View in topic context
#8
 Posted by Mechy  in Random Topic V10 (Started by Orochi Gill July 09, 2016, 05:00:44 am
 Board: All That's Left

Finnish courts have always been pretty rubbish. This is a new low though.
    

Re: Random Topic V10

 May 24, 2018, 05:24:26 pm View in topic context
#9
 Posted by Ricepigeon  in Random Topic V10 (Started by Orochi Gill July 09, 2016, 05:00:44 am
 Board: All That's Left

    

Re: How to assign a variable a random integer

 May 24, 2018, 04:50:49 pm View in topic context
#10
avatar  Posted by The_Eraser  in How to assign a variable a random integer (Started by The_Eraser May 24, 2018, 03:35:21 pm
 Board: M.U.G.E.N Development Help

um...I guess I'll try, but that sounds a little outta my league

Edit: Yeah, that's way too advanced for me. I was hoping this could just be solved with a simple command, but if I'm gonna have to start creating new variables and stuff I think I just won't bother. It's just quite frustrating because it seems like something that should be simple
    

Re: How to assign a variable a random integer

 May 24, 2018, 04:47:17 pm View in topic context
#11
 Posted by Baby Bonnie Hood  in How to assign a variable a random integer (Started by The_Eraser May 24, 2018, 03:35:21 pm
 Board: M.U.G.E.N Development Help

var(4) is the one that counts the struggles, right?  Then try using another var to track the max number of struggles, as in use something like var(3) for the random number and then have var(4) check if it's equal to var(3).
    

Re: cvs2 Takuma arrange realease

 May 24, 2018, 04:35:43 pm View in topic context
#12
avatar  Posted by demongorne  in cvs2 Takuma arrange realease (Started by demongorne May 19, 2018, 11:54:44 am
 Board: Edits & Add-ons

    

Re: How to assign a variable a random integer

 May 24, 2018, 04:24:44 pm View in topic context
#13
avatar  Posted by The_Eraser  in How to assign a variable a random integer (Started by The_Eraser May 24, 2018, 03:35:21 pm
 Board: M.U.G.E.N Development Help

Just tried that and it didn't work. The player is always released after 1 struggle :(
    

Re: Ikemen Plus

 May 24, 2018, 04:22:18 pm View in topic context
#14
 Posted by adriano gt  in Ikemen Plus (Started by ShinLucho November 20, 2017, 12:45:35 am
 Board: IKEMEN Releases

I also support the animated portraits on the selection screen .... this is a big differential
It's great to see you're working on it yet.
thanks for the feedback
good luck and sucess
    

Re: Ada Wong ( Resident Evil)

 May 24, 2018, 04:20:05 pm View in topic context
#15
 Posted by Staubhold  in Ada Wong ( Resident Evil) (Started by FlavioCamarao February 28, 2018, 12:36:56 am
 Board: Projects

Nice.

IMO it would look better if the ganado villager walks to the impact zone. That standing still pose looks not so good...
    

Re: How to assign a variable a random integer

 May 24, 2018, 04:12:18 pm View in topic context
#16
 Posted by Fausto Mugen  in How to assign a variable a random integer (Started by The_Eraser May 24, 2018, 03:35:21 pm
 Board: M.U.G.E.N Development Help

var(4) = (Random % 16) + 1
    

MOVED: How to assign a variable a random integer

 May 24, 2018, 03:42:32 pm View in topic context
#17
avatar  Posted by The_Eraser  in MOVED: How to assign a variable a random integer (Started by The_Eraser May 24, 2018, 03:42:32 pm
 Board: Code Library

This topic has been moved to M.U.G.E.N Development Help.

[iurl]http://mugenguild.com/forum/topics/how-assign-variable-random-integer-183768.0[/iurl].html
    

Re: MVC Cyber Ken HI-RES by Scar & RAMON GARCIA & Yolomate

 May 24, 2018, 03:38:38 pm View in topic context
#18
 Posted by Ramon Garcia  in MVC Cyber Ken HI-RES by Scar & RAMON GARCIA & Yolomate (Started by Ramon Garcia May 24, 2018, 03:14:15 pm
 Board: Edits & Addons 1.0+

    

How to assign a variable a random integer

 May 24, 2018, 03:35:21 pm View in topic context
#19
avatar  Posted by The_Eraser  in How to assign a variable a random integer (Started by The_Eraser May 24, 2018, 03:35:21 pm
 Board: M.U.G.E.N Development Help

So, I'm working on a character that someone else has made, doing a few edits and tweaks to make it play a little better. One of this character's moves means that the other player has to struggle to get free. Every time they struggle, the struggle counter goes up by 1. Previously, when the struggle counter reaches 8, the player would be released. I thought this was a bit streamlined and wanted to be able to randomise the amount of struggles someone had to do before they could escape. My main issue is that most of what I have found on here tells you how to assign a variable a random number, but I want the number of struggles needed to escape to be random, rather than the number of struggles, if that makes any sense.

The main part of the code that I'm focussing on is this:
[state 1004] ;release
type = changestate
triggerall = numtarget
triggerall = target, alive
trigger1 = var(4) = 8 && (var(5) = 1)
trigger2 = roundstate = 3
value = 1012

Var(4) is the variable dealing with the number of struggles. Therefore, "trigger1 = var(4) = 8" is saying "when the amount of struggles reaches 8, they will be released". The 8 is therefore the integer that I want to be randomised but, pretty much all my methods have been unsuccessful. I have managed to find out how to generally make the integer random, simply by doing this: "trigger1 = var(4) = random". This provided me with a random number of struggles needed to escape, but I would really like to define the range of numbers that can be picked, 1-16. I have tried lots of different things and either the game will be unable to load the character or the other player is released instantly without struggling. If anyone has any idea how I can set it so that var(4) = a random integer between 1-16 that would be fantastic!

Also, I should mention that I'm new to this site and I am also not great with coding.
    

Re: MVC Cyber Ken HI-RES by Scar & RAMON GARCIA & Yolomate

 May 24, 2018, 03:33:03 pm View in topic context
#20
 Posted by BahamianKing Gaming  in MVC Cyber Ken HI-RES by Scar & RAMON GARCIA & Yolomate (Started by Ramon Garcia May 24, 2018, 03:14:15 pm
 Board: Edits & Addons 1.0+

very nice man! loving these hi-res chars!