RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
ABS Help

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 83
So Seasame Street is on a roll
Hello everyone, I ripped and edited this code from PICCETA, but the only reason I edited it is because it didnt work right when I first put it in, so the editing is ok I guess but I want it to rely on the Stats of the hero and I haven't gotten an idea on how to have it hit the hero, if someone can help me fix this code to work perfectly (for all enemys made) I would be very grateful. Also for those stuck for storylines, I'm good at making storylines come to life.

Code: [Select]
Common Events Name: Battle
Trigger: Parallel Process
Trigger Switch: Battle

Variable Oper: [HeroATK] Set, Hero Attack
Variable Oper: [HeroDEF] Set, Hero Attack
Variable Oper: [HeroEVD] Set, Hero Attack
Variable Oper: [HeroMAG] Set, Hero Attack
Variable Oper: [HeroX] Set, Hero Attack
Variable Oper: [HeroY] Set, Hero Attack
Variable Oper: [EnemyX] Set, Hero Attack
Variable Oper: [EnemyY] Set, Hero Attack
Variable Oper: [EnemyATK] Set, [Blank]
Variable Oper: [EnemyDEF] Set, [Blank]
Variable Oper: [EnemyMAG] Set, [Blank]
Branch if Hero Up Facing
 Branch if Var [HeroX] is [EnemyX] Equal
  Variable Oper: [Temp] Set, Var [HeroY]
  Wait 0.1 Sec
  Variable Oper: [Temp] - , Var [EnemyY] Value
  Branch if Var [Temp] is 2 Less
   Variable Oper [Temp] Set, Var [HeroX] Value
   Wait 0.1 Sec
   Variable Oper: [EnemyY] - , Var [Temp] Value
   Branch if Var [Temp] is 2 less
    Flash Sprite: <Enemy>, 0.5 Sec
    Variable Oper: [Enemy1hp] - , 2
    Message Display Options: Transp, Bottom, Fixed, Processes Continue
    Message: Enemy HP:[ \v[Enemy1hp] ]
    Move Event: <Enemy> Lock Facing, Move Away from Hero, Unlock Facing\
    Branch if Var [enemy1hp] is 0 less
     Switch Operation: [enemy1die] ON
     Message: Battle Won
<b>code needed:     <EXP> Gained </b>
    :End
    Wait: Until Key Pressed
   :End
  :End
 :End
:End
Branch if Hero Down Facing
 Branch if Var [HeroX] is [EnemyX] Equal
  Variable Oper: [Temp] Set, Var [HeroY]
  Wait 0.1 Sec
  Variable Oper: [Temp] - , Var [EnemyY] Value
  Branch if Var [Temp] is 2 Less
   Variable Oper [Temp] Set, Var [HeroX] Value
   Wait 0.1 Sec
   Variable Oper: [EnemyY] - , Var [Temp] Value
   Branch if Var [Temp] is 2 less
    Flash Sprite: <Enemy>, 0.5 Sec
    Variable Oper: [Enemy1hp] - , 2
    Message Display Options: Transp, Bottom, Fixed, Processes Continue
    Message: Enemy HP:[ \v[Enemy1hp] ]
    Move Event: <Enemy> Lock Facing, Move Away from Hero, Unlock Facing\
    Branch if Var [enemy1hp] is 0 less
     Switch Operation: [enemy1die] ON
     Message: Battle Won
<b>code needed:     <EXP> Gained </b>
    :End
    Wait: Until Key Pressed
   :End
  :End
 :End
:End
Branch if Hero Right Facing
 Branch if Var [HeroY] is [EnemyY] Equal
  Variable Oper: [Temp] Set, Var [HeroX]
  Wait 0.1 Sec
  Variable Oper: [Temp] - , Var [EnemyX] Value
  Branch if Var [Temp] is 2 Less
   Variable Oper [Temp] Set, Var [HeroY] Value
   Wait 0.1 Sec
   Variable Oper: [EnemyX] - , Var [Temp] Value
   Branch if Var [Temp] is 2 less
    Flash Sprite: <Enemy>, 0.5 Sec
    Variable Oper: [Enemy1hp] - , 2
    Message Display Options: Transp, Bottom, Fixed, Processes Continue
    Message: Enemy HP:[ \v[Enemy1hp] ]
    Move Event: <Enemy> Lock Facing, Move Away from Hero, Unlock Facing\
    Branch if Var [enemy1hp] is 0 less
     Switch Operation: [enemy1die] ON
     Message: Battle Won
<b>code needed:     <EXP> Gained </b>
    :End
    Wait: Until Key Pressed
   :End
  :End
 :End
:End
Branch if Hero Left Facing
 Branch if Var [HeroY] is [EnemyY] Equal
  Variable Oper: [Temp] Set, Var [HeroX]
  Wait 0.1 Sec
  Variable Oper: [Temp] - , Var [EnemyX] Value
  Branch if Var [Temp] is 2 Less
   Variable Oper [Temp] Set, Var [HeroY] Value
   Wait 0.1 Sec
   Variable Oper: [EnemyX] - , Var [Temp] Value
   Branch if Var [Temp] is 2 less
    Flash Sprite: <Enemy>, 0.5 Sec
    Variable Oper: [Enemy1hp] - , 2
    Message Display Options: Transp, Bottom, Fixed, Processes Continue
    Message: Enemy HP:[ \v[Enemy1hp] ]
    Move Event: <Enemy> Lock Facing, Move Away from Hero, Unlock Facing\
    Branch if Var [enemy1hp] is 0 less
     Switch Operation: [enemy1die] ON
     Message: Battle Won
<b>code needed:     <EXP> Gained </b>
    :End
    Wait: Until Key Pressed
   :End
  :End
 :End
:End
-------------------------
Code: [Select]
Enemy Char: <name>
Trigger: Touched By Hero
Event layer: Same as Hero

Branch if Switch [enemy1die] is ON
 Switch Operation: [Battle] OFF
 Erase Event
:Else Handler
 Variable Oper: [enemy1hp] Set, Rnd[<depends on enemy>]
 Variable Oper: [EnemyATK] Set, Rnd[<depends on enemy>]
 Variable Oper: [EnemyDEF] Set, Rnd[<depends on enemy>]
 Variable Oper: [EnemyMAG] Set, Rnd[<depends on enemy>]
 Switch Operation: [Battle] ON
<b>I think I need more coding here but not sure</b>
:End

Please any help will be appreticed.
"Oh no, I knew this guy that bought a car out the newspaper. Ten years later...BAM, Herpes!" -Peter "Family guy"

**
Rep:
Level 83
Contestant - GIAW 9
WOW! This really goes over my head as an eventing abs, however, usually, when you rip something and you miss something it's because ,

A) you didn't notice something else somewhere else (like in the common events data base) that help make this work.

b)you declared a var wrong,

 I don't get why you set hero atk to so many vars. (but if the other guy did it, and it worked it must be right)It also may be how you are setting up your events too. check the other persons events by (moment type, collision vs  touch by hero, and the level (same, below, above,) and see if that makes a difference, sorry if this does not help much, but ripping something does require you understand it first before you can even know where you may went wrong.
Who said i was Wack?

**
Rep: +0/-0Level 83
So Seasame Street is on a roll
Yes, I understand vars and switches and I did do that the correct way, I just think they missed something and I can't get it to do every enemy, because of the event I believe
"Oh no, I knew this guy that bought a car out the newspaper. Ten years later...BAM, Herpes!" -Peter "Family guy"

**
Rep:
Level 83
Contestant - GIAW 9
check his events, is it different vars for each enemy?
Who said i was Wack?

**
Rep: +0/-0Level 83
So Seasame Street is on a roll
yeah... each enemys even should have different stats, but i got to get the first one working before i set the other ones.
"Oh no, I knew this guy that bought a car out the newspaper. Ten years later...BAM, Herpes!" -Peter "Family guy"

**
Rep:
Level 83
Contestant - GIAW 9
"Stats of the hero and I haven't gotten an idea on how to have it hit the hero"
Do you mean enemy dmg?

it set mine up in an else statement and then i have everything else on a con branch.

« Last Edit: July 15, 2009, 04:15:36 AM by Manaxaus »
Who said i was Wack?