Notices
For all updates, view the main page.

Pokémon Essentials All questions and discussion about Pokémon Essentials, the Pokémon game kit for RPG Maker XP, go in here. Also contains links to the latest downloads and the Essentials Wiki.

Reply
 
Thread Tools
  #1    
Old August 12th, 2016 (4:00 AM).
kevios105 kevios105 is offline
 
Join Date: Aug 2016
Gender: Male
Posts: 9
Hello,

i was searching a long time but nothig found about this... its possible to make a item that you can only use at a trainer battle to escape them?

it would be very awesome if someone can help me...

Sorry for my bad english
Reply With Quote

Relevant Advertising!

  #2    
Old August 12th, 2016 (7:00 AM).
The Master's Avatar
The Master The Master is offline
 
Join Date: Dec 2014
Location: Italy
Age: 23
Gender: Male
Nature: Adamant
Posts: 287
Into PItem_ItemEffects script section, after these lines:

Code:
ItemHandlers::BattleUseOnBattler.add(:POKEDOLL,proc{|item,battler,scene|
   battle=battler.battle
   if battle.opponent
     scene.pbMessage(_INTL("Can't use that here."))
     return false
   else
     playername=battle.pbPlayer.name
     itemname=PBItems.getName(item)
     scene.pbDisplay(_INTL("{1} used the {2}.",playername,itemname))
     return true
   end
})

ItemHandlers::BattleUseOnBattler.copy(:POKEDOLL,:FLUFFYTAIL,:POKETOY)
Add this:

Code:
ItemHandlers::BattleUseOnBattler.add(:YOURITEM,proc{|item,battler,scene|
   battle=battler.battle
   playername=battle.pbPlayer.name
   itemname=PBItems.getName(item)
   scene.pbDisplay(_INTL("{1} used the {2}.",playername,itemname))
   return true
   end
})
It should work for you.
Reply With Quote
  #3    
Old August 12th, 2016 (9:44 AM).
kevios105 kevios105 is offline
 
Join Date: Aug 2016
Gender: Male
Posts: 9
Thank you but i doesnt work for me i get syntax error and i dont know why ... here is my code:
PokemonItemEffects
Quote:
ItemHandlers::BattleUseOnBattler.add(OKEDOLL,proc{|item,battler,scene|
battle=battler.battle
if battle.opponent
scene.pbDisplay(_INTL("Can't use that here."))
return false
else
playername=battle.pbPlayer.name
itemname=PBItems.getName(item)
scene.pbDisplay(_INTL("{1} used the {2}.",playername,itemname))
return true
end
})

ItemHandlers::BattleUseOnBattler.add(:FLUCHTSTEIN,proc{|item,battler,scene|
battle=battler.battle
playername=battle.pbPlayer.name
itemname=PBItems.getName(item)
scene.pbDisplay(_INTL("{1} used the {2}.",playername,itemname))
return true
end
})
and here the items.txt
Quote:
532,FLUCHTSTEIN,FLUCHTSTEIN,8,9900,Mit diesen Stein kannst du flüchten wenn du ein Trainer Pokemon gefangen hast.,0,2,6,
can you help me to find my failure?

EDIT: Sorry im new in this only try to learn it plz help me
Reply With Quote
  #4    
Old August 12th, 2016 (12:22 PM).
The Master's Avatar
The Master The Master is offline
 
Join Date: Dec 2014
Location: Italy
Age: 23
Gender: Male
Nature: Adamant
Posts: 287
Can you post your errorlog.txt?
Reply With Quote
  #5    
Old August 12th, 2016 (12:40 PM).
kevios105 kevios105 is offline
 
Join Date: Aug 2016
Gender: Male
Posts: 9
where can i find this txt about the errors? or how can i setup this?
Reply With Quote
  #6    
Old August 12th, 2016 (12:56 PM).
The Master's Avatar
The Master The Master is offline
 
Join Date: Dec 2014
Location: Italy
Age: 23
Gender: Male
Nature: Adamant
Posts: 287
C:\Users\YOURNAME\Saved Games
Reply With Quote
  #7    
Old August 12th, 2016 (7:52 PM).
mej71's Avatar
mej71 mej71 is offline
Moderator
 
Join Date: Mar 2014
Location: Omnipresence
Gender: Male
Posts: 1,089
Quote:
Originally Posted by kevios105 View Post
Thank you but i doesnt work for me i get syntax error and i dont know why ... here is my code:
PokemonItemEffects


and here the items.txt

can you help me to find my failure?

EDIT: Sorry im new in this only try to learn it plz help me :)
The syntax error was in Masters script that you copied

Code:
ItemHandlers::BattleUseOnBattler.add(:FLUCHTSTEIN,proc{|item,battler,scene|
   battle=battler.battle
   if battle.opponent
     scene.pbMessage(_INTL("Can't use that here."))
     return false
   else
     playername=battle.pbPlayer.name
     itemname=PBItems.getName(item)
     scene.pbDisplay(_INTL("{1} used the {2}.",playername,itemname))
     return true
   end
})
Or you could use the easier route
Code:
ItemHandlers::BattleUseOnBattler.copy(:POKEDOLL,:FLUCHTSTEIN)
Reply With Quote
  #8    
Old August 12th, 2016 (9:26 PM).
Rot8er_ConeX's Avatar
Rot8er_ConeX Rot8er_ConeX is offline
 
Join Date: May 2015
Location: The Dissa Region
Gender: Male
Posts: 698
Quote:
Originally Posted by mej71 View Post
The syntax error was in Masters script that you copied



Or you could use the easier route
Code:
ItemHandlers::BattleUseOnBattler.copy(:POKEDOLL,:FLUCHTSTEIN)
Except I think he wants an item that allows him to flee a Trainer Battle (seems odd to me, but whatever). Which means the proper code is this:

Code:
ItemHandlers::BattleUseOnBattler.add(:FLUCHTSTEIN,proc{|item,battler,scene|
   battle=battler.battle
   if !battle.opponent
     scene.pbMessage(_INTL("Can't use that here."))
     return false
   else
     playername=battle.pbPlayer.name
     itemname=PBItems.getName(item)
     scene.pbDisplay(_INTL("{1} used the {2}.",playername,itemname))
     return true
   end
})
And copying the Poke Doll effect wouldn't work.
__________________
Features of Pokemon Entropy

The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
Reply With Quote
  #9    
Old 3 Weeks Ago (1:38 AM).
kevios105 kevios105 is offline
 
Join Date: Aug 2016
Gender: Male
Posts: 9
Quote:
Except I think he wants an item that allows him to flee a Trainer Battle (seems odd to me, but whatever). Which means the proper code is this:
this is right i want a item that i can use to flee from a trainer battle....

i used now you code "Rot8er_ConeX" but when i use my item "Fluchtstein" nothing happens i still in the battle.. =/

whats wrong? i copy & paste your code in "PokemonItemEffects" it would be really nice when anyone can help me

and thank you all for try to helping me
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 11:00 PM.