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: 139
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.



Author Topic: Binding an Entity to Overlay / Mimmick the Caller (make two ents work as one?)  (Read 281 times)

0 Members and 1 Guest are viewing this topic.

Offline BeasTie

  • Hero Member
  • *****
  • Posts: 760
Basically what I want to do is have a second entity bound to the player that is just the player's weapon, mainly so it can have independent alpha settings etc. from the player.  Frames/anims and offsests will be just like the original players, but pointing to alternate sprites. 

The second ent needs to always play the same anim in the same frame as the player(or main entity).

I've been messing with this for ages but I never get it right.  Originally a few years ago I was working off a thread that showed how to do this, but that has long since been lost from the forums. 

I remember it was fairly simple script thou (just inserted into char anims).  It just required a lot of new ents, which was a concern at the time with engine limitations.

I've tried setting up alpha masking instead, but it's hard to get them right.  So if there was a way to do this properly it would save some trouble, and allow use of new drawmethod features too, instead of plain alpha mask.

Nothing urgent I'm trying to do, just something I've been messing with and wondering about for a while, so thought would post.

-----------------------------------------------------
I'm also interested in trying to use this in the long run to have entities that are put together like this in separate parts.  For example the head could be a different entity with it's own bbox's (allowing headshots).  Or all limbs seperated into different ents, allowing seperate limb damage/loss (chop your enemies arm off he keeps fighting!).

On a larger more advanced scale I think mods of the future will start doing this kinda stuff, now that there's few limitations.  Could even be used for things like a 'Char Creator' or 'Alternate Costumes' for players.  Things of this nature.

(Example image, taken from an old wrestling game)
Separate head, torso and legs

Offline Bloodbane

  • Hero Member
  • *****
  • Posts: 7113
  • Dark Dragon
 There's a parameter of bindentity function which allows matching animation with other entity so this is doable.
 I don't have anything to try this though ATM

Quote
I'm also interested in trying to use this in the long run to have entities that are put together like this in separate parts.  For example the head could be a different entity with it's own bbox's (allowing headshots).  Or all limbs seperated into different ents, allowing seperate limb damage/loss (chop your enemies arm off he keeps fighting!).

On a larger more advanced scale I think mods of the future will start doing this kinda stuff, now that there's few limitations.  Could even be used for things like a 'Char Creator' or 'Alternate Costumes' for players.  Things of this nature.

 Having the latter is easier than having the former IF the costumes and other accessories don't have effect to main entity or IOW just accessory.

 Though I have made a boss whose AI is depended on her arms. If one of her arms is decapitated, she can't use that one and only rely on the other. If both are done for, she goes mad!

 You know, this reminds me to Cocoron.
OpenBoR Manual

Basic OpenBoR Tutorials

OpenBoR Tricks & Tutorials

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

Offline Damon Caskey

  • Hero Member
  • *****
  • Posts: 5335
    • The Gorge
It's already being done. Watch this video; notice the transparent weapon trails. It is actually a second entity bound to play the same animation and frame; exactly as you describe. Pretty simple to do. A little tedious, but not complex as far as the script goes.

http://youtu.be/JossdCHwwIw

DC

 
« Last Edit: December 03, 2012, 09:55:40 am by Damon Caskey »
OpenBOR Wiki.

Coming Soon:
Spoiler
Fatal Fury Chronicals


Offline BeasTie

  • Hero Member
  • *****
  • Posts: 760
Yeah I thought it had been done in mods, I'm just not quite sure about the script I had. (nice vid btw, looking good)

I had some example script, but when I first worked on this it was so long ago and I was just following a guide.
This is what was in my char, it binds but it's not working as intended, I think I'm missing part of the script or process.

Code: [Select]
@script
if(frame==0)
{
    void self = getlocalvar("self");
    void e;
    clearspawnentry();
    setspawnentry("name", "weapon_idle");
    e = spawn();
    bindentity(e, self, 0,0,0,1);
}
@end_script

Just thought would just ask what the best way to do this is before I make more mess in the mod trying to script it, or if there was some existing script to refer too.  :blushing:

Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
bindentity(e, self, 0,0,0,1,7);

This should work. Don't forget to make animations for the entity, they must be identical in frames to your main entity.

Offline BeasTie

  • Hero Member
  • *****
  • Posts: 760
Cheers I'll try again.  The old method I had required an entity for each animation that needed it.  Are you saying just to have one ent?

EDIT : That seemed to work, my bad should of just looked up the bindentity command, thought I'd just ask you guys thou in case there was something more to it than this method.
« Last Edit: December 03, 2012, 10:06:46 pm by BeasTie »

 



 0%




SimplePortal 2.3.3 © 2008-2010, SimplePortal