Author Topic: Attaching a scene prop/collision mesh to mounts  (Read 479 times)

0 Members and 1 Guest are viewing this topic.

La Grandmaster

  • Squire
  • *
  • I feel it in the water, I feel it in the earth.
    • View Profile
  • Faction: Nord
Attaching a scene prop/collision mesh to mounts
« on: April 29, 2012, 04:00:06 PM »
Hey people, i was just wondering if people could help explain to me how to attach scene props to mounts. The reason I want to do this is because the scale mount feature in warband does not fully work as mounts above a certain sizes are "walk throughable" :( 
I plan to there for attach an invisible scene prop with a collision mesh to the mount which will prevent this.  I have planned it out and I believe I will have to get the horses position to begin with and then use some sort of code to spawn the prop in a some position relative to the mount and move when the mount does.
 
I know that its possible as a few people have done it before -
 http://forums.taleworlds.com/index.php/topic,157227.msg3780681.html
(im not bothered about using the scene prop as a hitbox as in this example)
and I know Mirathei made an elephant tower and chariot script that was based on scene props

Or if people can offer some alternative solution I'd be happy as well :D

MadocComadrin

  • Water-Borne Annelid
  • Grandmaster Knight
  • *
  • ...et cum iustis non scribantur.
    • View Profile
  • Faction: Neutral
  • MP nick: MadocComadrin
  • M&BWBWF&S
Re: Attaching a scene prop/collision mesh to mounts
« Reply #1 on: April 29, 2012, 08:09:29 PM »
Okay, the flow is going to go something  like this.
Step 1: find the mount agent.
Step 2*: Server-side, use the attaching operation (forget the exact name atm) to attach your prop (spawn it first if needed) to the mount. Use the other attach operations to change the relative position.
Step 3*: Send a message to all clients with the mount and prop instance ids: when the clients receive this message, they will also perform the attaching operations. (That is, to stay in sync, the attachment operation needs to be run on both client and server.)

That's pretty much it. These are the operations you'll need at minimum.

(click to show/hide)
I believe <value> for the position is in cm, but I'm not 100% sure.

Resident Wereparakeet - Tasty and Dangerous Pastry
Madmin - Sophistacted tools for responsible admins


xenoargh

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Attaching a scene prop/collision mesh to mounts
« Reply #2 on: April 30, 2012, 01:35:50 AM »
The reason why you're seeing confused AI is because the horse's center is inside the Scene Prop.  Easiest solution is to design a collision mesh that surrounds the "horse" but doesn't intersect it.

John Xenir

  • Squire
  • *
    • View Profile
  • Faction: Rhodok
Re: Attaching a scene prop/collision mesh to mounts
« Reply #3 on: April 30, 2012, 01:46:26 AM »
Belendor said hat new feature of OpenBRF enables, say "fantasy" mounts which have proper custom skeleton to have customizable hitboxes. I wonder if this allows elephants and other fat animals instead of cumbersome workarounds.
И последняя мысль: Чëрт бы побрал всех испанцев!

Quote from: Admiral_Thrawn
Considerata la pistola, non mi stupirei se intendesse dire che ad ogni colpo gli partiva via pure un dito :D

xenoargh

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Attaching a scene prop/collision mesh to mounts
« Reply #4 on: April 30, 2012, 02:26:44 AM »
So far as I know, horses are limited to one skeleton, period.   They aren't like Races, where you can define a different skeleton, unless that's something new that's been added in 1.150+.

So you can make an "elephant" skeleton, but the engine won't use it. 

More importantly, even if that problem could be gotten around, it would still use horse animations, etc.

About the only way around this is to make a new "horse" skeleton that has the "elephant" bones and keeps them buried underground

cmpxchg8b

  • Modder++
  • Grandmaster Knight
  • *
  • Master of rglPool
    • View Profile
  • Faction: Vaegir
  • MP nick: cmp
  • M&BWBWF&SNW
Re: Attaching a scene prop/collision mesh to mounts
« Reply #5 on: April 30, 2012, 12:13:09 PM »
About the only way around this is to make a new "horse" skeleton that has the "elephant" bones and keeps them buried underground
That won't work, unless you only need 4 additional bones (horse has 28, max is 32).
Warband Script Enhancer v3.1.5 - additional operations, game scripts and triggers for Warband modders

xenoargh

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Attaching a scene prop/collision mesh to mounts
« Reply #6 on: April 30, 2012, 03:35:29 PM »
Four bones is probably enough for a few things; if the "horse" was kept to a really low speed and couldn't enter the gallop state, it'd probably be acceptable for an elephant. 

Meh, I should probably not talk about it unless I've done it, though; all I did was rig a camel :-)

Perkele_JOPOTINTTI

  • Sergeant Knight at Arms
  • *
    • View Profile
  • Faction: Rhodok
  • MP nick: Korpi_Jopo
  • WBWF&SNW
Re: Attaching a scene prop/collision mesh to mounts
« Reply #7 on: April 30, 2012, 04:18:15 PM »
Can you attach scene props to the player  :lol: ?

MadocComadrin

  • Water-Borne Annelid
  • Grandmaster Knight
  • *
  • ...et cum iustis non scribantur.
    • View Profile
  • Faction: Neutral
  • MP nick: MadocComadrin
  • M&BWBWF&S
Re: Attaching a scene prop/collision mesh to mounts
« Reply #8 on: April 30, 2012, 04:21:47 PM »
Yes.
Resident Wereparakeet - Tasty and Dangerous Pastry
Madmin - Sophistacted tools for responsible admins


La Grandmaster

  • Squire
  • *
  • I feel it in the water, I feel it in the earth.
    • View Profile
  • Faction: Nord
Re: Attaching a scene prop/collision mesh to mounts
« Reply #9 on: April 30, 2012, 05:38:09 PM »
Thanks MadocComadrin  :D  ill give that a shot. You talk about servers and clients, do I need to do all that if i only want to use this in single player?

I cant use what john xenir said because hit boxes (for mounts anyway) do not prevent players from walking through the mount. Iv looked into this quite alot and I think that the horses "collision mesh" is hardcoded into the game and cant be moded. Neither do bones act as a sort of collision mesh so I cant use the bone method either  :(

MadocComadrin

  • Water-Borne Annelid
  • Grandmaster Knight
  • *
  • ...et cum iustis non scribantur.
    • View Profile
  • Faction: Neutral
  • MP nick: MadocComadrin
  • M&BWBWF&S
Re: Attaching a scene prop/collision mesh to mounts
« Reply #10 on: April 30, 2012, 06:40:47 PM »
Thanks MadocComadrin  :D  ill give that a shot. You talk about servers and clients, do I need to do all that if i only want to use this in single player?
No.  You only need to attach the scene prop once in whatever trigger is setting everything up if it's just single player.
Resident Wereparakeet - Tasty and Dangerous Pastry
Madmin - Sophistacted tools for responsible admins


Perkele_JOPOTINTTI

  • Sergeant Knight at Arms
  • *
    • View Profile
  • Faction: Rhodok
  • MP nick: Korpi_Jopo
  • WBWF&SNW
Re: Attaching a scene prop/collision mesh to mounts
« Reply #11 on: May 02, 2012, 07:12:03 PM »
Lol make a wooden suit where only your feet are visible :d , power armor.