Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Expression 2 v
« Previous 1 2 3 4 5 6 … 8 Next »
[Resolved] 7 and 8 Chevron Locks
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
[Resolved] 7 and 8 Chevron Locks
21-01-2016, 04:01 PM, (This post was last modified: 30-01-2016, 01:48 PM by Eli Wallace[FR].)
#1
Eli Wallace[FR] Offline
TSCM Member
***
Posts: 4
Threads: 3
Joined: Dec 2015
[Resolved] 7 and 8 Chevron Locks
So i was editing a CAP E2 (Stargate Chevron sound) and adding a AI named Riley. The AI tell each chevron is lock like this: "Chevron X is locked. Chevron X² is encoded.".
It's was easy for the 6 first chevron and the 9th chevron, but I'm having trouble dealing with the 7th and 8th chevron: I can't find a way to distinguish a Origin point lock (ending the dialling) or a normal lock. I try to mimic the orginal E2 code;
Code:
if(Chevron==7 & !Inbound & Chevron_Locked & Ch!=Chevron) { say("Chevron seven is lock!") } elseif(Chevron==7 & !Inbound & !Chevron_Locked & Ch!=Chevron) { say(" Chevron seven lock.") say(" Chevron eight encoded") }
But it didin't work. Ether the first one worked on a 8/9 chevron dial or nothing worked or the second one worked. It's like the E2 don't know what to do!
I tryed to edit stuff but in the end it don't work.
I'm gonna post here the whole code so you can get a look and see what's wrong.
Code:
# Created by AlexALX (c) 2011-2012 # For addon Stargate Carter Addon Pack # http://sg-carterpack.com/ # Chat Notification added by ELi Walace[FR] @name Stargate chevron sounds and Chat Notification @inputs Active Chevron Chevron_Locked Open Inbound @outputs @persist Inc Fail Ch A @persist [Name]:string @trigger #------------------------------------------------------------------------------------------------------------------------------------------------- function void say ([String]:string) { owner():soundPlay(999,3,"st/shuttlecraft/computer_respond.mp3") printColor(vec(100,230,200),"[Riley] ",vec(0,180,255),Name+": ",vec(230),String) } #------------------------------------------------------------------------------------------------------------------------------------------------- if (Active & !Open) { if(Chevron==1 & !Inbound & Ch!=Chevron) { soundPlay(0,2000,"stargate/walter/c1.mp3") } if(Chevron==2 & !Inbound & Ch!=Chevron) { soundPlay(0,2000,"stargate/walter/c2.mp3") } if(Chevron==3 & !Inbound & Ch!=Chevron) { soundPlay(0,2000,"stargate/walter/c3.mp3") } if(Chevron==4 & !Inbound & Ch!=Chevron) { soundPlay(0,2000,"stargate/walter/c4.mp3") } if(Chevron==5 & !Inbound & Ch!=Chevron) { soundPlay(0,2000,"stargate/walter/c5.mp3") } if(Chevron==6 & !Inbound & Ch!=Chevron) { soundPlay(0,2000,"stargate/walter/c6.mp3") } if(Chevron==7 & !Inbound & Chevron_Locked & Ch!=Chevron) { soundPlay(0,2000,"stargate/walter/c7_locked.mp3") say("Chevron seven is lock!") } elseif(Chevron==7 & !Inbound & !Chevron_Locked & Ch!=Chevron) { #soundPlay(0,2000,"stargate/walter/c7_short.mp3") soundPlay(0,2000,"alexalx/stargate/riley/c7_encoded.mp3") say(" Chevron seven lock.") say(" Chevron eight encoded") } if(Chevron==8 & !Inbound & Chevron_Locked & Ch!=Chevron) { soundPlay(0,2000,"stargate/walter/c8_locked.mp3") say("Chevron eight is lock!") } elseif(Chevron==8 & !Inbound & !Chevron_Locked & Ch!=Chevron) { #soundPlay(0,2000,"stargate/walter/c8.mp3") - not exists soundPlay(0,2000,"alexalx/stargate/riley/c8_encoded.mp3") say("Chevron eight is lock.") say("Chevron nine encoded") } if(Chevron==9 & !Inbound & Chevron_Locked) { #soundPlay(0,2000,"stargate/walter/c9_locked.mp3") - not exists soundPlay(0,2000,"alexalx/stargate/riley/bad/c9_lock.mp3") } elseif(Chevron==9 & !Inbound & !Chevron_Locked & Ch!=Chevron) { #soundPlay(0,2000,"stargate/walter/c8.mp3") - not exists soundPlay(0,2000,"alexalx/stargate/riley/c9_encoded.mp3") } if(Chevron==-7 & !Inbound & !Fail) { soundPlay(0,3000,"stargate/walter/c7_failed.mp3") Fail = 1 Ch = 6 } if(Chevron==-8 & !Inbound & !Fail) { #soundPlay(0,3000,"stargate/walter/c8_failed.mp3") - not exists soundPlay(0,3000,"alexalx/stargate/riley/bad/c8_failed.mp3") Fail = 1 Ch = 7 } if(Chevron==-9 & !Inbound & !Fail) { #soundPlay(0,3000,"stargate/walter/c9_failed.mp3") - not exists soundPlay(0,3000,"alexalx/stargate/riley/c9_failed.mp3") Fail = 1 Ch = 8 } if (Inbound & Chevron>0 & !Inc) { soundPlay(0,3000,"stargate/walter/unscheduled_offworld_activation.mp3") Inc = 1 } elseif (!Inbound & Chevron==0 & Inc) { Inc = 0 } if (Fail & !Chevron_Locked & Chevron>=0) { Fail = 0 } # Fix for DHD remove chev if (Chevron>0 & Chevron<=9 & !Chevron_Locked) { Ch = Chevron-1 } } else { Inc = 0 Fail = 0 } #------------------------------------------------------------------DEBUG STUFF----------------------------------------------------------------- if (Inbound==1) { A==1 } elseif (Inbound==0) { A==0 } #--------------------------------------------------------------CHAT-PRINT------------------------------------------------------------------------ if (Inbound==1 & Chevron==0 & Active==1 & Open==0 ) { say("Incomming wormhole!") } if (Active==1 & Inbound==0 ) { if (Chevron==0 & !Chevron_Locked & !Inbound & Ch!=Chevron) { say("Chevron one encoded") } if (Chevron==1) { say("Chevron one locked.") say("Chevron two encoded.") } if (Chevron==2) { say("Chevron two locked.") say("Chevron three encoded.") } if (Chevron==3) { say("Chevron three locked.") say("Chevron four encoded.") } if (Chevron==4) { say("Chevron four locked.") say("Chevron five encoded.") } if (Chevron==5) { say("Chevron five locked.") say("Chevron six encoded.") } if (Chevron==6) { say("Chevron six locked.") say("Chevron seven encoded.") } if (Chevron==-7) { say("Chevron seven will not lock!") } if (Chevron==-8) { say("Chevron eight will not lock!") } if (Chevron==9 & !Chevron_Locked & Ch!=Chevron & Open==0 ) { say("Chevron nine...") say("Chevron nine...") say("Chevron nine is lock!") } if (Chevron==-9 & Open==0 ) { say("Chevron nine...") say("Chevron nine...") say("Chevron nine will not lock!") } } if (Open==1 & Inbound==0 & Chevron>=7) { say("Wormhole stable") } if (Open==0 & Inbound==0 & Chevron<=-7) { say("Unable to open a stable wormhole!") }
Thanks for helping me!
Find
Reply
27-01-2016, 12:02 PM,
#2
Kosmos Offline
GMod Admin
Posts: 180
Threads: 3
Joined: Dec 2013
RE: [Help] 7 and 8 Chevron Locks
You could examine the "Chevrons" output of the stargate, if one of the digits changes you can handle that being locked/encoded.
Find
Reply
30-01-2016, 01:47 PM,
#3
Eli Wallace[FR] Offline
TSCM Member
***
Posts: 4
Threads: 3
Joined: Dec 2015
RE: [Help] 7 and 8 Chevron Locks
Thanks for the help but I managed to make it work after rewriting the whole E2 and playing with timers.
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


Users browsing this thread:
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.