Multiple buttons event and new drawmethod

Bloodbane

Well-known member
I'm trying to make key press event which takes 2 buttons i.e attack and attack2 button. It didn't work unfortunately :( (it didn't crash though).

What is the best way to do that then?

Another question: is new drawmethod accessible via script?
 
I've scripted it by checking hold value of X when when Y key triggers the press event. Technically it means you have to hold one button while pressing the other, but in practical terms you really can't tell the difference at all.

Would be nice to have this built in though, but I'll be the first to admit the key interface portion of the engine makes my head spin. There is also the issue that every time someone even breathes on the interface code it gets bugged to all creation. :o

DC
 
About your 2nd question, yes. Though some things are different.

For example, channels are 0~255 instead of 0-1.0.

 
Technically it means you have to hold one button while pressing the other, but in practical terms you really can't tell the difference at all.

Well, there's a significant difference actually. I can tell the difference since I have to hold the 1st button before pressing the 2nd button.
When I tried to press both button simultaneously instead, it doesn't work.

@utunnels: how to set tint with script? I want to make blink effect by modifying tint.
 
An example:

Code:
changedrawmethod(ent, "reset", 1); //reset just in case

....

changedrawmethod(ent, "intmode", 3);
changedrawmethod(ent, "tintcolor", rgbcolor(100,0,100));

...

changedrawmethod(ent, "flag", 0); //turn off

Then you need to spawn an effect entity to control your target entity, for example, you can name it blinker or something.

 
Would just like to say I am really loving the tint feature. It's so nice not to need remaps for hit burn/shock etc. any more. Just bind a hit effect, slap a tint on it and reset when the effect is killed. Done!

Would you care to provide some documentation to the new drawmethod features though? or point to where it is? Right now it seems we just have to experiment.

DC
 
http://www.chronocrash.com/forum/index.php?topic=145.msg943#msg943

There's one note here.

 
Ah yes! it works great! thanks utunnels :)

BTW I noticed some bug with script based drawmethod: it also affects icons displayed with drawsprite function.

I don't understand why this could happen since the drawmethod is applied to player entities only.
 
It shouldn't.

Maybe you can double check that if you have used setdrawmethod or changedrawmethod with a NULL parameter, which means global setting.

For example, when player is dead, player entity will also be NULL.
 
Bloodbane said:
Well, there's a significant difference actually. I can tell the difference since I have to hold the 1st button before pressing the 2nd button.
When I tried to press both button simultaneously instead, it doesn't work.

I don't know if you thought of this already, but it is very difficult to press two buttons at exactly the same time. For a more user-friendly approach, you'd have to check if the two buttons were pressed within a very short time of each other (e.g. 20 milliseconds).
 
Maybe you can double check that if you have used setdrawmethod or changedrawmethod with a NULL parameter, which means global setting.

Ah you're right! the script is also applied to 2nd player which is not present when the script is run.

For a more user-friendly approach, you'd have to check if the two buttons were pressed within a very short time of each other (e.g. 20 milliseconds).

Yeah, I realized that's must be the reason keyscript failed. As for that suggestion, let me think where to set the timer.
 
You can check boss case, press A while B is held, press B while A is held.

Avoid timer unless you have a constant frame rate, for example, on certain consoles, it has only 10 fps, making certain input hard to do (i.e, attackback).
 
Ah, thanks to God! finally after some trial n error, I got it working. I might need to adjust time interval a bit but it works great! Thanks for the tip Roel! :)
 
Back
Top Bottom