Welcome, Guest. Please login or register.

What openbor you prefer: Double dragon,battletoads or final fight !? by lirexpatrio
[December 07, 2012, 07:15:27 pm]


what are your favorite games OpenBOR?! by lirexpatrio
[December 07, 2012, 07:09:46 pm]


Post Some Awesome Videos by maxman
[December 07, 2012, 05:51:39 pm]


Can @cmd playmusic "aaaa" 1 also increse music sound ? by BeasTie
[December 07, 2012, 05:24:38 pm]


Streets of Rage: Silent Storm by mtrain
[December 07, 2012, 03:45:05 pm]


Site will be down for maintenance on 12/8/2012 thru 12/10/2012 by Damon Caskey
[December 07, 2012, 07:42:42 am]


Cancelled SOR 3d Remake by riccochet
[December 07, 2012, 03:58:33 am]


Dungeon Fighter: B.O.R. by msmalik681
[December 07, 2012, 03:24:27 am]


[TUTORIAL] How to create 4 Games of OpenBOR in 1 CD (650 MB) by magggas
[December 06, 2012, 09:46:25 pm]


custknife by Bloodbane
[December 06, 2012, 09:34:09 pm]


blockfx help by B.Kardi
[December 06, 2012, 04:09:14 pm]


street of age 4 hd by corradlo
[December 06, 2012, 01:41:36 pm]


ClaFan - Classic Fantasy ver 1.17 by soniczxblade
[December 06, 2012, 05:01:20 am]


Bug Archive by Bloodbane
[December 06, 2012, 02:00:44 am]


"Bio-Doom" and "Gears of Doom" by BulletBob
[December 05, 2012, 10:07:21 pm]


Contra Locked 'N' Loaded v2 by Bloodbane
[December 05, 2012, 09:39:43 pm]


Downloadable OpenBoR Manual by BeasTie
[December 05, 2012, 08:31:24 pm]


Having trouble testing changes by B.Kardi
[December 05, 2012, 03:05:53 pm]


DragonBall Absalon by msmalik681
[December 05, 2012, 02:52:13 pm]


[Hi-Res] Swamp by Vibrant
[December 05, 2012, 10:47:14 am]


  • Dot Guests: 149
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.



Author Topic: Battleheart for iOS/ Android system  (Read 624 times)

0 Members and 1 Guest are viewing this topic.

Offline fluxcapacitor0

  • Jr. Member
  • **
  • Posts: 5
Battleheart for iOS/ Android system
« on: February 23, 2012, 05:24:58 pm »
Im trying to recreate a simplified version of this game for openbor.

Is there a way I can use script to select the target of an npc?  And use a button to switch targetting between two enemies.  It seems selecting target is only based on closest enemy. 

Ive read the stuff about the findtarget function but its not exactly what im looking for.  I have 2 enemies stored at the beginning of a level and want to switch the targetting of my team between the two on the fly.

Offline Bloodbane

  • Hero Member
  • *****
  • Posts: 7113
  • Dark Dragon
Re: Battleheart for iOS/ Android system
« Reply #1 on: February 24, 2012, 10:32:39 pm »
Quote
It seems selecting target is only based on closest enemy. 

 It is and that's how findtarget works.

 Alternatively, you could run a script which finds every active entities, check which ones are enemies then do the pick target function.

Quote
want to switch the targetting of my team between the two on the fly.

 I don't know if it's possible to change NPC's current enemy but if your NPC or team's AI is script based, it's not hard thing.

 I recall that it's possible to change current opponent with script but I don't know if it can be used to change NPC's current enemy.
OpenBoR Manual

Basic OpenBoR Tutorials

OpenBoR Tricks & Tutorials

"The more often enemies attack, the more open they are to counter attacks"

Offline fluxcapacitor0

  • Jr. Member
  • **
  • Posts: 5
Re: Battleheart for iOS/ Android system
« Reply #2 on: February 29, 2012, 12:26:01 pm »
Thanks for the reply.

Im trying to find more info on a picktarget function but cant find any.  This is essentially what I need, the ability to change the characters target on the fly, with preloaded entity names, but not necessarily being the closest one.

Are there any links i can read for the picktarget function? Code examples?

Offline Bloodbane

  • Hero Member
  • *****
  • Posts: 7113
  • Dark Dragon
Re: Battleheart for iOS/ Android system
« Reply #3 on: March 01, 2012, 10:35:54 pm »
Quote
do the pick target function

Actually, I mean you have to make function yourself. AFAIK there's no such function already available.

 Anyways, here's a smartbomb function by Damon Caskey which can be altered for your need:

Code: [Select]
void sbom0001(int iDamage, int iKnockdown, void vType){   
   
    /*
    sbom0001
    Damon Vaughn Caskey
    07152008

    Simulate smart bomb effect.
   
    iDamage:    Damage given to targets.
    iKnockdown: Knockdown power. 0 = No Knockdown.
    vType:      Damage type.
    */

    void vSelf     = getlocalvar("self");             //Caller.
    void vEntity;                                     //Target entity placeholder.
    int  iEntity;                                     //Entity enumeration placeholder.
    int  iType;                                       //Entity type.
    int  iMax      = openborvariant("ent_max");       //Entity count.

     //Enumerate and loop through entity collection.
    for(iEntity=0; iEntity<iMax; iEntity++){
   
        vEntity = getentity(iEntity);                   //Get target entity from current loop.
        iType   = getentityproperty(vEntity, "type");   //Get target type.

        //Player type?
        if (iType == openborconstant("TYPE_PLAYER")){

            damageentity(vEntity, vSelf, iDamage, iKnockdown, openborconstant(vType));  //Apply damage.

        }
    }
}

 This function checks every active entity to find which one is player type. Every player type found will be damaged by damageentity function.
OpenBoR Manual

Basic OpenBoR Tutorials

OpenBoR Tricks & Tutorials

"The more often enemies attack, the more open they are to counter attacks"

Offline fluxcapacitor0

  • Jr. Member
  • **
  • Posts: 5
Re: Battleheart for iOS/ Android system
« Reply #4 on: March 05, 2012, 12:16:20 pm »
From what I can tell I dont think its possible.

Ive read through the smartbomb function but that doesnt change the target, rather it does damage to a target. 

I need a system where an NPC will follow one target and attack, etc then as soon as a button is pressed, ignore current target and go after next arbitrary target, possibly in between two other enemy types.

Essentially i have 6 stored entities as enemies and I need a picktarget function to cycle between them, whether or not enemy has died. 

Offline erf_beto

  • Jr. Member
  • **
  • Posts: 89
Re: Battleheart for iOS/ Android system
« Reply #5 on: March 05, 2012, 01:31:29 pm »
Battleheart?  :wow!:
I love that game!
I'm not sure how does that translate to OpenBOR, but I'm excited already!
Good Luck with this!  :cheers!:

 



 0%




SimplePortal 2.3.3 © 2008-2010, SimplePortal