Hi,
I made a weapon based on the hammer, but it's not working as I want it to.
1. The attack animation won't work. The animation is just 5 frames (textures). In pose.xml, this was added to make it change texture:
<Pose name="Frame1">
obj.model.fill.change(0,frame);
2. Is there a way to make the weapon stay where it is? Look
here to see what I mean. The first picture is from when you look down and the second from when you look at the center. If you look up, the weapon dissappears completely off the screen. I guess it just stays where it is, but is there a way to make it follow as you look around?
3. How do I get rid of those ugly white outlines? (see picture) They look awful.:annoyed:
Thanks.
maybe you could move the weapon closer to the player... or perhaps you could tilt the bottom toward the player, so it almost simulates depth...
yeah, links are hard to read on this forum, but are easier to find when in the:
http://server2.uploadit.org/files/ledorax-hatred.jpg
:format
:lol: ledorax-hatred.jpg :lol:!
i understand you :D!
Ledorax Wrote:1. The attack animation won't work. The animation is just 5 frames (textures). In pose.xml, this was added to make it change texture:
<Pose name="Frame1">
obj.model.fill.change(0,frame);
Did you put script inside the XML? That won't work, they are different things, or are you trying to show me something different?
Ledorax Wrote:2. Is there a way to make the weapon stay where it is? Look here to see what I mean. The first picture is from when you look down and the second from when you look at the center. If you look up, the weapon dissappears completely off the screen. I guess it just stays where it is, but is there a way to make it follow as you look around?
You're going to have to play with some values. Since weapons are actually in 3D space, they are actually reacting how they would in the real world if you held them at the same place but looked up and down. So what you need to do is add in the changes you would make to your hand while looking up and down, note:
Code:
handPosition
...x....................................integer; x shift for weapon in hand
...y....................................integer; y shift for weapon in hand
...z....................................integer; z shift for weapon in hand
...lookAngleZUpAdjust........float; adjustment for z distances when looking up
...lookAngleZDownAdjust........float; adjustment for z distances when looking down
...lookAngleYUpAdjust........float; adjustment for y when looking up
...lookAngleYDownAdjust........float; adjustment for y when looking down
It's the "adjust" numbers you'll want to play with.
Ledorax Wrote:3. How do I get rid of those ugly white outlines? (see picture) They look awful.:annoyed:
Is this weapon just a flat texture? If so, you're alpha is probably off.
[>] Brian
ggadwa Wrote:Did you put script inside the XML? That won't work, they are different things.
Then where do I put it? I can't seem to find any other pose scripts...
ggadwa Wrote:You're going to have to play with some values. Since weapons are actually in 3D space, they are actually reacting how they would in the real world if you held them at the same place but looked up and down. So what you need to do is add in the changes you would make to your hand while looking up and down, note:
It's the "adjust" numbers you'll want to play with.
Uh, I can't seem to find that in the weapon script. Or should I add it? If so, where..?
ggadwa Wrote:Is this weapon just a flat texture? If so, you're alpha is probably off.
Yeah, it's a couple of pictures used to make the weapon look like it attacks. How do I change the "alpha", though?
Ledorax Wrote:Then where do I put it? I can't seem to find any other pose scripts...
In a script, poses are for animations, scripts are for scripting. I'm guessing you are trying to do a weapon animation by changing bitmaps instead of running a skeletal animation. What you are going to have to do is setup a timer when they fire, and then use the fill.change in the weapon script. This isn't exactly trivial (though not that hard.)
I might be assuming, but if it's a set of claws, why not just create a 3D model and animate it? That would get rid of your white problem and you can run it all from the models, as the other dim3 weapons are.
Using a animated texture is certainly doable, but dim3 was setup to use models as weapons, so it'll force you to do a bunch of scripting.
Ledorax Wrote:Uh, I can't seem to find that in the weapon script. Or should I add it? If so, where..?
You'd want to add it, in the construct. The other scripts don't use these because the weapons are big or long enough to not need it. Again, go to a 3D model and you won't have any of these problems.
Check out the scripting reference for weapons in the docs for a bit more info.
Ledorax Wrote:Yeah, it's a couple of pictures used to make the weapon look like it attacks. How do I change the "alpha", though?
In your image editor -- what one are you using?
[>] Brian
ggadwa Wrote:IWhat you are going to have to do is setup a timer when they fire, and then use the fill.change in the weapon script.
How..? I read the documentation, and it says that there is a "startTimer(frequency_ticks,id);" thing, but not how I use it. How do I set it to how long it should wait before changing the texture?
ggadwa Wrote:I might be assuming, but if it's a set of claws, why not just create a 3D model and animate it?
Actually, it's a pitchfork.

I think it's good enough as it is, it just needs to work.
ggadwa Wrote:You'd want to add it, in the construct. The other scripts don't use these because the weapons are big or long enough to not need it. Again, go to a 3D model and you won't have any of these problems.
Okay, I'll do that. But where do I put the numbers?
ggadwa Wrote:Ledorax Wrote:Yeah, it's a couple of pictures used to make the weapon look like it attacks. How do I change the "alpha", though?
In your image editor -- what one are you using?
Photoshop...
Ledorax Wrote:How..? I read the documentation, and it says that there is a "startTimer(frequency_ticks,id);" thing, but not how I use it. How do I set it to how long it should wait before changing the texture?
How long you wait is up to whatever animation you want to do. For instance, do you want the bitmap to change every 1/10th of a second, or every half a second?
How to script it is easier to explain by example. Check out the "light color change" script (in objects.) In the DIM3_EVENT_CLICK event, it calls a function that starts a timer:
Code:
obj.event.startTimer(1,0);
This tells core to send a DIM3_EVENT_TIMER event to the script every 1/10th of a second (that's what the 1 parameter means, a 2 means every 2/10ths of a second, etc.)
The script captures the DIM3_EVENT_TIMER and sends it to a function which slowly changes the color of the light. Your function would change the texture fill. Once it's done, it turns off the timer by:
Code:
obj.event.clearTimer();
Ledorax Wrote:ggadwa Wrote:You'd want to add it, in the construct. The other scripts don't use these because the weapons are big or long enough to not need it. Again, go to a 3D model and you won't have any of these problems.
Okay, I'll do that. But where do I put the numbers?
I don't know what the numbers should be because it all depends on the size of your weapon. The defaults are:
lookAngleZUpAdjust=12.0
lookAngleZDownAdjust=18.0
lookAngleYUpAdjust=8.0
lookAngleYDownAdjust=8.0
Stay close to those and change them slightly till you see things getting better.
Ledorax Wrote:Photoshop...
I never actually used photoshop, so I won't be able to help you here.
[>] Brian