help with serpentine script

Hello everyone,

I'm trying to add White Dragon's chain/serpent script (http://www.chronocrash.com/forum/index.php?topic=2513.0) and it's, currently, a bit out of my league scripting wise.  I'm curious if any other members would have a little familiarity with it.


First, let me explain a little of what I'm trying to implement with it.  I'm trying to create a snake boss that functions like the one in the original Nightmare on Elm Street for NES.
nightmare_on_elm_street_33.jpg


head.png


tail.png


snakef.png


So far all that I've done is put the script and assets into my Mod to test how they would act.  All that is produced is the Freddy head (no tail chain) that responds to a player key press.  From what I can make out chain.c is the script that dictates the the chain entity being tied to player buttons.

I guess my question is mainly where my starting point would be.  Which scripts would I have to create from the ground up (chain.c ?) and which scripts are just needing tweaking?  Apologies, I'm very green when it comes to scripting.
 
I'm making progress with my snake.  My current hang up, now, is trying to successfully call on each tail segment (child) to individually change their offsets.   
 
Good work my friend!!
For you work you can use:
create_chain__(self,9,18,0,0,0,0,-18,gep(self,"x"),gep(self,"z"),gep(self,"y"),9); // blockade radius x,z,y
or
create_chain__(self,9,18,0,0,0,0,-14,-1,-1,-1); // offsety
example:
Code:
onspawnscript @script
#include "data/scripts/defines.h"
#import "data/scripts/lib.c"
#import "data/chars/misc/chain/chain_structure.c"

void main() {
    void self = getlocalvar("self");

    cep(self,"noaicontrol",1);
    create_chain__(self,9,18,0,0,0,0,-14,-1,-1,-1); // offsety
}
@end_script

BTW you can set tails offset by owner methods:
float get_chain_offsetx__(void self) - input: self = an entity (chain part); output: shift x relative to parent
void set_chain_offsetx__(void self, float value) - input: self = an entity (chain part), value = new offset x for this entity
float get_chain_offsetz__(void self) - input: self = an entity (chain part); output: shift z relative to parent
void set_chain_offsetz__(void self, float value) - input: self = an entity (chain part), value = new offset z for this entity
float get_chain_offsety__(void self) - input: self = an entity (chain part); output: shift y relative to parent
void set_chain_offsety__(void self, float value) - input: self = an entity (chain part), value = new offset y for this entity
void set_chain_offset__(void self, float offsetx, float offsetz, float offsety) - input: self = an entity (chain part), new offsets (x,z,y) into a single method

all documentation is here:
[url]http://www.chronocrash.com/forum/index.php?topic=2513.0[/url]

Good Luck!!  ;)

 
Back
Top Bottom