Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Forum Resident
Original Poster
#1 Old 22nd Jan 2008 at 9:13 PM
Default How to create an object that uses dueling anims?
I've been looking at a couple of objects that sims can use to duel each other. Here at the site, there's JohnBrenhaut1's near infamous Warrior Sword. At simwardrobe, there's a set of dueling swords that use the anims from Bon Voyage. I'm not the most experienced modder, but I've done some basic BHAV editing and I have a fair idea how they work. My question is:
1. Would it be possible to make an object that allows sims to duel using another object, like a bat'leth or lightsaber?
B. How difficult would it be and what resources would I have to edit?
III. Is this something I can do or is it too far over my head?

I'm no longer active here. My latest creations can be found here:

https://blueheavensims.wordpress.com
Advertisement
Alchemist
#2 Old 22nd Jan 2008 at 10:15 PM
The only real restrictions with reusing any existing animations is that they operate on joints by name. You do get a free root_rot and root_trans in an unjointed object, but otherwise trying to apply a car animation to the flamingo which doesn't have any joints with the same name would not have the desired effect.

Adding and renaming joints is possible, it is done in the CRES for your object and it is not easy.

Now, for your main question, I think that the only animations involved in this are to place the object in the hand slot, and then some animations that operate on the sims, making their arms move about like swordplay. The animations are referenced by name from the BHAV, and must stay in group 0x1c0532fa, so there is little purpose in having a copy of them in your package unless they are modified.

So, essentially, if the swords were to be remade as light sabers and all the same animations and BHAVs from the sword package applied, then it should work the same. If your light sabers were longer or shorter than the sword length, then the action might not look right, because the arm movements (well, all the movements) will be the same unless you change the animation itself. Which is possible, but time consuming.

I don't think cloning the swords and remaking them as light sabers would be too difficult for you, you seem to follow direction well and there are several cloning tutorials on site. Without actually starting the project myself, I am not certain if any ugly issues will rear their heads, but it sounds like a viable project to me.

<* Wes *>

If you like to say what you think, be sure you know which to do first.
Retired Duck
retired moderator
#3 Old 23rd Jan 2008 at 1:13 AM
If you're looking at the style of John's sword, then it's certainly possible, and I would imagine that it should be accessible for you given a bit of patience. I haven't looked at any of the BV animations, so I can't comment on how hard they would be to integrate. If they're all single sim animations it should be easy enough.

The only real issues with these sorts of "duels" are of timing and positioning. Having two individuals wave bat'leths around at one another is quite doable. Having those two individuals actually lock bat'leths, or dodge blows, or something like that where the timing and the positioning of the sims and the weapons has to be very precise, is a good deal more complicated.
Forum Resident
Original Poster
#4 Old 25th Jan 2008 at 12:17 AM
Okay. Step 1. Build the decorative object in Blender. I have that done. Now, John's object uses a seperate object not included in the GMDC that appears in the sim's hand. I've made that object, but don't know what to do with it.

I'm no longer active here. My latest creations can be found here:

https://blueheavensims.wordpress.com
Retired Duck
retired moderator
#5 Old 25th Jan 2008 at 3:00 AM
There's a bit of "if I knew then what I know now" that I'm going to use here, because I know why John did the sword the way he did and we now know slightly better ways to work it.

Can I assume that your decorative object is a bit like a wall mounted Bat'leth display (like Worf has up in his quarters)? If so, here's how I would make it if I (you) were making a new object. This description of the process is fairly high level, I can go into more detail on parts if/when you want it.

Put your decorative object mesh into a deco object. Inside that, create a new GMDC/SHPE/CRES/etc to make a new scenegraph chain. There's some info on doing that in this thread:
http://www.modthesims2.com/member/s...ad.php?t=220742

Make sure you remember to add the new GMDC to the mesh text lists. Then, in the new GMDC, put in a new version of the mesh, this time with no bat'leth.

Now, in the "Function - Main" of the BHAV, enter a couple of lines at the top. Make the first one something like "idle(1)", then make the second line "expression (my graphic := literal 2)" (or whichever line the new GMDC is in the text list).

Now when you put the object in game it should initially look like it has a Bat'leth in it, but when you go into live mode it should switch to the version of the mesh which doesn't have a Bat'leth.

Once you've got this working I can explain the rest, but for the curious it basically goes like this:
- Create a container and routing slot in the "empty" version of the cres
- Place the mesh (with fake bat'leth)
- Enter live mode
- Spawn a real bat'leth (cloned from a carryable object) in a slot of the deco object
- Put your "waving around" code into the Bat'leth.
- At the start of the waving code, do a check to see if the object is contained within another object. If it is, then run some "pick me up" code to get the sim to the routing slot and snap the real bat'leth into the sim's hand.
- Write code in the bat'leth to "put away", routing to the deco object and snapping the bat'leth back into the container slot.
Forum Resident
Original Poster
#6 Old 28th Jan 2008 at 12:19 AM
Okay. So I have a decorative bat'leth stand. I've cloned it and added a second GMDC. Now in the second GMDC do I delete the bat'leth subset and leave the stand? Also, how can I tell that the new GMDC is linked to the SHPE and CRES resources, and how do I link it to the text lists?

I'm no longer active here. My latest creations can be found here:

https://blueheavensims.wordpress.com
Retired Duck
retired moderator
#7 Old 28th Jan 2008 at 1:29 AM
The text list is the one with instance 0x85, and you need to add a line to the end which is the same as the existing one but with your new GMDC's name in place. So say it was:
0x0:
0x1: ##0x1C050000!batlethstand-[echo-17.12.2007-14296]

the new one should be
0x0:
0x1: ##0x1C050000!batlethstand-[echo-17.12.2007-14296]
0x2: ##0x1C050000!batlethstand-[echo-17.12.2007-14296]-empty

or some such, depending on what you named your new GMDC.

In the second one, (which you should have renamed now, to match the new entry in the text list), remove the bat'leth. After you rename it, you'll probably have to reconnect the cres and shpe resources btw. You can tell if it's correctly connected in one of two ways. The first is to try previewing it in the GMDC view. Most problems will result in an error message at that screen if things aren't connected. If that works, check it in the scenegrapher (tools > object tools > scenegrapher) and make sure everything is connected correctly.
Forum Resident
Original Poster
#8 Old 28th Jan 2008 at 5:23 AM
It appears to be working correctly. The first GMDC appears as the stand with the bat'leths on it, and the second GMDC appears as the empty stand. Can I assume I got that part correct? So then the next step is writing a couple of command lines in the BHAV that says Function- Main. What am I supposed to write?

I'm no longer active here. My latest creations can be found here:

https://blueheavensims.wordpress.com
Retired Duck
retired moderator
#9 Old 28th Jan 2008 at 5:38 AM
Should be okay. If you want me to double check just post and I'll take a look.

The first line of the "Function - Main" should be idle (0x118), with some small number as its passed in parameter (1 is good). That one should connect to the next line, which should be Expression (0x2), then use the wizard to set it to "my graphic := literal [the number of the line in the text list]". Then connect it to whatever was already there.
Forum Resident
Original Poster
#10 Old 29th Jan 2008 at 3:31 AM
Default I think I got it
I can't figure out how to adjust the value of idle and I can't find my graphic. Maybe I'm not looking in the right place.
Attached files:
File Type: rar  Dueling Bat'leths.rar (251.5 KB, 8 downloads) - View custom content

I'm no longer active here. My latest creations can be found here:

https://blueheavensims.wordpress.com
Retired Duck
retired moderator
#11 Old 30th Jan 2008 at 10:18 AM
You can set the value of idle by setting everything to 0 then editing the first field. "My Graphic" is actually "My" and "graphic". Like the attached. Haven't tested it, just edited the code.
Attached files:
File Type: zip  likeso.zip (333.0 KB, 4 downloads) - View custom content
Forum Resident
Original Poster
#12 Old 31st Jan 2008 at 6:24 AM
It appears correctly ingame. Do I need to test it further or is it okay to proceed to the next step?

I'm no longer active here. My latest creations can be found here:

https://blueheavensims.wordpress.com
Retired Duck
retired moderator
#13 Old 31st Jan 2008 at 11:07 AM
If that all works well in game then you're fine to keep going. A quick question about the end goal of this one - how did you want the dueling to work from a user point of view? Did you want them to pick up the Bat'leth, then click on another sim to duel with them? Or did you want to pick an option from the Bat'leth menu saying "Duel With >[List of sims]? Both are possible, but require slightly different strategies.

Have you written any interactions before? If not, I might get you to just read over this tutorial before we go on:
http://www.modthesims2.com/showthread.php?t=142907

Probably the easiest option at this point is to write an interaction in the deco stand which has the sim come over, spawn a bat'leth into his/her hand, then switch the stand's mesh to empty. (Technically you'll want to spawn the bat'leth into his/her wrist actually, since objects in the hand slot get destroyed at the end of the interaction).

Once the bat'leth is in one of the sim's slots, you can either build interactions into the Bat'leth for single-sim actions, or create social plugin objects for inter-sim actions. Add another option to the stand to "put away" too, which has the sim walk back over, switch the stand mesh back to the with-bat'leth version, and destroy the bat'leth in hand.

This isn't quite what I was suggesting in my first suggestion a few posts back, but it's still close, and this way you don't have to edit skeletons or add new slots.
Forum Resident
Original Poster
#14 Old 31st Jan 2008 at 3:14 PM
I want the object to do something similiar to JohnBrenhaut1's object. A couple of different pie menu options, one that enables body skilling and connects to the Tai Chi anims from Bon Voyage if it's possible, an option that says something like "Duel with[list of sims]" and connects to the dueling anims from BV, and an option that says "Kill >[list of sims]". That might be a little ambitious but if I have one quality it's stubornness... I mean perseverance.
I've read the tutorial and I think I understand it well enough. I attempted to make an object following the directions a while back. I understand the basic stuff (adding new commands, adding pie menu options, importing semi-globals) but if I'm going to fine tune it I'll need help.
Sorry for the delayed reaction responding. I'm splitting project time between this, shipbuilding, and taking on requests.

I'm no longer active here. My latest creations can be found here:

https://blueheavensims.wordpress.com
Retired Duck
retired moderator
#15 Old 31st Jan 2008 at 11:25 PM
I know all about splitting time between projects.

In that case, you can probably add a new interaction to your stand to "Practice with Bat'leth" (the body skilling option), and have a sim walk over, play a "pick up" animation that's about the right height, use a "Create New Object Instance" to spawn a bat'leth into the sim's hand, then play some animations and build the skill as per this tute:
http://www.modthesims2.com/showthread.php?t=222531
Then walk back to the stand, destroy object instance for the bat'leth, and switch the graphic on the stand.
Forum Resident
Original Poster
#16 Old 1st Feb 2008 at 1:18 AM
Default The basic components are there..
but when I test the object ingame, the pie menu says "View" twice. I renamed the option "Practice with Bat'leth" in the Pie Menu string, and linked it to the BHAV I created. Why doesn't it appear correctly?
Attached files:
File Type: rar  Dueling Bat'leths- In progress.rar (250.5 KB, 3 downloads) - View custom content

I'm no longer active here. My latest creations can be found here:

https://blueheavensims.wordpress.com
Retired Duck
retired moderator
#17 Old 1st Feb 2008 at 9:33 AM
You've still got the guard function from the painting in there. That guard function has calls to "Add/Change the action string", which overrides the text you've set there. Just take away the guard and it should show up.
Forum Resident
Original Poster
#18 Old 1st Feb 2008 at 1:06 PM
How do I do that?

I'm no longer active here. My latest creations can be found here:

https://blueheavensims.wordpress.com
Retired Duck
retired moderator
#19 Old 2nd Feb 2008 at 12:35 AM
In the ttab for that interaction, change the numbers in the "Guardian BHAV" box to 0s.
Forum Resident
Original Poster
#20 Old 2nd Feb 2008 at 5:57 AM
Okay. Got it. Pie menu string, linked to the custom BHAV, using the pie menu function. Pie menu appears the way it should in the game. So now I write the command lines to the BHAV, right? The first one is "Go to relative position". I didn't get too crazy, just used "in front of, to right". So what lines can I write to make the sim pick up the bat'leth, practice with it, and gain body skilling?

I'm no longer active here. My latest creations can be found here:

https://blueheavensims.wordpress.com
Retired Duck
retired moderator
#21 Old 2nd Feb 2008 at 9:14 AM
Picking up the bat'leth will be a call to "Create New Object Instance". Use the GUID of the bat'leth you've created, and spawn it in "My slot 0". For practicing, that's just playing some animations on the sim. For body skilling you should read this one:
http://www.modthesims2.com/showthread.php?t=222531
Forum Resident
Original Poster
#22 Old 2nd Feb 2008 at 3:01 PM
Each step raises more questions.
1. My decorative object has 3 bat'leths on the stand. To spawn the bat'leth part in the sim's hand, would I have to alter my original mesh, or does it even matter?
2. I think I have a pretty good basic BHAV written, but when I try to change the anims, I only get the ones available for decorative objects. I imported the bookcase anims for the sim to pick up the object. Where are they hiding?
3. Where are the Tai Chi anims located?

I'm no longer active here. My latest creations can be found here:

https://blueheavensims.wordpress.com
Retired Duck
retired moderator
#23 Old 3rd Feb 2008 at 4:50 AM
1. You don't spawn the bat'leth part, you have another object which is cloned from something that can be held (take your pick of the hand-friendly accessory objects in OW) and put the mesh for the bat'leth in that. This is the object you spawn in the sim's hand.
2. I'm not sure what you mean... You need to add the names of the animations you want to the list of animations, just like you did in the "first bhav" tutorial.
3. You can find the name of an animation by going in game, starting up the animation billboard (go into the cheat window and type help for a list of cheats, it's something like showanimbillboard [simname]). That'll bring up a black box above the sim's head listing the names of any animations playing on that sim. Just make your sim do the animation, and you'll have the name of the animation you want to play.
Forum Resident
Original Poster
#24 Old 6th Feb 2008 at 2:16 AM
Default I don't know exactly what I did...
but I messed it up big time. The object appears ingame with the option for the interaction enabled, but when the sim tries to interact with the object, the object disappears. Btw, I figured out how to link the anim names to the BHAVs, but I don't get Slots at all.
Attached files:
File Type: rar  Dueling Bat'leths- In progress.rar (264.3 KB, 3 downloads) - View custom content

I'm no longer active here. My latest creations can be found here:

https://blueheavensims.wordpress.com
Retired Duck
retired moderator
#25 Old 6th Feb 2008 at 9:02 AM
Couple of quick notes, because I'm a bit pressed for time tonight

- In the "Create New Object Instance", you want to spawn the object in "My slot 0x00", not "Stack Object's slot 0x00".
- You haven't included your object with the GUID 0x001F109E - what was it cloned from, and is it something designed to go into a sim's hand?
- You've got your "Skill End" before your "Skill Start", so once started your sim won't stop skilling.
- You've got an "Animate Overlay" call which is looking to global text lists, rather than local text lists. I think perhaps it was meant to be an "Animate Sim" call?
- Everything's false target is returning false. If you don't think a false target should ever get executed, it should point to error. Otherwise you should try and handle it.

Unlike putting meshes in game, creating BHAVs is probably best done incrementally. Code a bit, then test. Code a bit more, then test. That way you know which parts definitely work before adding anything more. Get the sim walking up and animating correctly, then add skill code and test, then add the object creation and test. It'll save you a lot of pain.
Back to top