Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[FEATURE] 'Hit artifact with robo-part to try to activate it'-patch.
#1
(09-12-2014, 09:38 AM)Archenteron Wrote: Touch an artefact with cyborg arm replacement = Silicontouch
(01-25-2017, 10:27 PM)poland spring Wrote: Or you can just hit them with a damn cyborg arm it shouldn't be that hard

That I can make.
But I can't reliably spawn a silitouch artifact, so I can't properly test if this code works. Thx again Cirrial.
So here it is, please try it out, and leave feedback.

Notes:
  • Code compiles.
  • Code triggers if you hit an artifact with a robopart (Note that this doesn't include robo-butts). However...
  • every time '{you} activates the {robopart} and it reaches out to the artifact.', you will also '{you} hits the {artifact} with {robopart}! '. I couldn't quickly find a fix for this double down, so until I know for sure that the silitouch actually works, it a feature.
  • Fixed up the code, now it works fine. Holding an artifact in your hand and then clicking the artifact will touch it and activate the silitouch trigger if present.
Code:
Reply
#2
Artifact_attackby is called in an if statement by the attackby proc in the parent artifact obj. If Artifact_attackby returns 0, it does not call the contents in the if statement, which is the parent proc. The parent proc is what triggers the "you hit the artifact with thing" message. What you need to do is the same as has been done for stun batons, welders and zippos: return 0 at the end of the if check for robotic parts.

You can too reliably spawn a silitouch artifact. crossarms

1. Spawn an artifact. Probably best to do this using the artifact controller (Admin -> Secrets -> Artifact Controller)
2. Right click, View variables.
3. Select the artifact datum (should be a blue hyperlink that opens a new window)
4. Find triggers (should be a list of datums) and click it
5. Add a new item to the list (temporarily escapes me how) that is "new instance of a type"
5. The type you want is /datum/artifact_trigger/silicon_touch. 

Now the embarrassing part is I don't currently have the time or access to the stuff I need to test this process, this is half memory and half double checking the Github repo. This SHOULD more or less be the process to add silicon touch to an artifact's triggers, though.
Reply
#3
(01-27-2017, 04:35 AM)Cirrial Wrote: Now the embarrassing part is I don't currently have the time or access to the stuff I need to test this process, this is half memory and half double checking the Github repo. This SHOULD more or less be the process to add silicon touch to an artifact's triggers, though.

could also just spawn in the silicon touch artifact path
Reply
#4
(01-27-2017, 04:35 AM)Cirrial Wrote: ... return 0 at the end of the if check for robotic parts.
*facepalms. I should have spotted that right of the bat, I actually copied those lines to make this code. I should not code in a rush.
Code updated.

(01-27-2017, 04:35 AM)Cirrial Wrote: 1. Spawn an artifact. Probably best to do this using the artifact controller (Admin -> Secrets -> Artifact Controller)
...
Ah, yes, just log in as an Administrator. That is how you test things, not by playing as a player and then playing without admin access, like some halfwit.
...
So, how do I get logged in as Administrator? I tried adding my gamename to the '\config\names.txt' and recompiling, but I didn't get it to work.
Reply
#5
It's /config/admins.txt, and basically follow the format the other names in the file do.
Key thing to remember: your player key has to be in "canonical" form, which means all lowercase, no spaces or punctuation, so I imagine for you it'd be "thegrimsleeper".
Reply
#6
Right, thank you.
...
Right, cleaned the code, tested it, and yes now it work fine.
I'll update the original post 2.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)