The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
For-loop - not declared [SOLVED]
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#1
For-loop - not declared [SOLVED]

Hey guys.

Take a look at this:

PHP Code: (Select All)
void CheckBattle()
{
    
//ENEMY//
    
    
for(int EnemyHealthCounter=EnemyMonsterHealth;EnemyHealthCounter<11;EnemyHealthCounter++)SetLampLit("EnemyHealth_"+EnemyHealthCounterfalse);
    
    
    
    
//FRIENDLY//
    
for(int FriendlyHealthCounter=FriendlyMonsterHealth;FriendlyHealthCounter<11;FriendlyHealthCounter++)SetLampLit("FriendlyHealth_"+FriendlyHealthCounterfalse);
    for(
int i=1;i<5;i++)SetEntityActive("Move_"+ifalse);
    
    
    
//MOVES//
    
for(int MoveCounter=1;MoveCounter<MoveAmount+1;MoveCounter++)SetEntityActive("Move_"+MoveCountertrue);
    
CreateParticleSystemAtEntity("MoveParticle_"+MoveCounter"ps_orb_absorb.ps""Move_"+MoveCounterfalse);
    
    
    if(
EnemyMonsterHealth <= 0)
    {
        
BattleEnd();
    }
    


I hope this lines up correctly.


It says EnemyMonsterHealth is not declared.

When I am clearly declaring it here:

PHP Code: (Select All)
void BattlePreparation()
{
    
SetLocalVarInt("InBattle"1);
    
    
//ENEMY MONSTER//
    
int EnemyMonsterHealth 10;
    
    
int MonsterNumber RandInt(1,2);
    
SetEntityActive("MonsterBox_"+MonsterNumbertrue);
    
    
    
CheckBattle();


What I'm trying to do is make a for loop check how much health the monster has by grabbing the actual health as the lowest and the max health (+1) as the highest.

Am I doing something wrong?

Trying is the first step to success.
(This post was last modified: 08-22-2014, 07:39 PM by FlawlessHappiness.)
08-22-2014, 06:23 PM
Find


Messages In This Thread
For-loop - not declared [SOLVED] - by FlawlessHappiness - 08-22-2014, 06:23 PM
RE: For-loop - not declared - by Neelke - 08-22-2014, 06:41 PM
RE: For-loop - not declared - by Wapez - 08-22-2014, 06:45 PM



Users browsing this thread: 1 Guest(s)