Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
basic_robot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
basic_robot
Commits
74ef01e1
Commit
74ef01e1
authored
7 years ago
by
rnd1
Browse files
Options
Downloads
Patches
Plain Diff
- self.fire has now option to select projectile when using particles ( is_entity = false)
parent
8a8d2241
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
init.lua
+8
-8
8 additions, 8 deletions
init.lua
with
8 additions
and
8 deletions
init.lua
+
8
−
8
View file @
74ef01e1
...
...
@@ -4,10 +4,10 @@
basic_robot
=
{};
---- SETTINGS ------
basic_robot
.
call_limit
=
48
;
-- how many execution calls per script run allowed
basic_robot
.
entry_count
=
2
-- how many robot ordinary player can have
basic_robot
.
entry_count
=
2
-- how many robot
s
ordinary player can have
basic_robot
.
advanced_count
=
16
-- how many robots player with robot privs can have
basic_robot
.
radius
=
32
;
-- divide whole world into blocks of this size - used for managing events like keyboard punches
basic_robot
.
password
=
"
robot
passw
0
rd"
;
-- IMPORTANT: change it before running mod,
server private
password used for authentifications
basic_robot
.
password
=
"passw
o
rd"
;
-- IMPORTANT: change it before running mod, password used for authentifications
basic_robot
.
bad_inventory_blocks
=
{
-- disallow taking from these nodes inventories to prevent player abuses
[
"craft_guide:sign_wall"
]
=
true
,
...
...
@@ -20,13 +20,13 @@ basic_robot.http_api = minetest.request_http_api();
basic_robot
.
version
=
"2017/12/18a"
;
basic_robot
.
data
=
{};
-- stores all robot data
basic_robot
.
data
=
{};
-- stores all robot
related
data
--[[
[name] = { sandbox= .., bytecode = ..., ram = ..., obj = robot object,spawnpos=...}
[name] = { sandbox= .., bytecode = ..., ram = ..., obj = robot object,
spawnpos=
..., authlevel =
...}
robot object = object of entity, used to manipulate movements and more
--]]
basic_robot
.
ids
=
{};
-- stores maxid for each player
--[name] = {id = .., maxid = .. }, current id, how many robot ids player can use
--[name] = {id = .., maxid = .. }, current id
for robot controller
, how many robot ids player can use
basic_robot
.
data
.
listening
=
{};
-- which robots listen to chat
dofile
(
minetest
.
get_modpath
(
"basic_robot"
)
..
"/commands.lua"
)
...
...
@@ -149,7 +149,7 @@ function getSandboxEnv (name)
end
end
,
fire
=
function
(
speed
,
pitch
,
gravity
,
is_entity
)
-- experimental: fires an projectile
fire
=
function
(
speed
,
pitch
,
gravity
,
texture
,
is_entity
)
-- experimental: fires an projectile
local
obj
=
basic_robot
.
data
[
name
].
obj
;
local
pos
=
obj
:
getpos
();
local
yaw
=
obj
:
getyaw
();
...
...
@@ -163,7 +163,7 @@ function getSandboxEnv (name)
expirationtime
=
10
,
velocity
=
{
x
=
speed
*
math.cos
(
yaw
)
*
math.cos
(
pitch
),
y
=
speed
*
math.sin
(
pitch
),
z
=
speed
*
math.sin
(
yaw
)
*
math.cos
(
pitch
)},
size
=
5
,
texture
=
"default_apple.png"
,
texture
=
texture
or
"default_apple.png"
,
acceleration
=
{
x
=
0
,
y
=-
gravity
,
z
=
0
},
collisiondetection
=
true
,
collision_removal
=
true
,
...
...
@@ -1363,7 +1363,7 @@ local on_receive_robot_form = function(pos, formname, fields, sender)
" self.reset() resets robot position\n"
..
" self.spawnpos() returns position of spawner block\n"
..
" self.viewdir() returns vector of view for robot\n"
..
" self.fire(speed, pitch,gravity) fires a projectile from robot\n"
..
" self.fire(speed, pitch,gravity
, texture, is_entity
) fires a projectile from robot\n"
..
" self.fire_pos() returns last hit position\n"
..
" self.label(text) changes robot label\n"
..
" self.display_text(text,linesize,size) displays text instead of robot face, if no size return tex\n"
..
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment