+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Egate2 Wirelink

  1. #1
    Wirererer Jarviar's Avatar
    Join Date
    Apr 2008
    Posts
    164

    Default Egate2 Wirelink

    I made these two egates with thwe purpose of a entity selector i cant get the wirelink to work correctly so if you have the spare time give me a hand.
    Code:
    @name EntSelector(EntInput)
    @inputs A:entity B:entity C:entity D:entity E:entity F:entity G:entity H:entity
    @inputs I:entity J:entity 
    @inputs EntExtensionOut:wirelink
    @persist Av Bv Cv Dv Ev Fv Gv Hv Iv Jv
    @persist Out_A:entity Out_B:entity Out_C:entity Out_D:entity Out_E:entity Out_F:entity Out_G:entity Out_H:entity Out_I:entity Out_J:entity
    
    interval(10)
    
    Out_A = A
    Out_B = B
    Out_C = C
    Out_D = D
    Out_E = E
    Out_F = F
    Out_G = G
    Out_H = H
    Out_I = I
    Out_J = J
    
    EntExtensionOut:setEntity("EntA", Out_A)
    EntExtensionOut:setEntity("EntB", Out_B)
    EntExtensionOut:setEntity("EntC", Out_C)
    EntExtensionOut:setEntity("EntD", Out_D)
    EntExtensionOut:setEntity("EntE", Out_E)
    EntExtensionOut:setEntity("EntF", Out_F)
    EntExtensionOut:setEntity("EntG", Out_G)
    EntExtensionOut:setEntity("EntH", Out_H)
    EntExtensionOut:setEntity("EntI", Out_I)
    EntExtensionOut:setEntity("EntJ", Out_J)
    
    if(Out_A:health() > 0) {Av = 1}else {Av = 0}
    if(Out_B:health() > 0) {Bv = 1}else {Bv = 0}
    if(Out_C:health() > 0) {Cv = 1}else {Cv = 0}
    if(Out_D:health() > 0) {Dv = 1}else {Dv = 0}
    if(Out_E:health() > 0) {Ev = 1}else {Ev = 0}
    if(Out_F:health() > 0) {Fv = 1}else {Fv = 0}
    if(Out_G:health() > 0) {Gv = 1}else {Gv = 0}
    if(Out_H:health() > 0) {Hv = 1}else {Hv = 0}
    if(Out_I:health() > 0) {Iv = 1}else {Iv = 0}
    if(Out_J:health() > 0) {Jv = 1}else {Jv = 0}
    
    EntExtensionOut:setNumber("EntNum", Av + Bv + Cv + Dv + Ev + Fv + Gv + Hv + Iv + Jv)
    Max = (Av + Bv + Cv + Dv + Ev + Fv + Gv + Hv + Iv + Jv)
    Code:
    @name EntSelector(Main)
    @inputs EntExtensionA:wirelink EntExtensionB:wirelink EntExtensionC:wirelink EntExtensionD:wirelink
    @inputs Up Down
    @outputs Entity:entity EntNum Max
    @persist AA:entity AB:entity AC:entity AD:entity AE:entity AF:entity AG:entity AH:entity AI:entity AJ:entity
    @persist BA:entity BB:entity BC:entity BD:entity BE:entity BF:entity BG:entity BH:entity BI:entity BJ:entity
    @persist CA:entity CB:entity CC:entity CD:entity CE:entity CF:entity CG:entity CH:entity CI:entity CJ:entity
    @persist DA:entity DB:entity DC:entity DD:entity DE:entity DF:entity DG:entity DH:entity DI:entity DJ:entity
    @persist AA_N AB_N AC_N AD_N AE_N AF_N AG_N AH_N AI_N AJ_N
    @persist BA_N BB_N BC_N BD_N BE_N BF_N BG_N BH_N BI_N BJ_N
    @persist CA_N CB_N CC_N CD_N CE_N CF_N CG_N CH_N CI_N CJ_N
    @persist DA_N DB_N DC_N DD_N DE_N DF_N DG_N DH_N DI_N DJ_N
    @persist MaxA MaxB MaxC MaxD
    
    interval(10)
    
    AA = EntExtensionA:entity("EntA")
    AB = EntExtensionA:entity("EntB")
    AC = EntExtensionA:entity("EntC")
    AD = EntExtensionA:entity("EntD")
    AE = EntExtensionA:entity("EntE")
    AF = EntExtensionA:entity("EntF")
    AG = EntExtensionA:entity("EntG")
    AH = EntExtensionA:entity("EntH")
    AI = EntExtensionA:entity("EntI")
    AJ = EntExtensionA:entity("EntJ")
    
    BA = EntExtensionB:entity("EntA")
    BB = EntExtensionB:entity("EntB")
    BC = EntExtensionB:entity("EntC")
    BD = EntExtensionB:entity("EntD")
    BE = EntExtensionB:entity("EntE")
    BF = EntExtensionB:entity("EntF")
    BG = EntExtensionB:entity("EntG")
    BH = EntExtensionB:entity("EntH")
    BI = EntExtensionB:entity("EntI")
    BJ = EntExtensionB:entity("EntJ")
    
    CA = EntExtensionC:entity("EntA")
    CB = EntExtensionC:entity("EntB")
    CC = EntExtensionC:entity("EntC")
    CD = EntExtensionC:entity("EntD")
    CE = EntExtensionC:entity("EntE")
    CF = EntExtensionC:entity("EntF")
    CG = EntExtensionC:entity("EntG")
    CH = EntExtensionC:entity("EntH")
    CI = EntExtensionC:entity("EntI")
    CJ = EntExtensionC:entity("EntJ")
    
    DA = EntExtensionD:entity("EntA")
    DB = EntExtensionD:entity("EntB")
    DC = EntExtensionD:entity("EntC")
    DD = EntExtensionD:entity("EntD")
    DE = EntExtensionD:entity("EntE")
    DF = EntExtensionD:entity("EntF")
    DG = EntExtensionD:entity("EntG")
    DH = EntExtensionD:entity("EntH")
    DI = EntExtensionD:entity("EntI")
    DJ = EntExtensionD:entity("EntJ")
    
    if(AA:health() > 0) {AA_N = 1}else {AA_N = 0}
    if(AB:health() > 0) {AB_N = 1}else {AB_N = 0}
    if(AC:health() > 0) {AC_N = 1}else {AC_N = 0}
    if(AD:health() > 0) {AD_N = 1}else {AD_N = 0}
    if(AE:health() > 0) {AE_N = 1}else {AE_N = 0}
    if(AF:health() > 0) {AF_N = 1}else {AF_N = 0}
    if(AG:health() > 0) {AG_N = 1}else {AG_N = 0}
    if(AH:health() > 0) {AH_N = 1}else {AH_N = 0}
    if(AI:health() > 0) {AI_N = 1}else {AI_N = 0}
    if(AJ:health() > 0) {AJ_N = 1}else {AJ_N= 0}
    
    if(BA:health() > 0) {BA_N = 1}else {BA_N = 0}
    if(BB:health() > 0) {BB_N = 1}else {BB_N = 0}
    if(BC:health() > 0) {BC_N = 1}else {BC_N = 0}
    if(BD:health() > 0) {BD_N = 1}else {BD_N = 0}
    if(BE:health() > 0) {BE_N = 1}else {BE_N = 0}
    if(BF:health() > 0) {BF_N = 1}else {BF_N = 0}
    if(BG:health() > 0) {BG_N = 1}else {BG_N = 0}
    if(BH:health() > 0) {BH_N = 1}else {BH_N = 0}
    if(BI:health() > 0) {BI_N = 1}else {BI_N = 0}
    if(BJ:health() > 0) {BJ_N = 1}else {BJ_N= 0}
    
    if(CA:health() > 0) {CA_N = 1}else {CA_N = 0}
    if(CB:health() > 0) {CB_N = 1}else {CB_N = 0}
    if(CC:health() > 0) {CC_N = 1}else {CC_N = 0}
    if(CD:health() > 0) {CD_N = 1}else {CD_N = 0}
    if(CE:health() > 0) {CE_N = 1}else {CE_N = 0}
    if(CF:health() > 0) {CF_N = 1}else {CF_N = 0}
    if(CG:health() > 0) {CG_N = 1}else {CG_N = 0}
    if(CH:health() > 0) {CH_N = 1}else {CH_N = 0}
    if(CI:health() > 0) {CI_N = 1}else {CI_N = 0}
    if(CJ:health() > 0) {CJ_N = 1}else {CJ_N= 0}
    
    if(DA:health() > 0) {DA_N = 1}else {DA_N = 0}
    if(DB:health() > 0) {DB_N = 1}else {DB_N = 0}
    if(DC:health() > 0) {DC_N = 1}else {DC_N = 0}
    if(DD:health() > 0) {DD_N = 1}else {DD_N = 0}
    if(DE:health() > 0) {DE_N = 1}else {DE_N = 0}
    if(DF:health() > 0) {DF_N = 1}else {DF_N = 0}
    if(DG:health() > 0) {DG_N = 1}else {DG_N = 0}
    if(DH:health() > 0) {DH_N = 1}else {DH_N = 0}
    if(DI:health() > 0) {DI_N = 1}else {DI_N = 0}
    if(DJ:health() > 0) {DJ_N = 1}else {DJ_N= 0}
    
    MaxA = (AA_N + AB_N + AC_N + AD_N + AE_N + AF_N + AG_N + AH_N + AI_N + AJ_N)
    MaxB = (BA_N + BB_N + BC_N + BD_N + BE_N + BF_N + BG_N + BH_N + BI_N + BJ_N)
    MaxC = (CA_N + CB_N + CC_N + CD_N + CE_N + CF_N + CG_N + CH_N + CI_N + CJ_N)
    MaxD = (DA_N + DB_N + DC_N + DD_N + DE_N + DF_N + DG_N + DH_N + DI_N + DJ_N)
    Max = (MaxA + MaxB + MaxC + MaxD)

  2. #2
    Wire Tutor chinoto's Avatar
    Join Date
    Apr 2008
    Location
    Brooklyn Park, MN. Lost my thumbdrive yet again...
    Posts
    1,983

    Default Re: Egate2 Wirelink

    I don't think wirelink works between two E-gates. I may be wrong, so try something simple with wirelink and two E-gates and see if it works.
    (\__/) Expression 2 Resources: E2 Beginner's Guide | E2 Formatting Guide | E2 Function Reference | E2 Examples | Me
    (='.'=) PM me code and I'll send it back optimized if possible. (I find it fun dammit!)
    (")_(") Drunkie referring to an E2: "It's obvious that Chinoto made this, his coding style is all over it."

  3. #3
    Wirererer Jarviar's Avatar
    Join Date
    Apr 2008
    Posts
    164

    Default Re: Egate2 Wirelink

    I thought it was for communication between e gates. If not they need to make something for that.

  4. #4
    Wire Sofaking Azrael's Avatar
    Join Date
    Aug 2007
    Posts
    1,946

    Default Re: Egate2 Wirelink

    Quote Originally Posted by Jarviar View Post
    I thought it was for communication between e gates. If not they need to make something for that.
    It's for communication between an E2 gate and other components using only one wire.

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

    Default Re: Egate2 Wirelink

    Wirelink _can_ be used to communicate between two gates, just like any other gate, but it might not be exactly what you think. "basic" wirelink is just another way of communicating with less wires, it is not different in any way.

  6. #6
    Wirererer Mechanical433's Avatar
    Join Date
    Mar 2007
    Posts
    221

    Default Re: Egate2 Wirelink

    Code:
    @name Test    
    @inputs Gyro:wirelink
    @outputs Tp Tr
    @persist Roll Pitch
    
    Tp = Gyro:number(Pitch)
    Tr = Gyro:number(Roll)
    It's been a long time since I came here.
    Can you tell me why this doesn't work ?

    It's just a simple test to see how the expression use the wirelink,I read the doc's but can't figure it out...

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

    Default Re: Egate2 Wirelink

    Quote Originally Posted by Mechanical433 View Post
    Code:
    @name Test    
    @inputs Gyro:wirelink
    @outputs Tp Tr
    @persist Roll Pitch
     
    Tp = Gyro:number(Pitch)
    Tr = Gyro:number(Roll)
    It's been a long time since I came here.
    Can you tell me why this doesn't work ?

    It's just a simple test to see how the expression use the wirelink,I read the doc's but can't figure it out...
    It requires strings and not variables

    Code:
    Tp = Gyro:number("Pitch")
    Tr = Gyro:number("Roll")

  8. #8
    Wirererer Mechanical433's Avatar
    Join Date
    Mar 2007
    Posts
    221

    Default Re: Egate2 Wirelink

    Thanks a lot :P, I was whoring this thread in hope of a answer.

  9. #9
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    6,009

    Default Re: Egate2 Wirelink

    Quick question:
    Can wirelink read and change the values of a variable in another EG2 @persists?

    Sorry, I can't make a simple test for myself since I don't have Gmod here.
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That

    Quote Originally Posted by Anticept View Post
    By the way, Bull is in charge.

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

    Default Re: Egate2 Wirelink

    Quote Originally Posted by l3ulletje View Post
    Quick question:
    Can wirelink read and change the values of a variable in another EG2 @persists?

    Sorry, I can't make a simple test for myself since I don't have Gmod here.
    Nope, wirelink is _only_ a substitute for regular wires, it doesn't offer any additional functionality.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. NPC functions - Egate2
    By Bobsymalone in forum Wiremod Addons & Coding
    Replies: 50
    Last Post: 10-30-2009, 09:15 AM
  2. Right click functionality (egate2)
    By mjmr89 in forum Ideas & Suggestions
    Replies: 11
    Last Post: 01-23-2009, 06:49 PM
  3. E2 wirelink
    By Split in forum Expression 2 Discussion & Help
    Replies: 3
    Last Post: 01-04-2009, 05:13 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