I want to choose the necessary animations while converting weapons.

xyz555

Member
In some cases, although I have to change the weapon, I can choose the necessary animation, so I used the script to convert the weapon, but the problem is that this script can not be  normally, Falling weapon props...........
Thank you, all, big brother........



anim freespecial5
@script
if (frame==0){
                void self = getlocalvar("self");
changeentityproperty(self,"weapon",3);
                performattack(self,openborconstant("ANI_freespecial2"),1);
              }
              @end_script

        OffSet 176 176
          Delay 20
@cmd leaper 1.3 0 0
      Attack 112 146 109 36 1 0 0 0 15
BBox 142 76 37 99
      sound data/sounds/horse2.wav
      Frame data/chars/xiahoudun/horse/stop001.gif
      Attack 118 141 100 40 1 0 0 0 15
BBox 148 77 30 99
      Frame data/chars/xiahoudun/horse/stop002.gif
Attack 122 144 99 37 1 1 0 0 15
BBox 154 77 32 100
      Frame data/chars/xiahoudun/horse/stop003.gif
 
This won't work. Because right after you change the weapon, the model will be changed and that performattack will be ignored.
 
O Ilusionista said:
This won't work. Because right after you change the weapon, the model will be changed and that performattack will be ignored.

But now,  can appear animate after turning the weapon,....
Just weapon  can't come down the  on the ground...
You can give it a try.
Thank you...



 
I can't understand very well what you are trying to do. Do you need to make the weapon (item) to fall on the groud?
Just spawn that item before the change weapon line.
 
O Ilusionista said:
I can't understand very well what you are trying to do. Do you need to make the weapon (item) to fall on the groud?
Just spawn that item before the change weapon line.

The  can now be done, It at    the
when converting weapons.
is to be able appear animate
  but it just can't let the weapon on hand fall off the ground again..

Thank you...
 
O Ilusionista said:
I can't understand very well what you are trying to do. Do you need to make the weapon (item) to fall on the groud?
Just spawn that item before the change weapon line.



[attachment deleted by admin]
 
xyz555 said:
O Ilusionista said:
I can't understand very well what you are trying to do. Do you need to make the weapon (item) to fall on the groud?
Just spawn that item before the change weapon line.

(ps simulated picture)
He jumped from the horse, turned to the animation with jumps when changing weapons, and dropped the horse again...
 
O Ilusionista said:
I can't understand very well what you are trying to do. Do you need to make the weapon (item) to fall on the groud?
Just spawn that item before the change weapon line.


Yes, I need to have the animation of changing the weapon while changing the weapon, and the weapon also falls on the ground at the same time.
 
Bloodbane said:
If you use weaponframe to revert to default model, you'll drop the weapon

But I don't know how I can use script statements to revert to the default model while converting weapons and necessary animations, so that it can drop weapons at the same time. Request,Bloodbane can teach me, very grateful, thank you!!

anim  freespecial5
@script
      if (frame==0){
                void self = getlocalvar("self");
      changeentityproperty(self,"weapon",3);
                performattack(self,openborconstant("ANI_freespecial2"),1);
            (??Script statement?
Restore the default model so that it can drop weapons at the same time)

                    }
              @end_script


        OffSet  176 176
          Delay  20
  @cmd  leaper 1.3 0 0
      Attack  112 146 109 36 1 0 0 0 15
  BBox  142 76 37 99
      sound  data/sounds/horse2.wav
      Frame  data/chars/xiahoudun/horse/stop001.gif
      Attack  118 141 100 40 1 0 0 0 15
  BBox  148 77 30 99
      Frame  data/chars/xiahoudun/horse/stop002.gif
    Attack  122 144 99 37 1 1 0 0 15
  BBox  154 77 32 100
      Frame  data/chars/xiahoudun/horse/stop003.gif






 
I think what he means by weaponframe is a hard code one, not with script statement. (Not sure it'll work.)

anim  freespecial5
@script
      if (frame==0){
                void self = getlocalvar("self");
                performattack(self,openborconstant("ANI_freespecial2"),1);
                    }
              @end_script

        OffSet  176 176
          Delay  20
        weaponframe 0 3 # weaponframe {frame} {weapon}
  @cmd  leaper 1.3 0 0
      Attack  112 146 109 36 1 0 0 0 15
  BBox  142 76 37 99
      sound  data/sounds/horse2.wav
      Frame  data/chars/xiahoudun/horse/stop001.gif
      Attack  118 141 100 40 1 0 0 0 15
  BBox  148 77 30 99
      Frame  data/chars/xiahoudun/horse/stop002.gif
    Attack  122 144 99 37 1 1 0 0 15
  BBox  154 77 32 100
      Frame  data/chars/xiahoudun/horse/stop003.gif
 
I've made some tests and changing weapon model will also instantly revert animation back to IDLE :( . IOW you may not be able to drop weapon and play certain animation at same time

I can imagine some workarounds such as:
1. Faking
Player spawns a fake horse weapon right when he jumps. Then when he lands, he drops the real horse weapon at where he jumps before. This method is really unstable
2. Alternate weapon usage
This is complex since horse weapon will have to be designed differently i.e horse weapon is regular item which changes player's model into horseride model when taken. Unlike weapon, the item is removed after being taken
The idea is when player jumps out of horse, he drops that horse weapon then change weapon model when he lands. since the weapon item was removed, he won't drop anything when he changes weapon model. This method is stable

Haven't tried any of those myself though
 
Bloodbane said:
I've made some tests and changing weapon model will also instantly revert animation back to IDLE :( . IOW you may not be able to drop weapon and play certain animation at same time

I can imagine some workarounds such as:
1. Faking
Player spawns a fake horse weapon right when he jumps. Then when he lands, he drops the real horse weapon at where he jumps before. This method is really unstable
2. Alternate weapon usage
This is complex since horse weapon will have to be designed differently i.e horse weapon is regular item which changes player's model into horseride model when taken. Unlike weapon, the item is removed after being taken
The idea is when player jumps out of horse, he drops that horse weapon then change weapon model when he lands. since the weapon item was removed, he won't drop anything when he changes weapon model. This method is stable

Haven't tried any of those myself though

Thank you Bloodbane, I will try, I am very grateful for your help :) Thank you!!! ;)
 
Here:
Instead of changing the weapon, change the player property "model".

changeplayerproperty(playerindex, propname, value)

Property names:
"model" - Change the model by name, follow the name is another argument, 0 means keep current animation, 1 means reset to default.

so it will keep the current animation on the new model
 
O Ilusionista said:
Here:
Instead of changing the weapon, change the player property "model".

changeplayerproperty(playerindex, propname, value)

Property names:
"model" - Change the model by name, follow the name is another argument, 0 means keep current animation, 1 means reset to default.

so it will keep the current animation on the new model

This is a bit complicated for me. Can this senior can provide some examples? Thank you.
 
I would need time to try the code (I am writing it from the top of my head), but try this:

Code:
@script
void self = getlocalvar("self");
int PIndex = getentityproperty(self,"playerindex");
changeplayerproperty(PIndex, "model", "NAME_OF_THE_MODEL", 0);
@end_script

Warning: model name, in script, is CASE SENSITIVE. So if your new model is "xiahoudunHorse", you need to write exactly you have on your character header, ok?
 
O Ilusionista said:
I would need time to try the code (I am writing it from the top of my head), but try this:

Code:
@script
void self = getlocalvar("self");
int PIndex = getentityproperty(self,"playerindex");
changeplayerproperty(PIndex, "model", "NAME_OF_THE_MODEL", 0);
@end_script

Warning: model name, in script, is CASE SENSITIVE. So if your new model is "xiahoudunHorse", you need to write exactly you have on your character header, ok?

Ok, thank you very much for your help, thank you. :)
 
xyz555 said:
xyz555 said:
O Ilusionista said:
I would need time to try the code (I am writing it from the top of my head), but try this:

Code:
@script
void self = getlocalvar("self");
int PIndex = getentityproperty(self,"playerindex");
changeplayerproperty(PIndex, "model", "NAME_OF_THE_MODEL", 0);
@end_script

Warning: model name, in script, is CASE SENSITIVE. So if your new model is "xiahoudunHorse", you need to write exactly you have on your character header, ok?

But it doesn't seem to work :)
Because after the conversion of weapons and animations, when the protagonist is dismounting, he still can’t  again, Fall off horses. :)
 

Attachments

  • a.gif
    a.gif
    796.7 KB · Views: 8
You want to make the character to dismount from the Horse, right?
You will be using the same animation name for both models. lets call the characters KAN and KANH (with horse).

How he will be changing from one model to another? Getting an item?
Using a command?
 
Back
Top Bottom