[Mod] basic_robot [basic_robot]

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: [Mod] basic_robot [basic_robot]

by hajo » Post

christoferlevich wrote:figure out how to define 'text' as the math problem?

Also, I can't 'find' spawn-mathquiz anywhere!
See Math_quiz1 + quiz2 for some ideas how to do such a quiz.

The spawn-quiz from the old robots-server has not been published on the wiki,
because it requires admin-privileges for some commands, but here it is:

Code: Select all

-- rnd - Spawn-Quiz @ -7 -3 5, with dialog/formspec.
-- When solved, gives apple, and teleports the player out of the spawn-building.

if not s then
	s=0
	t=0
	option = {"A","B","C","D","E"}
	generate_question = function()
		local a = math.random(10)+0;
		local b = math.random(10)+0;
		local c = math.random(20)-10;
		local d = a*b+c;
		msg = "To get out solve the math problem\n\n";
		msg = msg .. a.."*"..b.."+"..c .. " = ?\n\n"
		problem = a.."*"..b.."+"..c .. " = ?";
		correct = math.random(5);
		local frm = "";
		
		for i =1,5 do
			local offset = 0;
			if i~=correct then offset = math.random(10)-5; if offset == 0 then offset = -1 end end
			frm = frm .. "button_exit[".. -0.25+(i-1)*1.25 ..",1.75;1.25,1;" .. i .. ";".. d + offset .. "]"
		end
	
		local form = "size[6,2.25]" .. "textarea[0.05,-0.3;6.5,2.25;message;;".. msg.."]"..frm;
		return form, correct
	end

	selection = 1;
	question = "";
	problem = "";
end

if t%10 == 0 then  -- new quiz every 10s
	t = 0; form,selection = generate_question();
	local players = find_player(4);
	if players then
		for _,pname in ipairs(players) do
			self.show_form(pname,form) 
		end
	end
end
t=t+1;

sender,fields = self.read_form()
if sender then
	player = _G.minetest.get_player_by_name(sender);
	if player then
		
		answer = 0;
		for i = 1,5 do if fields[_G.tostring(i)] then answer = i end end
		
		if answer == correct then 
			player:setpos({x=-4,y=2,z=0})
			inv = player:get_inventory(); inv:add_item("main", "default:apple")
			_G.minetest.chat_send_player(sender,"<MATH ROBOT> congratulations, here is an apple.")
		elseif answer ~= 0 then
			player:setpos({x=0,y=-6,z=-1})
			say(sender .. " failed to solve the problem " .. problem)
		end
	end
end
This program shows a math-quiz like "2 * 3 + 4 = ?",
with 5 multiple-choice-buttons in a formspec.

On the old robot-server, the spawn-building was like a cage,
and to get out, players had to solve this quiz.

Commands like player:setpos(), player:get_inventory() and access to _G
require admin-privileges, but for ordinary rewards you don't need these...

BTW, self.show_form() is not listed on the help-page of the robot,
it works "just like" forms when writing regular mods,
so look up the modding-docs.

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: [Mod] basic_robot [basic_robot]

by christoferlevich » Post

Thanks hajo! I adapted the spawn-math quiz rather quickly to my 'bank' locations as money generators (students answer progressively harder math questions to teleport to a deeper section of the bank earning cash along the way instead of apples). I managed to add response sounds as well.

I just posted a quick vid if you're interested in seeing how I have used your assistance - https://youtu.be/F51tBaEq5kk

My next step will be to try and develop some other multiple choice formspecs for other subjects like english, science, history, etc.
everything can be a learning experience...

User avatar
rnd
Member
Posts: 220
Joined: Sun Dec 28, 2014 12:24
GitHub: ac-minetest
IRC: ac_minetest
In-game: rnd

Re: [Mod] basic_robot [basic_robot]

by rnd » Post

interesting video. i made quick quiz with randomized answers each time. Included demo quiz with 3 questions and different answers:

Code: Select all

if not quiz then
-- QUIZ QUESTIONS:
-- FORMAT:  question,	answer1, answer2,...,	index of correct answer 
quiz = {
	{
		"QUESTION 1: what is the correct answer ?",
		"correct is a.",
		"correct is b.",
		"correct is c.",
		3 -- correct is 3rd answer - c.
	},

	{
		"QUESTION 2: what is the correct answer ?",
		"correct is a.",
		"correct is b.",
		"correct is c.",
		1 -- correct is a.
	},

	{
		"QUESTION 2: what is the correct answer ?",
		"correct is a.",
		"correct is b.",
		"correct is c.",
		2
	}

}


local permute = function(n,seed) -- return permuted array {1,..,n}
	_G.math.randomseed(seed);
	local permute = {}
	for i = 1, n do permute[i] = i end --input:sub(i, i)
	for i = n,2,-1 do
		local j = math.random(i-1);
		local tmp = permute[j];
		permute[j] = permute[i]; permute[i] = tmp;
	end
	return permute
end

get_form = function(k)
	
    local n = #quiz[k]-2;
	if n < 1 then error("quiz: error in question " .. k) end
	
	local frm = "label[0,0;" .. quiz[k][1] .. "] "
	order = permute(n,os.time())
	
	  for i = 1,n do
         frm = frm .. "button_exit[0,".. (i)*1 ..";8,1;" .. order[i] .. ";".. quiz[k][1+order[i]].. "] "
      end
   
      local form = "size[8," .. (n+1) .. "]" .. frm;
	  return form, quiz[k][#quiz[k]]
end


points = 0; -- how many correct answers so far
question =  1; -- current question
correct = 1; -- current correct answer
state = 1; -- 1: display question, 2: wait for answer

local players = find_player(4);
if not players then say("quiz: no players") self.remove() end
pname = players[1];

end

if state == 1 then
	if question>#quiz then 
		say("Congratulations! You answered all question. Your result: " .. points .. "/" .. #quiz)
		self.remove();
	else
		local form;
		form, correct = get_form(question)
		self.show_form(pname,form)
		state = 2 -- wait for answer
	end
elseif state == 2 then
	
	sender,fields = self.read_form()
	if sender then -- form event
		local pl = _G.minetest.get_player_by_name(pname);
		if pl then
			if fields.quit then -- button was pressed
				local selected = 0;
				-- what is the answer?
				for k,_ in pairs(fields) do	if k~="quit" then selected = tonumber(k) break end end
				if selected>0 then
					if selected == correct then 
						say("correct!")
						points=points+1
						--correct: do something with player
					else
						say("incorrect!")
						-- incorrect: do something else with player
					end
					state = 1
					question = question + 1
				else
					say("quiz aborted")
					self.remove()
					-- no question was selected in form?
				end
			end
		end
	end

end
There are also some made games like minesweeper, nonogram ( sudoku like logical puzzle ), black box ( logical puzzle )
1EvCmxbzl5KDu6XAunE1K853Lq6VVOsT

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: [Mod] basic_robot [basic_robot]

by christoferlevich » Post

rnd wrote:interesting video. i made quick quiz with randomized answers each time. Included demo quiz with 3 questions and different answers:

Code: Select all

if not quiz then
-- QUIZ QUESTIONS:
-- FORMAT:  question,	answer1, answer2,...,	index of correct answer 
quiz = {
	{
		"QUESTION 1: what is the correct answer ?",
		"correct is a.",
		"correct is b.",
		"correct is c.",
		3 -- correct is 3rd answer - c.
	},

	{
		"QUESTION 2: what is the correct answer ?",
		"correct is a.",
		"correct is b.",
		"correct is c.",
		1 -- correct is a.
	},

	{
		"QUESTION 2: what is the correct answer ?",
		"correct is a.",
		"correct is b.",
		"correct is c.",
		2
	}

}


local permute = function(n,seed) -- return permuted array {1,..,n}
	_G.math.randomseed(seed);
	local permute = {}
	for i = 1, n do permute[i] = i end --input:sub(i, i)
	for i = n,2,-1 do
		local j = math.random(i-1);
		local tmp = permute[j];
		permute[j] = permute[i]; permute[i] = tmp;
	end
	return permute
end

get_form = function(k)
	
    local n = #quiz[k]-2;
	if n < 1 then error("quiz: error in question " .. k) end
	
	local frm = "label[0,0;" .. quiz[k][1] .. "] "
	order = permute(n,os.time())
	
	  for i = 1,n do
         frm = frm .. "button_exit[0,".. (i)*1 ..";8,1;" .. order[i] .. ";".. quiz[k][1+order[i]].. "] "
      end
   
      local form = "size[8," .. (n+1) .. "]" .. frm;
	  return form, quiz[k][#quiz[k]]
end


points = 0; -- how many correct answers so far
question =  1; -- current question
correct = 1; -- current correct answer
state = 1; -- 1: display question, 2: wait for answer

local players = find_player(4);
if not players then say("quiz: no players") self.remove() end
pname = players[1];

end

if state == 1 then
	if question>#quiz then 
		say("Congratulations! You answered all question. Your result: " .. points .. "/" .. #quiz)
		self.remove();
	else
		local form;
		form, correct = get_form(question)
		self.show_form(pname,form)
		state = 2 -- wait for answer
	end
elseif state == 2 then
	
	sender,fields = self.read_form()
	if sender then -- form event
		local pl = _G.minetest.get_player_by_name(pname);
		if pl then
			if fields.quit then -- button was pressed
				local selected = 0;
				-- what is the answer?
				for k,_ in pairs(fields) do	if k~="quit" then selected = tonumber(k) break end end
				if selected>0 then
					if selected == correct then 
						say("correct!")
						points=points+1
						--correct: do something with player
					else
						say("incorrect!")
						-- incorrect: do something else with player
					end
					state = 1
					question = question + 1
				else
					say("quiz aborted")
					self.remove()
					-- no question was selected in form?
				end
			end
		end
	end

end
There are also some made games like minesweeper, nonogram ( sudoku like logical puzzle ), black box ( logical puzzle )
I AM BLOWN AWAY! Thank you MD! This is incredible!
everything can be a learning experience...

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: [Mod] basic_robot [basic_robot]

by christoferlevich » Post

rnd wrote:interesting video. i made quick quiz with randomized answers each time. Included demo quiz with 3 questions and different answers:
I should be able to award differently for 3/3, 2/3 and 1/3 correct answers if I set it up properly, yes?
everything can be a learning experience...

User avatar
rnd
Member
Posts: 220
Joined: Sun Dec 28, 2014 12:24
GitHub: ac-minetest
IRC: ac_minetest
In-game: rnd

Re: [Mod] basic_robot [basic_robot]

by rnd » Post

Of course. Its multiple question quiz, at end it tells how many answers you got right. Can be customized so that some questions are worth more. Question example with 4 possible choices, 4th answer is correct :

Code: Select all

quiz = {
{
		"QUESTION 1: The single cell formed after fertilisation is called ",
		"An embryo",
		"A gamete",
		"A foetus",
   "A zygote",
		4 
	},  
more questions.... }
Appearance ingame:
Image
Also note the ordering of answers is different each time so you cant memorize order.
Attachments
quiz.jpg
quiz.jpg (39.75 KiB) Viewed 1730 times
1EvCmxbzl5KDu6XAunE1K853Lq6VVOsT

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: [Mod] basic_robot [basic_robot]

by christoferlevich » Post

So do I try to tag awards to the answers as they are given or at the end when they are tallied? I guess it could be either, lol
everything can be a learning experience...

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: [Mod] basic_robot [basic_robot]

by hajo » Post

christoferlevich wrote:do I try to tag awards to the answers as they are given or at the end when they are tallied?
That depends too much on the subject and difficulty of the questions,
and the kind and value of the rewards you want to give out.

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: [Mod] basic_robot [basic_robot]

by christoferlevich » Post

Yeah - I am playing with it now, but I think I'd like to reward for each question as they go with a final 3/3 total (or however many questions) receiving a 'teleport' into a new section of the map for further adventuring. :)
everything can be a learning experience...

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: [Mod] basic_robot [basic_robot]

by christoferlevich » Post

So I think I am stuck...

Code: Select all

if not quiz then
-- QUIZ QUESTIONS-VOTING:this example used for 
-- FORMAT:  question,   answer1, answer2,...,   index of correct answer 
quiz = {
   {
      "Should we have a student run government in the game?",
      "Yes",
      "No",
      "Unsure",
      1 -- can only have one question so far.
   }}


local permute = function(n,seed) -- return permuted array {1,..,n}
   _G.math.randomseed(seed);
   local permute = {}
   for i = 1, n do permute[i] = i end --input:sub(i, i)
   for i = n,2,-1 do
      local j = math.random(i-1);
      local tmp = permute[j];
      permute[j] = permute[i]; permute[i] = tmp;
   end
   return permute
end

get_form = function(k)
   
    local n = #quiz[k]-2;
   if n < 1 then error("quiz: error in question " .. k) end
   
   local frm = "label[0,0;" .. quiz[k][1] .. "] "
   order = permute(n,os.time())
   
     for i = 1,n do
         frm = frm .. "button_exit[0,".. (i)*1 ..";8,1;" .. order[i] .. ";".. quiz[k][1+order[i]].. "] "
      end
   
      local form = "size[8," .. (n+1) .. "]" .. frm;
     return form, quiz[k][#quiz[k]]
end


points = 0; -- how many correct answers so far
question =  1; -- current question
correct = 1; -- current correct answer
state = 1; -- 1: display question, 2: wait for answer

local players = find_player(4);
if not players then say("quiz: no players") self.remove() end
pname = players[1];

end

if state == 1 then
   if question>#quiz then 
      say("Thank you for voting! You answered yes  " .. points .. "/" .. #quiz)
      self.remove();
   else
      local form;
      form, correct = get_form(question)
      self.show_form(pname,form)
      state = 2 -- wait for answer
   end
elseif state == 2 then
   
   sender,fields = self.read_form()
   if sender then -- form event
      local pl = _G.minetest.get_player_by_name(pname);
      if pl then
         if fields.quit then -- button was pressed
            local selected = 0;
            -- what is the answer?
            for k,_ in pairs(fields) do   if k~="quit" then selected = tonumber(k) break end end
            if selected>0 then
               if selected == correct then 
                  say("Thank you for your vote!")
                  points=points+1
		     	insert.up("default:stone")
       self.sound("jingles_PIZZI02",1)
          --correct: do something with player
               else
                  say("Thank you for your vote.")
		     	insert.up("default:dirt")
       self.sound("jingles_PIZZI02",1)
                  -- incorrect: do something else with player
               end
               state = 1
               question = question + 1
            else
               say("quiz aborted")
               self.remove()
               -- no question was selected in form?
            end
         end
      end
   end

end
I've played with the code enough to manage a voting box, but I can't seem to do anything but a yes/no type of reward system using the chest over the robot method. 'Yes' puts a stone in the box, 'no' puts dirt... and a third 'unsure' answer registers as 'no' right now (it's a prop question to give the appearance of depth.)

If I could assign different awards to each question, I could have a series of questions in a booth instead of a series of booths with different questions. I'm going to keep at it, and I hope its ok I post progress here (someone please tell me if its not?). I welcome any help but in the end, I hope to help build up a library of interesting scripts for educational use. This mod is a MUST, IMHO. I can't thank MD and HAJO enough.
everything can be a learning experience...

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: [Mod] basic_robot [basic_robot]

by hajo » Post

christoferlevich wrote:voting box .. using the chest over the robot method. 'Yes' puts a stone in the box,
'no' puts dirt... and a third 'unsure' answer registers as 'no' right now
Using this quiz-program for voting, there is no right or wrong answer,
so we could simply cut out some parts of the program.

But how do you ensure that every student only casts one vote ?
Or can they change their mind, and vote again ?
Who can see the tally during the voting-period ?
Also, do you want/need secret votes ?

Robots can write to books, so we could log who cast which vote,
but that wouldn't allow secret voting.

BTW, it is a fairly hard problem to make a trustworthy voting-system that is safe,
secure as well as secret - see the mess with hacked voting-machines in RL.

This subject might be worth some discussion in class...
Last edited by hajo on Tue Dec 12, 2017 21:16, edited 1 time in total.

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: [Mod] basic_robot [basic_robot]

by christoferlevich » Post

I figure I will do it like they do it in town... during a session, kids show up and cast a vote per box (unless I can itemize what does into the chest per question.) I'm working at it but lots to learn. hahaha
everything can be a learning experience...

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: [Mod] basic_robot [basic_robot]

by christoferlevich » Post

Code: Select all

if not quiz then
-- QUIZ QUESTIONS:
-- FORMAT:  question,	answer1, answer2,...,	index of correct answer 
quiz = {
	{
		"QUESTION 1: what is the correct answer ?",
		"correct is a.",
		"correct is b.",
		"correct is c.",
		3 -- correct is 3rd answer - c.
	},

	{
		"QUESTION 2: what is the correct answer ?",
		"correct is a.",
		"correct is b.",
		"correct is c.",
		1 -- correct is a.
	},

	{
		"QUESTION 2: what is the correct answer ?",
		"correct is a.",
		"correct is b.",
		"correct is c.",
		2
	}

}


local permute = function(n,seed) -- return permuted array {1,..,n}
	_G.math.randomseed(seed);
	local permute = {}
	for i = 1, n do permute[i] = i end --input:sub(i, i)
	for i = n,2,-1 do
		local j = math.random(i-1);
		local tmp = permute[j];
		permute[j] = permute[i]; permute[i] = tmp;
	end
	return permute
end

get_form = function(k)
	
    local n = #quiz[k]-2;
	if n < 1 then error("quiz: error in question " .. k) end
	
	local frm = "label[0,0;" .. quiz[k][1] .. "] "
	order = permute(n,os.time())
	
	  for i = 1,n do
         frm = frm .. "button_exit[0,".. (i)*1 ..";8,1;" .. order[i] .. ";".. quiz[k][1+order[i]].. "] "
      end
   
      local form = "size[8," .. (n+1) .. "]" .. frm;
	  return form, quiz[k][#quiz[k]]
end


points = 0; -- how many correct answers so far
question =  1; -- current question
correct = 1; -- current correct answer
state = 1; -- 1: display question, 2: wait for answer

local players = find_player(4);
if not players then say("quiz: no players") self.remove() end
pname = players[1];

end

if state == 1 then
	if question>#quiz then 
		say("Congratulations! You answered all question. Your result: " .. points .. "/" .. #quiz)
		self.remove();
	else
		local form;
		form, correct = get_form(question)
		self.show_form(pname,form)
		state = 2 -- wait for answer
	end
elseif state == 2 then
	
	sender,fields = self.read_form()
	if sender then -- form event
		local pl = _G.minetest.get_player_by_name(pname);
		if pl then
			if fields.quit then -- button was pressed
				local selected = 0;
				-- what is the answer?
				for k,_ in pairs(fields) do	if k~="quit" then selected = tonumber(k) break end end
				if selected>0 then
					if selected == correct then 
						say("correct!")
						points=points+1
						--correct: do something with player
					else
						say("incorrect!")
						-- incorrect: do something else with player
					end
					state = 1
					question = question + 1
				else
					say("quiz aborted")
					self.remove()
					-- no question was selected in form?
				end
			end
		end
	end

end
So I am back on this, but I want to reward a player with three correct answers by teleporting them to a new location.
How do I trigger that? by the points (3 total?) I am trying several different ways to make that happen but keep failing. Is this doable? I know the robot keeps track of correct answers, and I can reward with items into a chest for individual items, but not the totals yet.
everything can be a learning experience...

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: [Mod] basic_robot [basic_robot]

by hajo » Post

christoferlevich wrote:I want to reward a player with three correct answers by teleporting them to a new location.
You need to give the player time to collect his rewards from the chest,
so how about giving an extra item for 3 correct answers (coins, keys, book-with-text ...),
and a separate 'teleport-shop' that uses this item as payment ?

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: [Mod] basic_robot [basic_robot]

by christoferlevich » Post

Thats a good point - or I could insert the rewards into their inv. - but I do like the chest mechanic.
everything can be a learning experience...

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: [Mod] basic_robot [basic_robot]

by hajo » Post

christoferlevich wrote:kids show up and cast a vote per box
You could use a mailbox, and kids just write you mails like "I vote A".
(That mailbox could be rewritten to use several buttons
with such canned texts, instead of the field for textinput)

Also, xdecor has a mailbox for dropping in items -
you just need to distribute some kind of voting-coins.

Both methods are not secret/anonymus, so you might want to avoid touchy subjects...

OTOH: voting is essential for a democracy, so teaching&understanding how it works,
what can go wrong, how it might get abused (and how to prevent) is very important.

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: [Mod] basic_robot [basic_robot]

by christoferlevich » Post

I like how I think because that's part of the gift minetest can be. It's like demo-life sometimes. I find the lessons are as real even in demo. I have a 'factory' they can work in for $ but when a player enters or leaves the factory, they lose everything in their inventory. That only happens once and then they start actually reading signs. Lol. Maybe I'll set up a vote on something trivial and let the vote go bad to show them the importance of good guidelines and tiles, etc.
everything can be a learning experience...

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: [Mod] basic_robot [basic_robot]

by hajo » Post

christoferlevich wrote:I have a 'factory' they can work in for $
Nice idea - what do you produce, and how ?
For what do they need the cash ?

Also, did some kids try to work/dig/build/craft on their own ?
I think that should be encouraged... eg. public mine, crafting-guide etc.
After all, nice houses can be built without parts from homedecor...
but when a player enters or leaves the factory, they lose everything in their inventory.
Locker-room with chests for everyone ?
That only happens once and then they start actually reading signs. Lol.
:)

BTW, I created a new wiki-page about programs for support/maintainance/admins
that might need admin- or puzzle-privileges.
There are the programs for quiz/spawnquiz, mailbox, shop, etc.

FlameFireling
Member
Posts: 24
Joined: Sun Jul 23, 2017 12:37

Re: [Mod] basic_robot [basic_robot]

by FlameFireling » Post

+1
Telnet > IRC

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: [Mod] basic_robot [basic_robot]

by christoferlevich » Post

1) In the factory, they produce the Mese Light Up Pick Axe from Walking Light Mod (with a slight variation to the crafting recipe adding an ingredient only available at the factory which is why they lose their inventory going in and out). And there is a locker room now, but many are still walking right by the locker room and getting their inventory wiped. Its almost comical.
2) Building is their favorite thing. The twon is built on streets named after their teachers, and the 2-4 grades have houses they've built into and abroad. 1st graders all have apartments. Many mine, some are cutting down trees, and of those, some craft their own stuff while others sell their work in shops that in turn sell those same materials back to players who don't mine and cut trees (at least the illusion of this is there. The numbers don't always add up... yet).
3)
After all, nice houses can be built without parts from homedecor...
I am actually considering dropping Homedecor as a mod. I am afraid that all those entities might be one of the problems I have with the server not responding properly (quickly and consistently) to players when I get more than 20 or so on. Any thoughts? My fear is that homedecor has so many entities.

I'm off to book mark your new wiki, after all, I am a humble student of yours... :)
everything can be a learning experience...

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: [Mod] basic_robot [basic_robot]

by hajo » Post

Just some quick questions, about robots used by regular players,
with no special privs, and no other mods installed:

* how can a robot make soil from dirt ?
** more generally, (how) can robots use tools (eg. hoe or bucket) ?
Maybe a variant of activate() ?

* WIth the new, expanded range of keyboard-buttons,
how to get the index-number for letters/number/etc. ?

Also, I think the new ic-image on top of the worker
should be on top of the spawner.

User avatar
rnd
Member
Posts: 220
Joined: Sun Dec 28, 2014 12:24
GitHub: ac-minetest
IRC: ac_minetest
In-game: rnd

Re: [Mod] basic_robot [basic_robot]

by rnd » Post

1. robot can't (yet) use tools. I could program tools separately (like: robot_tools = {[hoe] = {[dirt] = soil,...} , ...})
or make virtual player so robot could use every tool player can use (like pipeworks node breaker). 1st approach sounds more customizable and clean

2. there is formula how index relates to button:

Numbers:
for i = 0,9 do register_robot_button_number(i,i+7) end

Other symbols:
for i = 0,255 do register_robot_button_char(i,i+17) end
1EvCmxbzl5KDu6XAunE1K853Lq6VVOsT

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: [Mod] basic_robot [basic_robot]

by hajo » Post

rnd wrote:2. there is formula how index relates to button .. Other symbols
I was thinking of an equivalent for

Code: Select all

string.byte("Abc+123!")
eg. for making big signs.

I have been playing a bit with mesecons lately,
and found that the mesecons-switch and -pressureplate
can activate robots, like a keypad (but without a password-option).

Also, pressureplate and player-detector react to mobs too.
Robots can find and attack players, so it should be possible
to do likewise with mobs, and make a robo-guarddog / hunter.
That would be pretty nice :)

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: [Mod] basic_robot [basic_robot]

by hajo » Post

More ideas/suggestions:
* option to limit the range of say(), eg. to players in range, like the "!"-option of the keypad.
* or other way round, add an optional argument to say(), with the list of receivers, eg.

Code: Select all

p=find_players(4); say("Hi", p.."hajo")
Also: is there an easy, reliable way (without hardcoding)
for robots to find its robot-id (and/or its owner),
that works for regular users ?
Using the last 1 or 2 chars from self.name()
is not reliable with usernames like "test1" or "user123".

User avatar
Fixer
Member
Posts: 904
Joined: Sun Jul 31, 2011 11:23
IRC: Fixer
In-game: Fixer
Location: Ukraine

Re: [Mod] basic_robot [basic_robot]

by Fixer » Post

I see you like those things with programmed robots, here is another project that may be useful to look as a basis for minetest: [computercraft] https://github.com/dan200/ComputerCraft - aka programmable robots in lua for minecraft

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 36 guests