From 9378533ee40ed8d919841e70025962b157be49c7 Mon Sep 17 00:00:00 2001 From: Alexsandro Percy Date: Wed, 1 Mar 2023 21:14:37 -0300 Subject: [PATCH] added seats and new collision detection from inside --- forms.lua | 4 +-- init.lua | 11 ++++--- models/ap_airship_mesh.b3d | Bin 259862 -> 313466 bytes textures/ap_airship_brown.png | Bin 0 -> 6277 bytes utilities.lua | 8 +++++ walk_map.lua | 57 +++++++++++++++++++++++++++++++++- 6 files changed, 73 insertions(+), 7 deletions(-) create mode 100755 textures/ap_airship_brown.png diff --git a/forms.lua b/forms.lua index 995e60c..3e7451a 100755 --- a/forms.lua +++ b/forms.lua @@ -229,8 +229,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if fields.anchor == "true" then local max_speed_anchor = 0.6 if ent._longit_speed then - if math.abs(ent._longit_speed) < max_speed_anchor then - + local is_admin = minetest.check_player_privs(player, {server=true}) --force stop by admins + if (math.abs(ent._longit_speed) < max_speed_anchor and self.isonground) or is_admin then ent.anchored = true ent.object:set_acceleration(vector.new()) ent.object:set_velocity(vector.new()) diff --git a/init.lua b/init.lua index 1c8c772..cdc611a 100755 --- a/init.lua +++ b/init.lua @@ -12,10 +12,10 @@ ap_airship.max_seats = 2 ap_airship.pilot_base_pos = {x=0.0,y=-29,z=170} ap_airship.passenger_pos = { [1] = {x=0.0,y=0,z=60}, - [2] = {x=-11,y=0,z=20}, - [3] = {x=11,y=0,z=20}, - [4] = {x=-11,y=0,z=80}, - [5] = {x=11,y=0,z=80}, + [2] = {x=-32,y=0,z=20}, + [3] = {x=32,y=0,z=20}, + [4] = {x=-32,y=0,z=80}, + [5] = {x=32,y=0,z=80}, } ap_airship.canvas_texture = "wool_white.png^[colorize:#f4e7c1:128" @@ -27,6 +27,8 @@ ap_airship.rotor_texture = "ap_airship_helice.png" ap_airship.textures = { ap_airship.grey_texture, --"ap_airship_painting.png", --balao ap_airship.metal_texture, --ponteira nariz + "ap_airship_brown.png", --mobilia + ap_airship.metal_texture, --mobilia ap_airship.black_texture, -- corpo da bussola ap_airship.metal_texture, -- indicador bussola ap_airship.grey_texture, --"ap_airship_painting.png", --empenagem @@ -46,6 +48,7 @@ ap_airship.textures = { ap_airship.black_texture, --piso "ap_airship_alpha_logo.png", --logo ap_airship.metal_texture, + "wool_red.png", } ap_airship.colors ={ diff --git a/models/ap_airship_mesh.b3d b/models/ap_airship_mesh.b3d index 58febf374b5309f722f978052968a24b5bb266e3..affec189620ecde94dfa5622ce79850ac66e46b0 100755 GIT binary patch delta 47874 zcmZ{t3EZdE-2d-;?wQJx3T4t_dbA*UMwUvmml`CJ^5h9aWv2~~CC*T!RLV`arA;D~ zEQ29wCX%(9iZ*H{*(KSN?f-e7>-#ys?{&}he_qdLobz#g&-Z)2=UnG=uIsvg$C-C; za^L9>*=)&@C+vO9cV>=_kByBjdCoxxo^Zxyht53qh!?-^jPtfT<5xSL@tU_xes+A; ziieCJK0a~lw`Q(*^NiE?E4y7cHujPizxJ>rj~zSo@pnDpkzcvyiaq|h*{5a`10i@;V_1qZoGE#@`YUY`b*DUjgwEv z7VfAco>Mt&;da^i;>zLJKH#uDHf-gi%wKopfeUeRbdZ03_k9cD?p?T`au~xMb}(PA*rIMY;TX=bvDI*;m%>UO z-esX@EG|1?JQ*f9ryp+lq6_9TkD3z=r#XVIj$??s%#<$ukBZrvqh6!5GONjggMlMk z9uhKxEgX*R#FI4#vpVKS_OZIeMCzjHg7K^#8j^gMFj*NUY}@@VZuZkRUT^5&UU%ur zdfj*CeD8A4w*q;}$Cs{#eBs;Q5tH!ISHP_{xA|3!Jczjm6~#$98__{54-3 z9}Ff>R)QW|cjdg-cfpiZv-f_*YK#{>VfO_=PUA)kjg37qy_(UW1Ejsxhuw1d9JM#h zb*p1%TgFy(#{DI;OW~-;G)V8)Q?u$xyZqDUnv9o}PZV-8cDY9TGCbkihLG z?mVSGXA4`n9NSekk;5?kiZ2OHKS7;D&T{*59!(j}Uo&4%C+b%TcV2+aQ8eNy? z5gd+lkFkY2NO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BCL{CgFU*_gGfnW> zo~OXbDZ|LLy~2jEo1Kw)JBthB-N@|@tSn2Iwzn=|Jix@ry8R(Li#^-)3-6i!Os`^R zl$c)djLBmAo`~=X4-Xdi#&3Oa+XLT+9YG+47R)bu;@91-0H!;eeX1ub)t;C gAkCARxBp+y62&_`*qcRTd*fb~QcgxbkVG>h09j332LJ#7 diff --git a/textures/ap_airship_brown.png b/textures/ap_airship_brown.png new file mode 100755 index 0000000000000000000000000000000000000000..2e8a3bb594236ebb6ffe600ad3a068dcc3bef520 GIT binary patch literal 6277 zcmeHLXIN9&){YW^p<5{GATh|O;31t92}Od`KAV#>5pn+HyiRre*$p%JLFWapPIkRjpZ1t0va0=^}RercIoFz16u*P2W}h z#CwY%dRLRrhkV8JvBbRD@aDtg_3FXPidQcgl{O{010S4%kDUl~bBmf>!g0a4>BOpz zW_w(}P@I_(y=(rf2j@*~!gYt0d&_^vvYxMG48HGXM5Z$*+=AY>wDsmH8;vEMD=0d7 zEygNYON-}acPEDx*VujP{`%OsrGVzrd(;d|M$E#_kWJaz7y zw7f8ATdy@K?)?LCPwkK{dH0&ikrx&nafjUwXW-8Sr854L=di{&WY*;n@9;jyb7x#N z*7+4@`CRvk9nz-~VwE14o;1O1*k~WbIJUh%V&LKIql0(mOS}8)H9UM_?p=$xxEq&V zb^IEvcO;ihiC$)PYpKrKus5Qn-`{tPA&Rh-dd;uf*7r-ba{@)lH!?j;s;{RVO1d_; zJ%?B{V|H|DQMmTw(*rrlA+Y%HjPr=fZd5tle{XBIis~!a^`ucQwd;r?19@(jvZDFi zzmiwwZB4?8e_OR!6&9>~C}D6GeA((n%Be;l!QoX=Wg@;AuXLrlO$ef#)!fbK)`EKu3d*?VApHFvpI^nNS zBR$#91Iij3+e<4&RsD*IjiwdXjC?LNWc(rWl9ugy*VDjurH(X&2omh{5bx~`cVk}% z5uXL+`}NBTSGIMXmd4ZvyUIF~U8B#$-15kYWO(>)@}Gne+#kvo6SRk{)f=+!!0&|5 zS<1CaN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ILJTNoPU!`mBWRuWh`;fs> Yce@n$l_2QfA{flU)`fO@)rR>0138$$b^rhX literal 0 HcmV?d00001 diff --git a/utilities.lua b/utilities.lua index 4c5adad..42c1a38 100755 --- a/utilities.lua +++ b/utilities.lua @@ -212,6 +212,14 @@ function ap_airship.textures_copy() return tablecopy end +function ap_airship.table_copy(table_here) + local tablecopy = {} + for k, v in pairs(table_here) do + tablecopy[k] = v + end + return tablecopy +end + local function paint(self) local l_textures = ap_airship.textures_copy() for _, texture in ipairs(l_textures) do diff --git a/walk_map.lua b/walk_map.lua index 43a7365..20e1e59 100644 --- a/walk_map.lua +++ b/walk_map.lua @@ -15,17 +15,65 @@ function ap_airship.reclamp(value, min, max) return retVal end +local function is_obstacle_zone(pos, start_point, end_point) + local retVal = ap_airship.table_copy(pos) + + local min_x = 0 + local min_z = 0 + local max_x = 0 + local max_z = 0 + + if start_point.x <= end_point.x then min_x = start_point.x else min_x = end_point.x end + if start_point.z <= end_point.z then min_z = start_point.z else min_z = end_point.z end + if start_point.x > end_point.x then max_x = start_point.x else max_x = end_point.x end + if start_point.z > end_point.z then max_z = start_point.z else max_z = end_point.z end + + local mid_x = (max_x - min_x)/2 + local mid_z = (max_z - min_z)/2 + + if pos.x < max_x and pos.x > min_x+mid_x and + pos.z < max_z and pos.z > min_z then + retVal.x = max_x + 1 + return retVal + end + if pos.x > min_x and pos.x <= min_x+mid_x and + pos.z < max_z and pos.z > min_z then + retVal.x = min_x - 1 + return retVal + end + + if pos.z < max_z and pos.z > min_z+mid_z and + pos.x > min_x and pos.x < max_x then + retVal.z = max_z + 1 + return retVal + end + if pos.z > min_z and pos.z <= min_z+mid_z and + pos.x > min_x and pos.x < max_x then + retVal.z = min_z - 1 + return retVal + end + + return retVal +end + function ap_airship.cabin_map(pos, dpos) local orig_pos = ap_airship.copy_vector(pos) local position = ap_airship.copy_vector(dpos) local new_pos = ap_airship.copy_vector(dpos) + new_pos = is_obstacle_zone(new_pos, {x=12, z=153}, {x=2.5, z=143}) + new_pos = is_obstacle_zone(new_pos, {x=-12, z=153}, {x=-2.5, z=143}) + new_pos = is_obstacle_zone(new_pos, {x=12, z=140}, {x=2.5, z=130}) + new_pos = is_obstacle_zone(new_pos, {x=-12, z=140}, {x=-2.5, z=130}) + new_pos = is_obstacle_zone(new_pos, {x=12, z=127}, {x=2.5, z=117}) + new_pos = is_obstacle_zone(new_pos, {x=-12, z=127}, {x=-2.5, z=117}) + --limit to the cabin new_pos.z = ap_airship.clamp(new_pos.z, 112, 164) new_pos.y = -29 new_pos.x = ap_airship.clamp(new_pos.x, -8.42, 8.42) - --minetest.chat_send_all("x: "..new_pos.x.." - z: "..new_pos.z) + minetest.chat_send_all("x: "..new_pos.x.." - z: "..new_pos.z) return new_pos end @@ -55,6 +103,12 @@ function ap_airship.passengers_deck_map(pos, dpos) --limiting upper deck new_pos.z = ap_airship.clamp(new_pos.z, 3, 109) new_pos.x = ap_airship.clamp(new_pos.x, -43, 43) + + new_pos = is_obstacle_zone(new_pos, {x=30, z=10}, {x=2, z=48}) + new_pos = is_obstacle_zone(new_pos, {x=-30, z=10}, {x=-2, z=48}) + + new_pos = is_obstacle_zone(new_pos, {x=30, z=55}, {x=2, z=90}) + new_pos = is_obstacle_zone(new_pos, {x=-30, z=55}, {x=-2, z=90}) end new_pos.y = 0 @@ -105,6 +159,7 @@ function ap_airship.navigate_deck(pos, dpos, player) end end end + --minetest.chat_send_all(dump(pos_d)) return pos_d end