Search found 141 matches

by TeTpaAka
Thu Jun 25, 2015 13:06
Forum: Modding Discussion
Topic: [Help] Writing a Field Of View scanner
Replies: 19
Views: 4311

Re: [Help] Writing a Field Of View scanner

For player:get_look_yaw, it works with my formula. Could it be, that for entities, the yaw has another reference point?
Anyway, could you try flipping x and z (again, sorry).
It seems to be :

Code: Select all

       90
180 ------- 0
       90
When it should be:

Code: Select all

       0
90 ------- 90
      180
by TeTpaAka
Thu Jun 25, 2015 12:20
Forum: Modding Discussion
Topic: [Help] Writing a Field Of View scanner
Replies: 19
Views: 4311

Re: [Help] Writing a Field Of View scanner

My code is correct. But you have to invert the order in vector.subtract. To get the direction from one point to the other, you need to subtract the origin from the target, so vector.subtract(pos2, pos1) should return the right vector. The 90- has to be removed and the formula in yaw2vec reverted to ...
by TeTpaAka
Tue Jun 23, 2015 22:17
Forum: Modding Discussion
Topic: Custom inventory that behaves the same as the craft output.
Replies: 6
Views: 1015

Re: Custom inventory that behaves the same as the craft outp

Strange. For me, the code works as expected. It prints "output is empty" until I put something in "in" and triggers allow_take and on_take when I take something. Though I had to add "default" as a dependency, so it doesn't override the inventory formspec. And you are ri...
by TeTpaAka
Sun Jun 21, 2015 18:53
Forum: Modding Discussion
Topic: Custom inventory that behaves the same as the craft output.
Replies: 6
Views: 1015

Re: Custom inventory that behaves the same as the craft outp

If it is in a node definition, you can use allow_metadata_inventory_put on the input field and use the elements of the inventory to call get_craft_result(). You can put the output in the output slot and then, with allow_inventory_take, you can decrement the input if someone takes the craft result.
by TeTpaAka
Sun Jun 21, 2015 12:39
Forum: Modding Discussion
Topic: [Help] Writing a Field Of View scanner
Replies: 19
Views: 4311

Re: [Help] Writing a Field Of View scanner

You'd replace yaw2vec to a function that also takes the pitch to set the y value: local function yaw2vec(yaw, pitch) pitch = pitch or 0 return { x = math.cos(yaw) * math.cos(pitch), z = math.sin(yaw) * math.cos(pitch), y = math.sin(pitch) } end Edit: Fixed the code. You have to multiply x and z by m...
by TeTpaAka
Sun Jun 21, 2015 10:54
Forum: Modding Discussion
Topic: [Help] Writing a Field Of View scanner
Replies: 19
Views: 4311

Re: [Help] Writing a Field Of View scanner

You need to convert the yaw to a vector and determine the vector between the two positions. If you got that, you need to measure the angle between the two vectors: local function yaw2vec(yaw) return { x = math.cos(yaw), z = math.sin(yaw), y = 0 } end Oh, it was that easy? Thanks! The yaw is the ang...
by TeTpaAka
Sun Jun 21, 2015 10:13
Forum: Modding Discussion
Topic: [Help] Writing a Field Of View scanner
Replies: 19
Views: 4311

Re: [Help] Writing a Field Of View scanner

You need to convert the yaw to a vector and determine the vector between the two positions. If you got that, you need to measure the angle between the two vectors: local function yaw2vec(yaw) return { x = math.cos(yaw), z = math.sin(yaw), y = 0 } end local function dotproduct(v1, v2) if v1 and v2 th...
by TeTpaAka
Sat Jun 20, 2015 11:20
Forum: Partly official engine development
Topic: Environment::getTimeOfDay Always returning same value
Replies: 1
Views: 768

Re: Environment::getTimeOfDay Always returning same value

https://github.com/Bremaweb/minetest/bl ... ance.h#L28
You probably want a pointer to the environment instead of a hard copy.

Also my compiler complains about the use of c++11. If you want this code to be included to the main codebase, you should avoid c++11.
by TeTpaAka
Tue Jun 09, 2015 17:14
Forum: Mod Releases
Topic: [Mod] Painting [0.8] [painting]
Replies: 53
Views: 26155

Re: [Mod] Painting [painting] [0.8]

NewColor.R = (Color1.R * Color2.R)/255
NewColor.G = (Color1.G * Color2.G)/255
NewColor.B = (Color1.B * Color2.B)/255
Further down in the answer.
by TeTpaAka
Tue Jun 09, 2015 16:08
Forum: Mod Releases
Topic: [Mod] Painting [0.8] [painting]
Replies: 53
Views: 26155

Re: [Mod] Painting [painting] [0.8]

Hybrid Dog wrote:l could make it possible to use any colour from #000000 to #ffffff but l don't know exactly how to mix the colours:
#00f and #ff0 need to become #0f0 and not #fff
That's the difference between subtractive and additive colour mixing. Try this.
by TeTpaAka
Sat May 30, 2015 16:32
Forum: Mod Releases
Topic: [Mod] Player Effects [1.2.1] [playereffects]
Replies: 35
Views: 21406

Re: [Mod] Player Effects [1.1.1] [playereffects]

@TeTpaAka: No. Unless I update this mod, of course (sorry for late answer). But I am not sure what exactly you want here. For example: A player gets hit by a spell that makes him blind for 20 seconds. After 5 seconds, he gets hit again, this time with a spell that blinds him for 5 seconds. This spe...
by TeTpaAka
Tue May 26, 2015 19:32
Forum: Mod Releases
Topic: [Mod] Advanced area protection [areas]
Replies: 218
Views: 130681

Re: [Mod] Advanced area protection [areas]

CWz wrote:is it possible for a mod to get area id? or owner name
Take a look at api.lua.

Code: Select all

areas:getAreasAtPos(pos)
or

Code: Select all

areas:getNodeOwners(pos)
seem to be what you want.
by TeTpaAka
Sun May 24, 2015 20:32
Forum: Modding Discussion
Topic: How to get undeclared global variable warning on interface?
Replies: 12
Views: 2305

Re: How to get undeclared global variable warning on interfa

There's one case where I don't like the warning. Sometimes when creating a namespace you don't want to depend on the order of execution. So you might write this in two or more different places: namespace = namespace or {}; namespace.var = ...; function namespace.func() ... end; I'd be nice to diffe...
by TeTpaAka
Thu May 21, 2015 12:31
Forum: Modding Discussion
Topic: Post your modding questions here
Replies: 4208
Views: 572946

Re: Post your modding questions here

I have a tool that places a node, a marker and an arrow, however I want the arrow to point in the direction that the user is pointing when they use the tool. I have the node set so if you place it directly all works as it should, but when using it as a tool it doesn't. Is this possible, am I just m...
by TeTpaAka
Sun May 17, 2015 17:36
Forum: WIP Games
Topic: [Game] Fractured [0.01] [WIP]
Replies: 148
Views: 40364

Re: [Game] Fractured [0.01] [WIP]

Thanks to a recent minetest pull from TeTpeAka the next major problem in fractured has been solved! You will need the newest version of minetest for this to work. But wildweapons now uses register_on_punchplayer and it makes the whole process of controlling where players can damage each other trivi...
by TeTpaAka
Sun May 17, 2015 17:06
Forum: Deutsch
Topic: PvP in gewissen Zonen deaktivieren
Replies: 6
Views: 1375

Re: PvP in gewissen Zonen deaktivieren

Hier habe ich eine kleine Beispielmod geschrieben:
https://github.com/TeTpaAka/save_spawn
Damit es funktioniert musst du nur in den oberen Zeilen die obere und die untere Ecke der Spawnregion angeben. (Drücke F5 ingame damit du die Koordinaten erfährst).
by TeTpaAka
Sun May 17, 2015 16:20
Forum: Modding Discussion
Topic: Idea: Isolated mobs
Replies: 30
Views: 4391

Re: Idea: Isolated mobs

It could be a little problematic that there are multiple different backends. There are, at least: simple mobs by Pilzadam (+some forks that don't change the api much) mobs redo by TenPlus1 creatures by BlockMen creatures by MirceaKitsune ... (probably some more) The difficulty isn't the amount of ba...
by TeTpaAka
Sat May 16, 2015 21:57
Forum: Modding Discussion
Topic: Capture player punch() event
Replies: 10
Views: 1581

Re: Capture player punch() event

I rebased it and it got merged today. So current master has this feature. This will be very useful, thank you to everyone involved for their efforts to make this finally happen. \o/ I rebased it and it got merged today. So current master has this feature. Thank you very much for this function :) Th...
by TeTpaAka
Fri May 15, 2015 21:31
Forum: Modding Discussion
Topic: Post your modding questions here
Replies: 4208
Views: 572946

Re: Post your modding questions here

I am working on updating mydeck . I want to make the stain brush wear out but I have not done much with tools. I am not sure how to do this. What would be the best way to make it wear out? Take a look at the screwdriver mod: https://github.com/minetest/minetest_game/blob/master/mods/screwdriver/ini...
by TeTpaAka
Fri May 15, 2015 21:25
Forum: Modding Discussion
Topic: Capture player punch() event
Replies: 10
Views: 1581

Re: Capture player punch() event

I rebased it and it got merged today. So current master has this feature.
by TeTpaAka
Fri May 15, 2015 09:20
Forum: Partly official engine development
Topic: pvp
Replies: 10
Views: 2531

Re: pvp

It just got merged.
by TeTpaAka
Wed May 13, 2015 11:22
Forum: Deutsch
Topic: PvP in gewissen Zonen deaktivieren
Replies: 6
Views: 1375

Re: PvP in gewissen Zonen deaktivieren

Hallo gravelman,

Das ist im Moment noch nicht möglich. Siehe hier.
Aber sobald dieser pull request ins Spiel kommt, ist es möglich, pvp partiell auszuschalten. (Ich bin zuversichtlich, dass er es schafft.)
by TeTpaAka
Tue May 12, 2015 08:50
Forum: Partly official engine development
Topic: pvp
Replies: 10
Views: 2531

Re: pvp

Would this help?
This is, I think, exactly what you described.
by TeTpaAka
Tue May 12, 2015 06:17
Forum: Mod Releases
Topic: [Mod] Quest framework [1.1] [quests]
Replies: 43
Views: 14961

Re: [Mod] Quest framework [0.7] [quests]

I have a question. I'm rather new to computer skills when it comes to coding and all that and only just figured out where to put mods and maps. If you could explain how to use API, that would be great. Thank you! First, you register a quest on load time of the mod, like you would do with a node/ite...