Entity attachement

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Entity attachement

by azekill_DIABLO » Fri Apr 22, 2016 17:03

Is it possible to make a player ALWAYS ride an entity, like a car of my mod???
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
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 

sofar
Member
 
Posts: 781
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Entity attachement

by sofar » Fri Apr 22, 2016 17:10

Yes, you can do this several ways:

1 - attach on login, attach on respawn, and disallow detaching.
2 - change the player model
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: Entity attachement

by azekill_DIABLO » Sat Apr 23, 2016 10:38

precision on the first way??

with some code pls
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
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: Entity attachement

by azekill_DIABLO » Mon May 02, 2016 11:04

hey can somone help?? :(
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
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 

User avatar
oleastre
Member
 
Posts: 81
Joined: Wed Aug 13, 2014 21:39
GitHub: oleastre
In-game: oleastre

Re: Entity attachement

by oleastre » Mon May 02, 2016 14:02

I don't want to be rude, but did you tried to do what sofar explained ?

You have your own car mod working with entities, so at least you already have an example of code that attach the player to an entity.

I did not tried by myself, but from sofar comment, I just had a look in the minetest api, searched for "connect" and "spawn" and found two functions: minetest.register_on_joinplayer and minetest.register_on_respawnplayer.

So, you just have to use those two functions to register callbacks that will attache your player to an entity, just like it's done when a player use the "use" button to get into your car mod.

Maybe you already tried and got some errors, then ignore the above comment and let us know what the problem is.
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: Entity attachement

by azekill_DIABLO » Mon May 02, 2016 14:34

hey! i made that thread becuz i already tried things without sucess and becuz i'm a noob in lua!

if we can ask an exemple of code.........

but thanks i wasn't knowing this Minetest api
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
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 

User avatar
oleastre
Member
 
Posts: 81
Joined: Wed Aug 13, 2014 21:39
GitHub: oleastre
In-game: oleastre

Re: Entity attachement

by oleastre » Mon May 02, 2016 14:48

I understand you are beginning; and I can only encourage you to continue making efforts.

If you do not get answers, maybe try other ways (like the various irc channels), or give us some hints.

As a daily programmer, when you ask for code examples, it seems like you want me to write the code for you :)

And if I never did precisely what you are asking for, I will not answer you with something I did not tested. And so, probably do not answer.

If you asked "How can I know when a player connects or respawn ?" then you would probably have got a quick answer pointing to the correct location in the minetest api.

Did you already read rubenwardy's minetest modding tutorial ?

( and if it's easier for you to ask questions in french, do so in the dedicated forum section ;-) )
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: Entity attachement

by azekill_DIABLO » Mon May 02, 2016 14:55

oh no i just know if someone was able to show some functions or part of code!

if i don't code in lua that not funny ...

you just gave me docs and that perfect! and for code i better understand english ;)
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
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 7 guests

cron