3d Armor - need help!

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Sat Jan 12, 2013 16:02

4aiman wrote:
jjoa1997 wrote:but have you open it with a letter "u".

There is no need in additional keybindings. It's VERY likely I'll use modified inventory_plus mod (so yes, this would be compatible with skin selection from the very beginning)

I want it on my private server but i am using unified inventory. Could you make it configurable to opening it with the u button. Also opening with a letter allowes it to be able to do into the default game since inventory_plus is not in the default.
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Mon Jan 14, 2013 07:35

jojoa1997 wrote:inventory_plus is not in the default

I'll see what I can, but if I will use Inventory to add the change-armour-ability then it's formspec should be modified. Yes, I would like to change that in the same formspec with the craft area (MC style).

Moreover, currently we have 2 ways (except doin'g that by myself) of changing the inventory: Inventory+ and Unified_inventory. I don't like the second one, cause that's too much for the inventory.
Anyway, I'll try to be:
a) compatible with both of them;
b) compatible with the default game.
I guess I'll make config file where one can set all of that.
____________________________________________________
And now, some AWESOME news!!!
I published that on youtube yesterday, so maybe someone already knows this, but for those who don't, I want to make it loud:
3d armor is ANIMATED now!
Watch this for details: http://www.youtube.com/watch?v=Wyp9hQXyU1k

Pros:
- made with Lua entity
- items from different sets can be put on
- animations of a player & an armor are synchronized
- built-in stuff left intact

Cons:
- armor is a bit bigger than needed (will fix that by myself)
- armor do not protect (will fix that by myself)
- armor is unequippable unless logout (need help to do this without "Wardrobe" block)
- unlimited simultaneous armors equippable (will add a check to make it impossible to wear 2 helmets)
- animation of a player & an armor are synchronized only after 1st change of animation, e.g one must die, run/sneak or punch smth, even air (can't fix, consider that unimportant)

Also: If anyone knows how make a player visible to himself (camera shift wouldn't work), I'm all ears.
Last edited by 4aiman on Mon Jan 14, 2013 07:43, edited 1 time in total.
 

User avatar
dannydark
Member
 
Posts: 428
Joined: Fri Aug 12, 2011 21:28

by dannydark » Mon Jan 14, 2013 09:06

Nice work 4aiman, I found it funny how in your video you could see loads of npc's running around in the water behind you haha.

Anyway looks good, with regards to 3rd person view this won't work just by moving the camera unfortunately as the players own model isn't rendered on the client screen (only other players) which I think is also why we have a weird hand instead of the hand of the model actually showing.

So I'm guessing in order to have a 3rd person camera angle we would first need to let the client know about its own model and render it I guess.
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Mon Jan 14, 2013 10:13

Well, I know that moving the camera wouldn't work. The thing is I cannot see not only player itself but any entity attached to him.
I'll try to move the camera and instead of attaching entity to player I'll try to attach player to entity - I know that I can see a boat this way.
So, maybe I would be able to attach player to character entity and move it instead of the player...
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Mon Jan 14, 2013 11:08

+100 Maybe if you have a block that is easy to make that can bring up a menu allowing it to be in default
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Mon Jan 14, 2013 11:17

You coud also use Calinou's moreores mode for stuff like golad and silver. I also suggest using titanium and diamonds mods. The three are mod dependencies here. [Mod] Armor and Weapons [armor]
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Mon Jan 14, 2013 12:17

I certainly will use moreores and diamonds (as well as update my heretic's texturepack for those 2). I tried titanium, but that's too complicated. If you want, I'll make titanium armor, but that'll be not 1st thing in the TODO list. What's the purpose of titanium mod? New ores? What else? I saw some weird screens which are confusing. I don't remember any description either. Please, post here what one could do with titanium except new blocks.

News about 3rd person:
That's possible using the trick I suggested earlier. There may be some unfair consequences for those who will use default client. I'll see what can I do about that. Right now those who want to test what it would look like can perform following actions (sorry windows users... If anyone was able to compile his/her minetest under win32 - PLEASE, HELP ME TO DO IT TO!!! I'll post some info then about what I've achieved allready):
- go to your minetest folder
- cd to "src" folder
- open the "camera.cpp" file
- go to line 245
- change "v3f rel_cam_pos = v3f(0,0,0);" to "v3f rel_cam_pos = v3f(0,0,-50);" (w/o brackets)
- cd to ../ (e.g minetest folder)
- run "make"
- after compilation go get boats mod: http://forum.minetest.net/viewtopic.php?id=4016
- install the "boats"
- launch the game
- after loading issue "/giveme boats:boat" command (w/o brackets)
- place your boat in water
- rightclick on it
_______________________
You'll see a boat and won't see a player. But if you change boat.x with character.x in the init.lua, you would be able to se yourself (w/o animations, though. But that is fixable, though).
Last edited by 4aiman on Mon Jan 14, 2013 12:20, edited 1 time in total.
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Mon Jan 14, 2013 12:19

4aiman wrote:I certainly will use moreores and diamonds (as well as update my heretic's texturepack for those 2). I tried titanium, but that's too complicated. If you want, I'll make titanium armor, but that'll be not 1st thing in the TODO list.

News about 3rd person:
That's possible using the trick I suggested earlier. There may be some unfair consequences for those who will use default client. I'll see what can I do about that. Right now those who want to test what it would look like can perform following actions (sorry windows users... If anyone was able to compile his/her minetest under win32 - PLEASE, HELP ME TO DO IT TO!!! I'll post some info then about what I've achieved allready):
- go to your minetest folder
- cd to "src" folder
- open the "camera.cpp" file
- go to line 245
- change "v3f rel_cam_pos = v3f(0,0,0);" to "v3f rel_cam_pos = v3f(0,0,-50);" (w/o brackets)
- cd to ../ (e.g minetest folder)
- run "make"
- after compilation go get boats mod: http://forum.minetest.net/viewtopic.php?id=4016
- install the "boats"
- launch the game
- after loading issue "/giveme boats:boat" command (w/o brackets)
- place your boat in water
- rightclick on it
_______________________
You'll see a boat and won't see a player. But if you change boat.x with character.x in the init.lua, you would be able to se yourself (w/o animations, though. But that is fixable, though).

But the boats mod works without compilation.
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Mon Jan 14, 2013 12:21

Also could you add visible weapons
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Mon Jan 14, 2013 12:21

But the boats mod works without compilation.

You didn't get it. I'm talking about a hack for 3rd person. compilation needed to see a whole model, not just part of it.
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Mon Jan 14, 2013 12:23

jojoa1997 wrote:Also could you add visible weapons

I can't. Every entity, connected to the player dissapears from his screen. The only way is to attach player to some entity and attach weapons to that entity as well.
Last edited by 4aiman on Mon Jan 14, 2013 12:23, edited 1 time in total.
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Mon Jan 14, 2013 12:23

4aiman wrote:
But the boats mod works without compilation.

You didn't get it. I'm talking about a hack for 3rd person. compilation needed to see a whole model, not just part of it.

Are you are changing how the character is defined.
Last edited by jojoa1997 on Mon Jan 14, 2013 13:17, edited 1 time in total.
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Mon Jan 14, 2013 12:24

Um.. what?
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Mon Jan 14, 2013 13:18

On tablet I changed the post.
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Mon Jan 14, 2013 13:33

Are you are changing how the character is defined.

No. I have done nothing to have 3rd person view. I just gave everyone a working idea. Controlling lua entity isn't that hard after toying with player.lua, boats and butter creeper, so it is possible to have 3rd person view.
There are one problem, though. Other players will see both the player and the lua entity. So we should use invisible mesh for a player.
Edit:maybe later I'll make smth like that, but not now.
Last edited by 4aiman on Mon Jan 14, 2013 13:34, edited 1 time in total.
 

User avatar
dannydark
Member
 
Posts: 428
Joined: Fri Aug 12, 2011 21:28

by dannydark » Mon Jan 14, 2013 16:23

Heh you do both know that you can edit your post after its already been posted? meaning there is no need for creating new posts unless someone has replied after you ^_^ haha

Anyway, That change will work fine on Windows, or do you mean you need help compiling something else on Windows? If so I can help I do most of my compiling on Windows as its my main OS, although I also compile for Linux and OS X (well not so much any-more) to.

It would be nice to have hack for 3rd person but to be honest I'd rather see you spend your time on the armour etc (unless 3rd person view is part of the mod?) as the 3rd person view should probably be integrated engine side and not through a hack done in lua, Although saying that I'm not too sure what the best way of adding such a feature would be.

Anyway nice to hear you're making progress, very impressive.
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Mon Jan 14, 2013 16:25

i think that you should be able to see the person in the armor menu
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
dannydark
Member
 
Posts: 428
Joined: Fri Aug 12, 2011 21:28

by dannydark » Mon Jan 14, 2013 17:03

@jojoa1997 you mean like in Minecraft? I never really saw the point in that as you can always view your character in 3rd person view anyway (in MC).

Also that's probably not something that is related to this mod.
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Mon Jan 14, 2013 17:26

I meant so you could see how th armor looks it doesnt have to move and doesnt have to be 3d
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
Chinchow
Member
 
Posts: 683
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Fri Jan 18, 2013 21:13

Was this abandoned?
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Fri Jan 18, 2013 22:09

Nope, it wasn't ;)
I'm a student by correspondence and now I have a hard time 'cause of exams session has begun, though.
I'll put what I have atm right here, as well as make a link to DropBox https://www.dropbox.com/sh/0nkvy79fwwapkhq/eA3mZb7eTi (have models & "texture").

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
default_model = "helmet.x"
--
-- Start of configuration area:
--

-- Player animation speed
animation_speed = 30

-- Player animation blending
-- Note: This is currently broken due to a bug in Irrlicht, leave at 0
animation_blend = 0

-- Frame ranges for each player model
function armour_get_animations(model)

        return {
        stand_START = 0,
        stand_END = 79,
        sit_START = 81,
        sit_END = 160,
        lay_START = 162,
        lay_END = 166,
        walk_START = 168,
        walk_END = 187,
        mine_START = 189,
        mine_END = 198,
        walk_mine_START = 200,
        walk_mine_END = 219
        }

end


-- Player stats and animations
local player_model = {}
local player_anim = {}
local player_sneak = {}
local ANIM_STAND = 1
local ANIM_SIT = 2
local ANIM_LAY = 3
local ANIM_WALK  = 4
local ANIM_WALK_MINE = 5
local ANIM_MINE = 6


-- Update appearance when the player joins
-- minetest.register_on_joinplayer(ar_update_visuals)



local ar = {
    physical = false,
    collisionbox = {-0.5,-1,-0.5, 0.5,1,0.5},
    visual = "mesh",
    mesh = "helmet.x",
    textures = {"ar.png"},
    visual_size = {x=1, y=1, z = 1},
    wielder = nil,
    v = 0,
    animation_speed = 30,
    animation_blend = 0,
    animation = ANIM_STAND,
}


function ar:on_rightclick(clicker)
    if not clicker or not clicker:is_player() then
        return
    end
    --if self.wielder and clicker == self.wielder then
---        self.wielder = nil
    --    clicker:set_detach()
--    elseif not self.driver then
        self.wielder = clicker
        -- self.object:set_attach(self.wielder, "", {x=0,y=0,z=0}, {x=0,y=0,z=0})
        self.object:setyaw(self.wielder:get_look_yaw())
           
      --  minetest.chat_send_all(self.mesh)
        local anim = armour_get_animations(self.mesh)
        self.object:set_animation({x=anim.stand_START, y=anim.stand_STOP}, 30, 0)

--    end
end

function ar:on_step(dtime)
  local wielder = self.wielder
  if wielder == nil then
     return
  end
--  local name = wielder:get_player_name()
--  if name ~=nil then
 
        local controls = wielder:get_player_control()
        local walking = false
        local animation_speed_mod = animation_speed
        local anim = armour_get_animations(self.mesh)


        if controls.up
        or controls.down
        or controls.left
        or controls.right
        then
            walking = true
        end

       
        if  controls.sneak
        and wielder:get_hp() ~= 0
        and (walking or controls.LMB)
        then
            animation_speed_mod = animation_speed_mod / 2                   
        else
            animation_speed_mod = animation_speed_mod * 2       
        end



        if wielder:get_hp() == 0 then
           if self.animation ~= ANIM_LAY then
              self.object:set_animation({x=anim.lay_START, y=anim.lay_END}, animation_speed_mod, animation_blend)
              self.animation = ANIM_LAY
           end
           
        elseif walking and controls.LMB then
           if self.animation ~= ANIM_WALK_MINE then
              self.object:set_animation({x=anim.walk_mine_START, y=anim.walk_mine_END}, animation_speed_mod, animation_blend)
              self.animation = ANIM_WALK_MINE
           end
           
        elseif walking then
           if self.animation ~= ANIM_WALK then
              self.object:set_animation({x=anim.walk_START, y=anim.walk_END}, animation_speed_mod, animation_blend)
              self.animation = ANIM_WALK
           end
           
        elseif controls.LMB then
           if self.animation ~= ANIM_MINE then
              self.object:set_animation({x=anim.mine_START, y=anim.mine_END}, animation_speed_mod, animation_blend)
              self.animation = ANIM_MINE
           end
           
        else
           if self.animation ~= ANIM_STAND then
              self.object:set_animation({x=anim.stand_START, y=anim.stand_END}, animation_speed_mod, animation_blend)
              self.animation = ANIM_STAND
           end
           
        end


end

minetest.register_entity("capes:ar", ar)


minetest.register_craftitem("capes:helmet", {
    description = "Cape",
    inventory_image = "ar.png",
    wield_image = "ar.png",
    wield_scale = {x=2, y=2, z=1},
    liquids_pointable = true,
    on_place = function(itemstack, placer, pointed_thing)
        if pointed_thing.type ~= "node" then
            return
        end
        local arm = minetest.env:add_entity(pointed_thing.above, "capes:ar")
        local prop = {mesh = "helmet.x",    }
        arm:set_properties(prop)
        itemstack:take_item()
        return itemstack
    end,
})


minetest.register_craftitem("capes:char", {
    description = "Cape",
    inventory_image = "ar.png",
    wield_image = "ar.png",
    wield_scale = {x=2, y=2, z=1},
    liquids_pointable = true,

    on_place = function(itemstack, placer, pointed_thing)
        if pointed_thing.type ~= "node" then
            return
        end
        local arm = minetest.env:add_entity(pointed_thing.above, "capes:ar")
        local prop = {mesh = "character.x",    }
        arm:set_properties(prop)
        itemstack:take_item()
        return itemstack
    end,
})


I have some problems with animation.

I opened character.blend, deleted black box around character's head and exported it. And animation worked. Then I closed blender, opened character.blend again and exported it without any changes. First time that didn't work. I tried again and got animated entity.
"Inside" the blender animation is just right in both cases, but after exporting it to *.x such things happen.

If anyone knows the reason for that weird behavior, then post here, please!
I'll post any info that may help to solve this case, 'cause I'm entirely concerned in having 3d armor in Minetest.

Also, help with "putting the armor off" is no longer needed, I have a solution now ;)
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Sat Jan 19, 2013 17:00

I suggest using .b3d files they are way smaller and not limited as much as .x files.

(known) Limits:
-only one animation
-exactly 1 parent bone
-all faces need to be in a vertex group to show up with animations
-choose correct flags for exporting

-have mesg and armature selected on export
-all animated frames need to be enabled on export to be exported (thats true for all export formats)

I assume when exporting second time you didn't have selected same things as first time
DON'T mention coding style!
(c) sapier all rights reserved
 

BZab
Member
 
Posts: 126
Joined: Mon Jan 28, 2013 10:04

by BZab » Wed Jan 30, 2013 22:15

jojoa1997 wrote:make pants shoes and a helmet like in the armor mod

Won't be a better idea to make one mod with em?
(3d looks from here and GUI and items from armor mod)
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Fri Feb 01, 2013 22:36

BZab wrote:
jojoa1997 wrote:make pants shoes and a helmet like in the armor mod

Won't be a better idea to make one mod with em?
(3d looks from here and GUI and items from armor mod)

Armor mod would be either considered (why should I invent a wheel?) or forked. Anyway, I can't do anything now - Theoretical phonetics, Economy, Special course of Psychology and many more exams to be passed till 02/09/2013 ...
 

User avatar
Mito551
Member
 
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Fri Feb 01, 2013 22:40

4aiman wrote:Theoretical phonetics, Economy, Special course of Psychology and many more exams to be passed till 02/09/2013 ...

good luck with that.
 

Previous

Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 3 guests

cron