Post tutorial Report RSS Creating Shapeshifting disciplines

This is a tutorial and sample script on how to create a shapeshift discipline.

Posted by on - Intermediate Client Side Coding

Tutorial originally posted to e-mods's forum. Mirrored here for archival purposes as it's now down.


Ok , as the title says : Does anybody knows how to create a shipshafting discipline? The only way for me to do it is play around with the Shape of The beast script, but its not that good... There is not a shapeshifting discipline in the game, except mist form and the Shape of The beast, which arent the brightest example to follow, mist form isnt exactly shapeshifting discipline and the Shape of The beast is somehow linked with that .ncd file and I cant change the crearure to be shapeshifted into, without editing that .ncd and this is not I want . So I dont know what the structure of the script will look like for those reasons I wrote αbove. Any help for creating a shapeshifting discipline would be appreciated. Thanks.


Simple; Make a script like this for your discipline -

public class DisciplineShapeShift extends Discipline {
	
	private static final String	DISCIPLINE_NAME	= "ShapeShift";
	
	public int cast(int level, int casterGuid)
	{
		// do sanity checks
		if(!CheckCastParameters(level, casterGuid, DISCIPLINE_NAME))
			return(0);

		SetupWorld(DISCIPLINE_NAME);

		try
		{
			casterThing.AddActorEffectByLevel("ef_shapeshift", 0, 0, 0, 0);

			return(1);

		}
		catch(Exception e)
		{
			CodexConsole.PrintException(e.getMessage() + " in " + DISCIPLINE_NAME + " [cast]");
			return(0);
		}
		catch(Error e)
		{
			CodexConsole.PrintError(e.getMessage() + " in " + DISCIPLINE_NAME + " [cast]");
			return(0);
		}
	}

}

Add the following line to the effects.ned file -

ef_shapeshift                   shapeOfTheBeastIcon     0       EffectShapeshift                0       0       0       0x200   0       0       0       0       1       1       2       2       3 

Create an EffectShapeshift script with the following code -

public class EffectShapeshift extends Discipline {

	
	public void effectstarted(int actorGuid, int effectGuid, int creatorGuid, int duration)
	{
		CodexActor actor = new CodexActor(actorGuid);
		
		actor.ActorShapeShift("wolf", 0);
	}
	
	
	public void effectended(int actorGuid, int effectGuid, int creatorGuid, int reason)
	{
		CodexActor actor = new CodexActor(actorGuid);
		
		actor.ActorEndShapeShift();

	}

}

That's all there is to ActorShapeShift command. If you want to shapeshift into a different template then input that template instead of "wolf".

Post comment Comments
JurgenKrace
JurgenKrace - - 15 comments

Wow... Is it possible, to create a new descipline branch and add it into Single Player for enemy characters? I had a dream to do Vicissitude discipline, and have Christof to make a diabilirie :-)

Reply Good karma Bad karma+1 vote
LithTechGuru Author
LithTechGuru - - 408 comments

Yes. There's a few mods that did this like E-Mod.

Reply Good karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: