netugi

Danmakufu: Custom Item Data issue

Apr 30th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. //Item_Script.txt, copy-pasted from official Danmakufu ph3 documentation on item scripts, comments removed.
  2. @Initialize
  3. {
  4. SetDefaultBonusItemEnable(false);
  5.  
  6. let dir = GetCurrentScriptDirectory();
  7. LoadItemData(dir ~ "Item_Data.txt")
  8. }
  9.  
  10. @MainLoop {
  11. yield;
  12. }
  13.  
  14. @Event
  15. {
  16. alternative(GetEventType())
  17. case(EV_GET_ITEM)
  18. {
  19. let itemType = GetEventArgument(0);
  20. let objItem = GetEventArgument(1);
  21. }
  22. case(EV_DELETE_SHOT_TO_ITEM)
  23. {
  24. let objShot = GetEventArgument(0);
  25. let objPos = GetEventArgument(1);
  26.  
  27. TUserItem(objPos[0], objPos[1]);
  28. }
  29. }
  30.  
  31. task TUserItem(let itemX, let itemY)
  32. {
  33. let obj = CreateItemU1(1, itemX, itemY, 10000);
  34. ObjItem_SetDefinedMovePatternA1(obj, ITEM_MOVE_TOPLAYER);
  35. }
  36. //End of script
  37.  
  38.  
  39. //Item_Data.txt
  40. #UserItemData
  41.  
  42. item_image = GetCurrentScriptDirectory() ~ "Point Sheet.png"
  43. //Error: "item_image is not defined." on startup.
  44.  
  45. ItemData { //Power Item
  46. id=0
  47. value=0
  48. AnimationData {
  49. animation_data=(10,3,3,16,16)
  50. animation_data=(10,19,3,32,16)
  51. }
  52. out=(35,3,48,16)
  53. }
  54.  
  55. ItemData { //Point Item
  56. id=1
  57. value=1
  58. AnimationData {
  59. animation_data=(10,3,19,16,32)
  60. animation_data=(10,19,19,32,32)
  61. }
  62. out=(35,19,48,32)
  63. }
  64.  
  65. ItemData { //1UP
  66. id=2
  67. value=2
  68. AnimationData {
  69. animation_data=(10,51,3,84,36)
  70. animation_data=(10,85,3,118,36)
  71. }
  72. }
  73.  
  74. ItemData { //Bomb
  75. id=3
  76. value=3
  77. AnimationData {
  78. animation_data=(10,51,35,84,68)
  79. animation_data=(10,85,35,118,68)
  80. }
  81. }
  82. //End of script
  83.  
  84.  
  85. //System.txt (only the initialize section)
  86. @Initialize
  87. {
  88. StartItemScript(GetCurrentScriptDirectory() ~ "Item_Script.txt");
  89. //a bunch of system tasks after...
  90. }
Add Comment
Please, Sign In to add comment