Pages: 1 [2]
  Print  
Author Topic: Help with confusion potion  (Read 1792 times)
gummybears123
Mossy
*
Posts: 5776


Yummy Gummy!


View Profile
« Reply #15 on: December 30, 2009, 12:15:00 PM »

Okay, instead of reversing the controls, I think it should be randomized
Logged

I made a rap.
It sounds dumb, like reading a map
I really should stop this thing before it goes too far
But I don't really car as long as I stay below the radar
Those big companies won't get me no
I'll get away before the fuzz show

-Most famous rapper of Mossmouth
Kirbylord
marsgreekgod
Big Bossy
Mossy
*
Posts: 9773


The will of the Galaxy.


View Profile WWW Email
« Reply #16 on: December 30, 2009, 12:33:14 PM »

same here
Logged

Show your power, Gun Del Hell! Show them their fate! Yes! Yes! Yes! Yes! Yes! Here we go! Let's go, go, go, go, Django! Light and Dark! It comes down to this! Be afraid, Sun!
Kegluneq
Big Bossy
Mossy
*
Posts: 2205



View Profile Email
« Reply #17 on: December 30, 2009, 12:35:14 PM »

Hmm good idea!
Randomizing the controls shouldn't be too hard either, just a little bit more complicated.
If you need help, feel free to ask.
Logged

A wild SHINY MOSSY appeared!
Delver
Bean
*
Posts: 161



View Profile Email
« Reply #18 on: December 30, 2009, 01:05:37 PM »

Would love some help  Grin

I am Currently Porting the mod to version 1.1 (of spelunky of course), when am done, shouldn't take to long, I'm going to upload the .gmk along with it.

My current version might actually be illegal, since the modified version is 1.0, and the License for modifying the Source seems to be from version 1.1.

I'm of course sorry if that's the case, and will pull down the illegal versions (Hint; Derek please tell if it is against the license).         

 
Logged
Kegluneq
Big Bossy
Mossy
*
Posts: 2205



View Profile Email
« Reply #19 on: December 30, 2009, 02:57:21 PM »

Hokay, let's see here...
There are nine controls total (4 directional, jump, action, switch, bomb, and rope) not including purchase.
So let's create a temporary variable to hold on to each of the controls' actual values. But to make things easier later on, we'll put them in a list. We'll call it...
Code:
keyActual = ds_list_create();
ds_list_add(keyActual, global.keyUpVal);
ds_list_add(keyActual, global.keyDownVal);
etc.
Let's also make another list for randomly assigning each key its new value. It'll be the exact same as the previous list, at least for now:
Code:
keyUsed = ds_list_create();
ds_list_add(keyUsed, global.keyUpVal);
ds_list_add(keyUsed, global.keyDownVal);
etc.
Now to make each control randomized, we'll shuffle the second list (yay for GameMaker's built in methods!):
Code:
ds_list_shuffle(keyUsed);
Now to assign our new values, we'll set up a for loop:
Code:
for(i=0; i<=8; i+=1)
{
    global.keyUpVal = ds_list_find_value(keyUsed, i);
}
Obviously, all declarations, should go in the create event, and the shuffle and loop should go where the potion is being drunk.

To put everything back to normal, just use:
Code:
for(i=0; i<=8; i+=1)
{
    global.keyUpVal = ds_list_find_value(keyActual, i);
}
Give this a shot and tell me if you have any trouble.
Logged

A wild SHINY MOSSY appeared!
Delver
Bean
*
Posts: 161



View Profile Email
« Reply #20 on: December 30, 2009, 03:36:33 PM »

wow thanks, Might take me quit some time to implement (pretty new to gamer maker (coding in general really))

But that shuffle function sure seems nice  Smiley

If you would - feel free to mess a round with my potion mod, the .gmk is in the tread for it.

and thanks for the pointers  Tongue   
Logged
Kegluneq
Big Bossy
Mossy
*
Posts: 2205



View Profile Email
« Reply #21 on: December 30, 2009, 06:31:27 PM »

No problem!
Logged

A wild SHINY MOSSY appeared!
gummybears123
Mossy
*
Posts: 5776


Yummy Gummy!


View Profile
« Reply #22 on: December 30, 2009, 08:11:56 PM »

Are you randomizing bombs and ropes too?
Logged

I made a rap.
It sounds dumb, like reading a map
I really should stop this thing before it goes too far
But I don't really car as long as I stay below the radar
Those big companies won't get me no
I'll get away before the fuzz show

-Most famous rapper of Mossmouth
Kirbylord
Delver
Bean
*
Posts: 161



View Profile Email
« Reply #23 on: January 01, 2010, 12:24:50 PM »

finally, I'm on track  Grin

under Scripts:
             Platform Engine:
                             charactorStepEvent

Got the direct mappings for the keys, this is going to be a cake walk  Grin

Thanks for the help ^^   
Logged
Pages: 1 [2]
  Print  
 
Jump to: