Speaking of game mechanics

kimono

Well-known member
Hi Openbor makers,

I found an interesting game mechanic in an old 1986 arcade game named "Legend":
The original concept is that you can convert an enemy to an ally giving him money :D
The main hero can crouch or jump, use items (bombs, knives, spears, cross and gold), command npc allies to attack.

Do you think it's possible to create a spell in Openbor that can convert an enemy to a NPC ally? :-\
 
Last edited:
kimono said:
Hi Openbor makers,

I found an interesting game mechanic in an old 1986 arcade game named "Legend":
The original concept is that you can convert an enemy to an ally giving him money  :D
The main hero can crouch or jump, use items (bombs, knives, spears, cross and gold), command npc allies to attack.

Do you think it's possible to create a spell in Openbor that can convert an enemy to a NPC ally?  :-\

I think yes, you can change "hostile" and "candamage" properties in the "didhit" script of this spell
 
Kratus said:
I think yes, you can change "hostile" and "candamage" properties in the "didhit" script of this spell

I noticed "hostile" exists in the entity properties. But what is it for, anyway? I don't see any info about it.

On topic, you can check with Castlevania Collaboration which Bloodbane and some others made for picking weapons. As for making an enemy to an ally, O Avengers (double pun for O Ilusionista's Avengers mod, and "The Avengers" in Portuguese LOL) has Emma Frost doing that/those. You're gonna need something to make that happen.
 
Thank you all for your speeches, it seems indeed that O Ilusionista uses already these type of conversion (enemy to npc ally) into a Emma Frost move called mind control.
It's limited to one enemy at a time and maybye the boss are immune to the mind control?

One other interesting game mechanic can be found on Shadow Force arcade, it's a possession ability where you can play with any basic enemy (see at 2:51):
It could be a little more complicated to allow this in a openbor game :)
 
Last edited:
cNice idea, it would be easiest to do like Andrew said, just spawn the same entity but with type npc instead of enemy, sack of $ could be with attack6 and death6 in enemy would spawn npc then remove enemy.
But you could also do it by changing type of enemy to type npc with single line before animation frame.
Code:
@cmd     changeentityproperty getlocalvar("self") "type" openborconstant("TYPE_NPC")
Code:
@cmd     changeentityproperty getlocalvar("self") "candamage" openborconstant("TYPE_ENEMY")  openborconstant("TYPE_OBSTACLE")
Code:
@cmd     changeentityproperty getlocalvar("self") "hostile" openborconstant("TYPE_ENEMY")
change type to npc, make him damage enemies , obstacles and be hostile towards enemy.
But i see that the enemies converted to npc have kinda shit skills and die easily, not a good spent money.
This game would be better if you could get money back if your npc would die, or you could be abgle to pickup spear again after being thrown, have 5 slots for itmes and decide which one to keep and throw away.

That other vid with possession, its kinda cool idea on paper but in practice enemies have weaker attacks than player and much less of them.I converted enemies to playables in some of my mods and that wasnt that fun, maybe for awhile.But it could be done by detecting your enemy name and changing to player weapon model thats using sprites of this enemy but with different remap.
Very possible and not that hard to do.player weapon model could be copy of txt file of enemy with some small changes in header to let him be used as weapon model for player
 
It's limited to one enemy at a time and maybye the boss are immune to the mind control?
Yes, I use that type of script on my game. I use a spepecific type of attack (ATTACK8) which triggers PAIN8 animation, where I trigger a function to change all of this:
- candamage
- type
- hostile
- subject to screen

The whole code is this (contains codes that are related to my project):
Code:
void mindControl (int mControl){
//Douglas Baldan / O Ilusionista - 2018.08.21
	void self = getlocalvar("self");
	int MindControl = getglobalvar("MindControl2");
	
	if (mControl==1){//start mind control
		if (getglobalvar("MindControl2")==NULL()) {
		changeentityproperty(self, "hostile", "TYPE_ENEMY");
		changeentityproperty(self, "type", openborconstant("TYPE_NPC"));
		changeentityproperty(self, "candamage", "TYPE_ENEMY");
		setglobalvar("MindControl2", 1);
		spawner("dizzyfx", 0, 55, 1);
		changeentityproperty(self,"subject_to_screen",1);
		}
	}
	
	if (mControl==0){// finish mind control
		changeentityproperty(self, "hostile", "TYPE_PLAYER");
		changeentityproperty(self, "type", openborconstant("TYPE_ENEMY"));
		changeentityproperty(self, "candamage", "TYPE_PLAYER");
		setglobalvar("MindControl2", NULL());
		void vSpawn;
		vSpawn = spawn01("eaph", 0, 55, 1);
		changeentityproperty(self,"subject_to_screen",0);
	}	
}

I use a custom pain instead of didhit because I can control other things easily, like drawmethod, effects, etc.
Plus, I don't need to add a name check for every enemy on the game - it they have PAIN8, they will trigger it. Robots doesn't have it and this is why you can't mind control them.

It's limited to one character at time to avoid cheapness (this is why I use a global variable, to control it). And bosses are imune because changing them to NPC will end the stage immediately - since either there is no more enemies or the boss having BOSS 1 will trigger this.

Just be warned that this could be a little more complex in some cases - for example, projectiles. Since what they can hit are tied on their headers (and not on the function which calls them), an enemy-now-npc which uses a projectile will still hit you.

On my game, to bypass this, I do the following:
- Detect the entity type on the animation where it will use a projectile. If its NPC, force it to change to another animation
- on the new animation, I use a function that I have where I can spawn projectiles and change what they hit, on the fly.

This is the function I am talking about
Code:
void shooterCD(void Shot, void Can, float dx, float dy, float dz, float Vx, float Vy, float Vz, int Dir)

{ // Shooting projectile with speed control and CanDamage control
// Douglas Baldan - Based on Bloodbane's codes
   void self = getlocalvar("self");
   int Dire;
   int Direction = getentityproperty(self, "direction");
   int x = getentityproperty(self, "x");
   int y = getentityproperty(self, "a");
   int z = getentityproperty(self, "z");
   void vShot;

   if (Direction == 0){ //Is entity facing left?                  
     dx = -dx; //Reverse X direction to match facing
     if (Dir == 1){
       Dire = 0;
     } else if (Dir == -1){
       Dire = 1;
     }
   } else if (Direction == 1){ //Is entity facing right?                  
     if (Dir == 1){
       Dire = 1;
     } else if (Dir == -1){
       Dire = 0;
     }
   }

   vShot = projectile(Shot, x+dx, z+dz, y+dy, Dire, 0, 0, 0);
   changeentityproperty(vShot, "velocity", Vx, Vz, Vy);
   changeentityproperty(vShot, "speed", Vx);
   changeentityproperty(vShot, "candamage", Can); 
}

There are few other things to cover  - there was a bug I can't remember very well but consists in some enemies not dying after the boss is dead. This is why when you kill a boss on my game, under the Boss mode, the enemies will just explod.

maxman  "I noticed "hostile" exists in the entity properties. But what is it for, anyway? I don't see any info about it." For the same thing HOSTILE works in character header - to define to which type of entity you will be hostile too.

For example, if set HOSTILE ENEMY, the character will only be hostile to nemies, and not to obstacles (but you can still hit them if you set the CANDAMAGE) but...when you run a "findtarget" function, it won't never "see" an obstacle as a valid target.

uTunnels shared an old trick long time ago: this is why you can make moves which grabs (like when Zangief runs and grab) to not target obstacles.
 
kimono said:
One other interesting game mechanic can be found on Shadow Force arcade, it's a possession ability where you can play with any basic enemy (see at 2:51):

It could be a little more complicated to allow this in a openbor game :)

I know that game, I've seen that in arcade machine years ago

Back to topic, the simplest way I had in mind is to simply create generic weapon models, one for each possessible enemy. When players possesses an enemy, kill the enemy and then change weapon model to respective enemy.
The not simple part is limiting this ability to prevent cheap killing
 
Another cool game mechanic present in Fading Afternoon is to pick up an enemy's weapon after throwing it :) . The idea is really very good (and the Friends of Ringo Ishikawa series is worth seeing too) :
 
Fallout is an excellent game again that reminds me of a particular mechanic: the moral choice.

Should we for example try to save a sick person (zombified) and make them an ally or eliminate the threat? Same thing for a wild animal that we could either avoid, tame to make them an ally or massacre.
I think it would be easy to make enemies, neutral entities or allies in a beat em up like this.
P.S: Dogmeat is a good boy.
 
Fallout is an excellent game again that reminds me of a particular mechanic: the moral choice.

Should we for example try to save a sick person (zombified) and make them an ally or eliminate the threat? Same thing for a wild animal that we could either avoid, tame to make them an ally or massacre.
I think it would be easy to make enemies, neutral entities or allies in a beat em up like this.
P.S: Dogmeat is a good boy.

Easier than you think @kimono. 4.0 has something I'm rather proud of - Factions.


DC
 
Back
Top Bottom