After using the script to convert the weapon.....

xyz555

Member
I am troubled. Because in the game I am making, under some special the player must use the (changeentityproperty(self, "weapon", 1)script To switch weapons. But the problem is. When the player turns the weapon with his foot,

it is impossible to drop the  weapon at the moment of being hit and falling to the ground.


 

anim follow1
@script
if (frame==0){
                void self = getlocalvar("self");
changeentityproperty(self,"weapon",1);
              }
              @end_script
Delay 5
        OffSet 164 171
BBox 156 109 19 64
        @cmd damage 500  1 "ATK_NORMAL1"
Frame data/chars/guanyu/a1.gif
Delay 8
Attack 182 108 55 29 5 0 0 0 20
BBox 156 109 19 64
Frame data/chars/guanyu/a2.gif
Delay 5
        Attack 0
Frame data/chars/guanyu/a3.gif

 
It's hard to understand the problem without seeing or experiencing it directly.

Can you pack Guan Yu together with his horseride model and horse weapon for us to try? and include anything else required by this weapon system :)
 
Bloodbane said:
It's hard to understand the problem without seeing or experiencing it directly.

Can you pack Guan Yu together with his horseride model and horse weapon for us to try? and include anything else required by this weapon system :)

Hello, Mr. Bloodbane, I thank you very much. I can send you a version for testing the problem (it is a compressed file of about 6500KB) to see, but how can I send it to you?
thank you.
 
I have also experienced this issue the problem is changing weapon by script. In the normal case of picking up a weapon you have grabbed a weapon entity that was on the screen and in the background that weapon entity is hidden below the screen to be pushed back on the screen when you get hit or fall. When you change weapon by script to emulate this behaviour you could use a custom takedamagescript to spawn the corresponding weapon in the correct place but this will cause other problems.
 
Bloodbane said:
You can upload it to any free file hosting site and share the link here Or you can send it to my email address : dewodpnx@yahoo.com :)

Thank you Mr. Bloodbane, I am very grateful for your attention and generosity.
I will now send you a test version. You can take a look  thank you
 
msmalik681 said:
I have also experienced this issue the problem is changing weapon by script. In the normal case of picking up a weapon you have grabbed a weapon entity that was on the screen and in the background that weapon entity is hidden below the screen to be pushed back on the screen when you get hit or fall. When you change weapon by script to emulate this behaviour you could use a custom takedamagescript to spawn the corresponding weapon in the correct place but this will cause other problems.
I also tried the method you mentioned, but it is indeed untrue, because it will cause other problems. If you use a script to convert weapons. It must be able to drop the weapon rightly before the problem can be solved
 
the entity property "weapent" holds the weapon entity that is dropped so as a test I spawned a weapon entity then tried to force it into the players "weapent" but it caused a crash.
this was the script I tried:
Code:
void parent = GEP(self,"parent");
CEP(parent, "weapent",self);

and this was the report:
Code:
Script function 'changeentityproperty' returned an exception, check the manual for details.
 parameters: #41993808, 189, #42062736,  
 
********** An Error Occurred **********
*            Shutting Down

the work around is to have normal items (not weapons) that use a script to change the player weapon model then use a takedamagescript to change back on any hit and spawn the item again.
 
Back
Top Bottom