Salut à tous,
Ce code est pour SB3 et les serveurs de Space age, comme je doute que quelqu'un utilise les deux, je partage quand même mon code source de mon écran EGP V3 qui affiche toute les ressources disponibles, avec la gravité, l'o2, etc... C'est pas une version complete car il y a encore quelques trucs à fixé, en fait, je le poste surtout pour que tous le monde puisse voir que le E2 c'est pas si dûr que ça.
Voici mon code :
@name Ice Mining Ship
@inputs E:wirelink Energy MaxEnergy Water MaxWater Oxygen MaxOxygen Cycle Mineral
@inputs Steam MaxSteam Nitrogen MaxNitrogen Laser Freezer TotalMass Kmph O2 CO2 Temperature Gravity WaterPump
@inputs DarkGlitter MaxDarkGlitter
@outputs ClimateRegulator FusionGenerator H2OSplitter SteamTurbines
@persist EnergyPercent WaterPercent OxygenPercent SteamPercent NitrogenPercent
@persist DarkGlitterValue
@trigger
- Begin
- Very important, with that, you just have to spawn the E2
- On the EGP 3 Screen and it works.
if(first()){
entity():isWeldedTo():makeWirelink()
E=entity():isWeldedTo():getWirelink()
E:egpClear()
}
- #########################################
- #########################################
- Titles - Begin
- #########################################
- #########################################
- Creating the box 1
E:egpBox(3,vec2(225,175),vec2(700,150))
E:egpColor(3,vec(140,140,140))
- Creating the box 2
E:egpBox(6,vec2(225,320),vec2(700,80))
E:egpColor(6,vec(140,140,140))
- Creating the box 3
E:egpBox(9,vec2(225,453),vec2(700,410))
E:egpColor(9,vec(140,140,140))
- #########
- Main title
- #########
- Gradient effect
E:egpBox(1,vec2(265,20),vec2(430,40))
E:egpAngle(1,0)
E:egpColor(1,vec(160,0,0))
- Text of the title
E:egpText(2,"Ice Mining Ship EGP ", vec2(130,3))
E:egpFont(2, "arial", 34)
- #########
- Resources Informations
- #########
- Gradient effect
E:egpBox(4,vec2(240,85),vec2(700,32))
E:egpAngle(4,0)
E:egpColor(4,vec(160,0,0))
- Text of the title
E:egpText(5,"Resources Informations ", vec2(120,70))
E:egpFont(5, "arial", 30)
- #########
- Other Informations
- #########
- Gradient effect
E:egpBox(7,vec2(240,230),vec2(700,32))
E:egpAngle(7,0)
E:egpColor(7,vec(160,0,0))
- Text of the title
E:egpText(8,"Other Informations ", vec2(165,215))
E:egpFont(8, "arial", 30)
- #########################################
- #########################################
- Titles - End
- #########################################
- #########################################
- #########################################
- #########################################
- Resources Informations - Begin
- #########################################
- #########################################
- #########
- Conditions + Automatism
- #########
- It makes a box RED or GREEN for show if enabled/disabled
if(ClimateRegulator == 1) {
E:egpText(23,"Climate ", vec2(380,108))
E:egpBox(12,vec2(490,115),vec2(40,25))
E:egpColor(12,vec(0,160,0))
}
else{
E:egpText(23,"Climate ", vec2(380,108))
E:egpBox(12,vec2(490,115),vec2(40,25))
E:egpColor(12,vec(160,0,0))
}
- ##########
if(Laser == 1) {
E:egpText(26,"Laser ", vec2(380,142))
E:egpBox(13,vec2(490,150),vec2(40,25))
E:egpColor(13,vec(0,160,0))
}
else{
E:egpText(26,"Laser ", vec2(380,142))
E:egpBox(13,vec2(490,150),vec2(40,25))
E:egpColor(13,vec(160,0,0))
}
- ##########
if(Freezer == 1) {
E:egpText(27,"Freezer ", vec2(380,170))
E:egpBox(14,vec2(490,185),vec2(40,25))
E:egpColor(14,vec(0,160,0))
}
else{
E:egpText(27,"Freezer ", vec2(380,170))
E:egpBox(15,vec2(490,185),vec2(40,25))
E:egpColor(15,vec(160,0,0))
}
- #########
- Converting resources to percent
- #########
EnergyPercent = floor(Energy/MaxEnergy*100)
WaterPercent = floor(Water/MaxWater*100)
OxygenPercent = floor(Oxygen/MaxOxygen*100)
SteamPercent = floor(Steam/MaxSteam*100)
NitrogenPercent = floor(Nitrogen/MaxNitrogen*100)
- #########
- Show informations
- #########
E:egpText(20,"Energy : "+EnergyPercent+" % - "+Energy+"/"+MaxEnergy, vec2(5,100))
E:egpText(21,"Water : "+WaterPercent+" % - "+Water+"/"+MaxWater, vec2(5,120))
E:egpText(22,"Oxygen : "+OxygenPercent+" % - "+Oxygen+"/"+MaxOxygen, vec2(5,140))
E:egpText(24,"Nitrogen : "+NitrogenPercent+" % - "+Nitrogen+"/"+MaxNitrogen, vec2(5,160))
E:egpText(25,"Steam : "+SteamPercent+" % - "+Steam+"/"+MaxSteam, vec2(5,180))
- #########
- Changing FONT
- #########
E:egpFont(20, "arial", 25)
E:egpFont(21, "arial", 25)
E:egpFont(22, "arial", 25)
E:egpFont(24, "arial", 25)
E:egpFont(25, "arial", 25)
- #######################
E:egpFont(23, "arial", 21)
E:egpFont(26, "arial", 21)
E:egpFont(27, "arial", 21)
- #########################################
- #########################################
- Resources Informations - End
- #########################################
- #########################################
- #########################################
- #########################################
- Other Informations - Begin
- #########################################
- #########################################
- #########
- Credits value
- #########
DarkGlitterValue = floor(DarkGlitter*7.78)
- #########
- Show informations
- #########
E:egpText(29,"Total mass of your ship : "+TotalMass, vec2(5,250))
E:egpText(30,"Kmph : "+Kmph, vec2(5,270))
E:egpText(31,"Dark Glitter : "+DarkGlitter+"/"+MaxDarkGlitter, vec2(5,290))
E:egpText(32,"O2 : "+O2, vec2(5,310))
E:egpText(33,"CO2 : "+CO2, vec2(5,330))
E:egpText(34,"Cycle : "+Cycle+"%", vec2(5,350))
E:egpText(35,"Mineral: "+Mineral, vec2(5,370))
E:egpText(28,"Credit you will got for your actual mining : "+DarkGlitterValue+" Millions", vec2(5,490))
- #########
- Changing FONT
- #########
E:egpFont(28, "arial", 21)
E:egpFont(29, "arial", 22)
E:egpFont(30, "arial", 22)
E:egpFont(31, "arial", 22)
E:egpFont(32, "arial", 22)
E:egpFont(33, "arial", 22)
E:egpFont(34, "arial", 22)
E:egpFont(35, "arial", 22)
E:egpFont(36, "arial", 22)
E:egpFont(37, "arial", 22)
- #########################################
- #########################################
- Other Informations - End
- #########################################
- #########################################
- #########################################
- #########################################
- Automatism - Begin
- #########################################
- #########################################
if(WaterPercent == 100) { FusionGenerator = 1 } else { FusionGenerator = 0}
if(OxygenPercent > 10 & EnergyPercent > 60){ ClimateRegulator = 1 } else { ClimateRegulator = 0 }
if(WaterPump == 1) { FusionGenerator = 1 }
if(WaterPercent >= 40 & WaterPump == 1) { H2OSplitter = 1 } else { H2OSplitter = 0 }
if(WaterPercent >= 10 & WaterPump == 1) { SteamTurbines = 1 } else { SteamTurbines = 0 }
- #########################################
- #########################################
- Automatism - End
- #########################################
- #########################################
- Credits
E:egpText(80,"By Dannyssj4", vec2(10,40))
E:egpFont(80, "arial", 22)
- End
Et mon topic dédié sur le forum SA :
http://spaceage.eu/index.php?/topic/778-ice-mining-e2-egp/
Enjoy 