Jump to content

Is there a code for "Teleports when attacked"


Prince143

Recommended Posts

"Writhe, Maxwells last Friend" has such a mechanic. I don't know how it works, but I'd guess somewhat like this:

1) Get the players position

2) Get walkable offset (I never got the hang of this part)

optional: pre3) Put a dustcloud effect at the players location

3) Transform player to new position

Link to comment
Share on other sites

"Writhe, Maxwells last Friend" has such a mechanic. I don't know how it works, but I'd guess somewhat like this:

1) Get the players position

2) Get walkable offset (I never got the hang of this part)

optional: pre3) Put a dustcloud effect at the players location

3) Transform player to new position

 

As you can see ... I know nothing at all in coding so it is impossible for me to understand those things xD

Link to comment
Share on other sites

local function repetitionteleport(inst)	local x2, y2, z2 = inst.Transform:GetWorldPosition()	local x, y, z = inst.Transform:GetWorldPosition()	x = x+math.random(-20, 20)	z = z+math.random(-20, 20)	inst.Transform:SetPosition(x,y,z)	if not inst:IsOnValidGround() then		inst.Transform:SetPosition(x2,y2,z2)		repetitionteleport(inst)	endend

make a listenforevent for that

Link to comment
Share on other sites

Didn't you just said you can't understand a thing?

It seems that you are asking someone to write the code for you and give it to you.

 

P.S. If you don't know about coding how are you making a character?

 

 

 

No that's not what I mean ... I am not making a character (that's impossible lol)

I am just experimenting and having fun with those custom characters and I not intend to release it in public.

Link to comment
Share on other sites

Learn Lua, I can't reccomend enough to anyone that they learn some kind of coding in their life, programming can be an extremely useful skill, both in the business world, and in the "I just wanna mess around with my games" world. Don't Starve is programmed in Lua (Partially in C++ if I remember correctly) so focus on learning that if you want to get into DS modding.

Also OOP.

Link to comment
Share on other sites

I agree with Blazingice, Lua is a light and rather easy to understand programming language. That makes hobby-programming, especially in an enviroment like Don't Starve (which is built up in a put-it-together way, like those magneto-stick toys :distracted:) very easy and interesting.

 

I wouldn't call it extremely useful, but understanding logical if-clauses, for instance, is useful in every field that has logic.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
×
  • Create New...