+ Reply to Thread
Page 3 of 6 FirstFirst 12345 ... LastLast
Results 21 to 30 of 52

Thread: E2 - Input Support

  1. #21
    Wire Sofaking ZeikJT's Avatar
    Join Date
    Dec 2008
    Location
    California
    Posts
    1,391

    Default Re: E2 - Input Support

    Alright, so I've updated the code quite a bit.
    I added that multi input string parser for the Listening and for the newly made Triggers (for both client and serverside keypresses).
    Example of triggers on the serverside:
    Code:
    @name 
    @inputs 
    @outputs I
    @persist 
    @trigger all
    if(first() | duped()){
    triggerForKey("forward")
    }
    if(keyDown("forward")){
    I+=1
    }
    Example of trigger with clientside listening:
    Code:
    @name 
    @inputs 
    @outputs I
    @persist 
    @trigger all
    if(first() | duped()){
    cListenForKey("a")
    cTriggerForKey("a")
    }
    if(cKeyDown("a")){
    I+=1
    }
    I tried to make the strings for the keys as intuitive as possible. Feel free to look through the code for them. Oh, and the multi register works like this:
    Code:
    @name Serverside
    @inputs 
    @outputs A S D W
    @persist 
    @trigger all
    if(first() | duped()){
    triggerForKey("forward,back,moveleft,moveright")
    }
    if(keyDown("forward")){
    W+=1
    }elseif(keyDown("back")){
    S+=1
    }elseif(keyDown("moveleft")){
    A+=1
    }elseif(keyDown("moveright")){
    D+=1
    }
    
    @name Clientside
    @inputs 
    @outputs A S D W
    @persist 
    @trigger all
    if(first() | duped()){
    cListenForKey("a,s,d,w")
    cTriggerForKey("a,s,d,w")
    }
    if(cKeyDown("a")){
    A+=1
    }elseif(cKeyDown("s")){
    S+=1
    }elseif(cKeyDown("d")){
    D+=1
    }elseif(cKeyDown("w")){
    W+=1
    }
    I still don't have it reset anything when you leave the server nor does it recognize when another chip needs to keep listening. Still, it's better now than it was on initial release. Expect another update soon.
    Last edited by ZeikJT; 04-15-2009 at 06:23 PM.
    Against stupidity the Gods themselves contend in vain.
    -Friedrich Schiller

    The flame puts me in the mood to "Do it!".
    -Dart, Legend of Dragoon

  2. #22
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default Re: E2 - Input Support

    Looking good, I think it's funny that you have forward and back, but left and right is called moveleft and moveright

    I'm not all that fond of the c-prefix, it doesn't really convey anything useful (sure it's "clientside", but it is not different from timers or other functionality that requires something to be initialized before use). I'd rather suggest perhaps calling cKeyDown = keyDown... and call keyDown=action/bind/buttonDown (or something like that) to signify that they aren't keyboard keys but rather actions/binds of the user, and to make them different from the other keyDown which is very different.

    Again, don't put listenForKey(etc) inside first(), as I said, without proper recovery code in your expression (which I perhaps should add support for), putting it inside first() will make dupes break.
    Last edited by Syranide; 04-04-2009 at 04:12 AM.

  3. #23
    Wire Sofaking ZeikJT's Avatar
    Join Date
    Dec 2008
    Location
    California
    Posts
    1,391

    Default Re: E2 - Input Support

    I used moveleft and moveright because they are actually different than left and right. Move left and move right are the strafing keys, whilst left and right are the ones I've never seen anyone use that just rotate the camera (like the mouse does). It's all in the gmod wiki under the IN_KEYS section. IN KEYS - GMod Wiki

    Hmmm, I thought the c-prefix would help solidify the fact that it's a clientside function and would hopefully make people aware that if they can use the regular serverside ones it would be better. Still, it's easy enough to rename them.

    Sorry about the first() part, I don't use adv dupes... like ever. Is there any way of detecting a just-duped E2? Hmm... I actually just thought of a way to do it using E2 functions that already exist. Next time I'll post the code with the dupe checker.

    Any suggestions for additions?
    Against stupidity the Gods themselves contend in vain.
    -Friedrich Schiller

    The flame puts me in the mood to "Do it!".
    -Dart, Legend of Dragoon

  4. #24
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default Re: E2 - Input Support

    Quote Originally Posted by ZeikJT View Post
    I used moveleft and moveright because they are actually different than left and right. Move left and move right are the strafing keys, whilst left and right are the ones I've never seen anyone use that just rotate the camera (like the mouse does). It's all in the gmod wiki under the IN_KEYS section. IN KEYS - GMod Wiki
    Ah, of course.

    Quote Originally Posted by ZeikJT View Post
    Sorry about the first() part, I don't use adv dupes... like ever. Is there any way of detecting a just-duped E2? Hmm... I actually just thought of a way to do it using E2 functions that already exist. Next time I'll post the code with the dupe checker.

    Any suggestions for additions?
    I was just going to add a "recovery"-callback, but I realized that it was quite a mouthfull to implement that. I have a patch working that adds the "recovery"-callback now, but I'm not entirely sure of the consequences of some of the changes just yet, so I'll have to ask some people to test to make sure it doens't break anything for people.

    I'll post it soon.

    Expression Gate 2 <-- there it is
    Last edited by Syranide; 04-04-2009 at 04:53 AM.

  5. #25
    Wirererer Blaylock1988's Avatar
    Join Date
    Apr 2009
    Location
    North Carolina
    Posts
    280

    Default Re: E2 - Input Support

    I am a bit lost in all of this. Is this some sort of lua addon for wiremod? I am looking for a way to use more keys than what the regular adv pod controller uses so I have more controls for my contraptions. Will this do what I am looking for?

    I am pretty new to E2, but I didnt know if E2 can record keystrokes from a vehicle.
    Last edited by Blaylock1988; 04-15-2009 at 04:32 PM. Reason: clarification

  6. #26
    Wire Sofaking ZeikJT's Avatar
    Join Date
    Dec 2008
    Location
    California
    Posts
    1,391

    Default Re: E2 - Input Support

    This should record keystrokes all the time, unless you open a chat and have the chat detection off, but only for clientside keys.

    The serverside keys should work all the time, though I might fix this eventually.

    It's an E2 addon. A few posts up I have example E2 code...
    My post.. it's up there too ^
    Against stupidity the Gods themselves contend in vain.
    -Friedrich Schiller

    The flame puts me in the mood to "Do it!".
    -Dart, Legend of Dragoon

  7. #27
    Wirererer Blaylock1988's Avatar
    Join Date
    Apr 2009
    Location
    North Carolina
    Posts
    280

    Default Re: E2 - Input Support

    Ok, so I need the lua file you put in your first post to make the new E2 commands that you gave examples of work?

  8. #28
    Wire Sofaking ZeikJT's Avatar
    Join Date
    Dec 2008
    Location
    California
    Posts
    1,391

    Default Re: E2 - Input Support

    Yep. It's not in the official svn.
    Just throw it in your wire\lua\entities\gmod_wire_expression2\core\custo m folder.

    Note, will only work in singleplayer unless the server has it too.
    Against stupidity the Gods themselves contend in vain.
    -Friedrich Schiller

    The flame puts me in the mood to "Do it!".
    -Dart, Legend of Dragoon

  9. #29
    Wirererer Blaylock1988's Avatar
    Join Date
    Apr 2009
    Location
    North Carolina
    Posts
    280

    Unhappy Re: E2 - Input Support

    Oh, darn. Is there any other way that you know of that will allow me to expand the button inputs of the adv pod controller? I just want to be able to have more controls in my contraptions. I would use your addon, but since the server must have it too, I can't use it often.

  10. #30
    Wire Sofaking ZeikJT's Avatar
    Join Date
    Dec 2008
    Location
    California
    Posts
    1,391

    Default Re: E2 - Input Support

    I have no idea, sorry. I never use the adv. pod controller.
    I'd suggest you either make a new thread in the help section and ask or you go on steam and ask around until you find a suitable answer (even if the answer is no)
    Against stupidity the Gods themselves contend in vain.
    -Friedrich Schiller

    The flame puts me in the mood to "Do it!".
    -Dart, Legend of Dragoon

+ Reply to Thread
Page 3 of 6 FirstFirst 12345 ... LastLast

Similar Threads

  1. G15 support
    By Hunter234564 in forum Ideas & Suggestions
    Replies: 10
    Last Post: 03-22-2009, 08:54 AM
  2. Life Support
    By willthemage in forum Installation and Malfunctions Support
    Replies: 8
    Last Post: 08-20-2008, 02:06 PM
  3. Replies: 16
    Last Post: 02-26-2008, 07:29 AM
  4. Extended LS2 Support
    By WhiskeyFur in forum Ideas & Suggestions
    Replies: 5
    Last Post: 12-20-2007, 05:29 PM
  5. Packet Support for Everything
    By Razara in forum Ideas & Suggestions
    Replies: 3
    Last Post: 07-26-2007, 05:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots