Mutantraces (help pls)

How, what and why to code in BYOND.
Post Reply
GoldenPotatoes
Joined: Fri Apr 18, 2014 6:01 pm

Mutantraces (help pls)

Post by GoldenPotatoes » #300

I'm learning how2into byond code (with literally 0 experience), and for some reason I decided the best choice was to make robo-people.

Image

So far all I have is a working race with the sprites and a custom attack verb for fists (clonk).

Currently trying to figure out how to make them talk more like cyborgs

Code: Select all

if(dna)
			if(dna.mutantrace == "lizard")
				if(copytext(message, 1, 2) != "*")
					message = replacetext(message, "s", stutter("ss"))

			if(dna.mutantrace == "fly")
				if(copytext(message, 1, 2) != "*")
					message = replacetext(message, "z", stutter("zz"))

			if(dna.mutantrace == "robot")
				if(copytext(message, 1, 2) == "?")
					message = "queries, \"[text]\"";
				if(copytext(message, 1, 2) == "!")
					message = "declares, \"[text]\"";
				if(copytext(message, 1, 2) == ".")
					message = "states, \"[text]\"";
I don't know why it isn't working because it produces no warnings or errors when compiling.
This side-bit is meant to help understand what Im doing so like, any tips or facts would be p cool.

Also, if a better place for these kind of questions is on the IRC it'd be good to know for future reference.
User avatar
Numbers
Joined: Wed Apr 16, 2014 10:40 am

Re: Mutantraces (help pls)

Post by Numbers » #305

Well that's relatively simple. See the reason that if(copytext(message, 1, 2) != "*") is getting checked is whether what the mob sends is an emote.

What you need is to do is check at the end of the string for such characters. Structured maybe like this

Code: Select all

	if(dna.mutantrace == "robot")
		if(copytext(message, 1, 2) != "*")
			var/robottextend = lentext(T)
			if(copytext(message, robottextend, 0) == "?")
				message = "queries, \"[text]\"";
			if(copytext(message, robottextend, 0) == "!")
				message = "declares, \"[text]\"";
			if(copytext(message, robottextend, 0) == ".")
				message = "states, \"[text]\"";
"I've told you about Erro, I've warned you dwag." - Unknown
ImageImageImage
GoldenPotatoes
Joined: Fri Apr 18, 2014 6:01 pm

Re: Mutantraces (help pls)

Post by GoldenPotatoes » #346

Code: Select all

if(dna.mutantrace == "robot")
				if(copytext(message, 1, 2) != "*")
					var/robottextend = lentext(T)
					if(copytext(message, robottextend, 0) == "?")
						message = "queries, \"[text]"";
					if(copytext(message, robottextend, 0) == "!")
						message = "declares, \"[text]"";
					if(copytext(message, robttextend, 0) == ".")
						message = "states, \"[text]"";
						return
Brings up errors about an expected expression and unterminated text.

Maybe I should find a tutorial to understand this better.
User avatar
Numbers
Joined: Wed Apr 16, 2014 10:40 am

Re: Mutantraces (help pls)

Post by Numbers » #347

Right because instead

Code: Select all

var/robottextend = lentext(T)
It should be
var/robottextend = lentext(message)
"I've told you about Erro, I've warned you dwag." - Unknown
ImageImageImage
User avatar
Kraso
Joined: Thu Apr 17, 2014 3:46 pm
Byond Username: S0ldi3rKr4s0
Github Username: Kraseo

Re: Mutantraces (help pls)

Post by Kraso » #385

>starting with mobcode
what the fuck are you doing
Image
Incoming
Github User
Joined: Tue Apr 15, 2014 11:41 pm
Byond Username: Incoming
Github Username: Incoming5643

Re: Mutantraces (help pls)

Post by Incoming » #405

Yeah I hope you understand what you're getting yourself into here. This is like learning to drive by becoming a stuntman.
Developer - Datum Antags: Feburary 2016

Poly the Parrot - All Seeing Bird Transcends Universe, Joins Twitter.

Kofi - Make A Poor Life Choice

Good ideas backed by cruddy code since 2012!
User avatar
Remie Richards
Joined: Thu Apr 17, 2014 7:11 pm
Byond Username: CrimsonVision
Location: England, UK, Earth, Sol, Milky Way, Local Group, Virgo Supercluster, Known Universe
Contact:

Re: Mutantraces (help pls)

Post by Remie Richards » #407

Could have started off worse, The Horrors of Say code.
私は完璧
User avatar
MrSnapwalk
Joined: Fri Apr 18, 2014 8:28 pm
Byond Username: MrSnapwalk

Re: Mutantraces (help pls)

Post by MrSnapwalk » #790

I would like to thank you personally for delving into the horrors of mobcode in order to create what may be the greatest mutantrace known to spaceman-kind.
Petethegoat wrote:we need to procedurally generate asses so they can actually be used as evidence
JStheguy wrote:Being a closet serial killer is not polite, helpful, truthful, or clean.
I am the last of the moderators for the /NT/station subforums. Please don't PM me any questions, comments, or complaints, because there is nothing I can do about them.
Post Reply

Who is online

Users browsing this forum: No registered users