Data Realms Fan Forums http://45.55.195.193/ |
|
Custom control issues http://45.55.195.193/viewtopic.php?f=73&t=17081 |
Page 1 of 1 |
Author: | Darlos9D [ Sun Nov 08, 2009 9:23 pm ] |
Post subject: | Custom control issues |
Obviously you can do stuff with UInputMan in order to find out if keys are being pressed. Now, is there some way to figure out which player is pressing the key? I'm having an issue where pressing the melee button I've set up makes it activate for multiple players. Now that I think about it, I could probably just set up different keys for different players, which would probably make more sense anyway. Still, just for curiosity's sake, I'm asking my question anyway. |
Author: | TheLastBanana [ Sun Nov 08, 2009 11:18 pm ] |
Post subject: | Re: Custom control issues |
Well, the problem here is, how would the game know which player is pressing it? The game assumes that there is only one keyboard. |
Author: | Lizardheim [ Sun Nov 08, 2009 11:45 pm ] |
Post subject: | Re: Custom control issues |
It could check who moves when a certain button is pressed, then figure out if that's red or green. |
Author: | Darlos9D [ Sun Nov 08, 2009 11:46 pm ] |
Post subject: | Re: Custom control issues |
TheLastBanana wrote: Well, the problem here is, how would the game know which player is pressing it? The game assumes that there is only one keyboard. Haaaaaaaaaa... good point. Okay, time to change the subject a bit before I feel too dumb. What does everyone think is the most efficient way to set up new controls that can be customized by the user? My current solution is to make a settings.ini that defines some simple null particles, each one representing a different control. You set the mass of each particle equal to the ID for the key you want. Then in the game, actors that rely on those custom controls have in their script some stuff that creates these particles somewhere out of the way and then reads their mass to find out whether or not a key does something. This is useful since it also lets players change keys in-game with the command line, by finding the particle and changing its mass. I swear a while back somebody somewhere suggested something simpler, but I fail to recall what it was. |
Author: | Duh102 [ Sun Nov 08, 2009 11:51 pm ] |
Post subject: | Re: Custom control issues |
Could you do a "Press the button you want to use for..." MOSParticle popup, linked in script to the mass thing? |
Author: | Darlos9D [ Mon Nov 09, 2009 6:04 am ] |
Post subject: | Re: Custom control issues |
It needs to be persistent between instances of the game. And the interface for changing the keys in-game isn't really what I'm asking about. What I'm wondering is if anybody has any other ideas for storing the keys for the long-term. My idea works, but it feels a tad convoluted. Then again, considering what I have to work with, maybe convoluted is the best I can do. |
Author: | 411570N3 [ Mon Nov 09, 2009 7:01 am ] |
Post subject: | Re: Custom control issues |
Can you just check the line from settings.ini? |
Author: | Grif [ Mon Nov 09, 2009 7:44 am ] |
Post subject: | Re: Custom control issues |
Not in any way that'd be any less complicated than actually packing in a file I/O library. You'd have to have a file reader specifically check settings.ini, either through a batch file or lua i/o, and have it spit out another file for CC to check against. At that point, you might as well have a specifically created and modified file. But uh, yeah, not having any I/O is pretty limiting to longterm stuff. I'd ask Data, but I can fully appreciate why he didn't include it. That said, limiting it to the same .rte shouldn't be too hard. |
Author: | Darlos9D [ Mon Nov 09, 2009 2:59 pm ] |
Post subject: | Re: Custom control issues |
Well, I guess I'll stick with my method then. What would be CC modding without awkward shenanigans? |
Author: | CaveCricket48 [ Mon Nov 09, 2009 10:46 pm ] |
Post subject: | Re: Custom control issues |
You could say something like "if my actor is player number 2 and this button is pressed, I'm going to make this happen." TLB has a player checking code in his Mind Control Orb, but I can't make sense of it. |
Author: | TheLastBanana [ Tue Nov 10, 2009 4:08 am ] |
Post subject: | Re: Custom control issues |
In theory that works, but in practice, it really doesn't. You have one keyboard. How does it know who pushed which button? Let's say you're using the button "I". It is not associated with either player. How does the game know whether it was player 1 who reached over and pushed it or player 2? Simple answer: it doesn't. Anyway, to get an actor's controlling player, actor:GetController().Player works just fine. |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |