Page 1 of 1

Problems cloning skeleton (Solution found)

Posted: Fri Sep 21, 2012 2:36 am
by Neikun
I'm using the cloneObject function to clone a skeleton. (trying to make a beefier, story related skeleton)
So I'm trying to clone it, and I'm testing my progress, but I'm getting an error and I don't know what.
It's telling me that there's an unexpected symbol '=" on line 23
Can anyone help me find what's wrong?
Code:

Code: Select all

cloneObject{
	name = "rufalas",
	baseObject ="skeleton_warrior",
	uiName = "Rufalas",
	class = "Monster",
	model = "assets/models/monsters/skeleton_warrior.fbx",
	meshName = "skeleton_warrior_mesh",
},
	animations = {
		idle = "assets/animations/monsters/skeleton_warrior/skeleton_warrior_idle.fbx",
		moveForward = "assets/animations/monsters/skeleton_warrior/skeleton_warrior_walk.fbx",
		turnLeft = "assets/animations/monsters/skeleton_warrior/skeleton_warrior_turn_left.fbx",
		turnRight = "assets/animations/monsters/skeleton_warrior/skeleton_warrior_turn_right.fbx",
		attack = "assets/animations/monsters/skeleton_warrior/skeleton_warrior_attack.fbx",
		attackBack = "assets/animations/monsters/skeleton_warrior/skeleton_warrior_attack_back.fbx",
		getHitFrontLeft = "assets/animations/monsters/skeleton_warrior/skeleton_warrior_get_hit_front_left.fbx",
		getHitFrontRight = "assets/animations/monsters/skeleton_warrior/skeleton_warrior_get_hit_front_right.fbx",
		getHitBack = "assets/animations/monsters/skeleton_warrior/skeleton_warrior_get_hit_back.fbx",
		getHitLeft = "assets/animations/monsters/skeleton_warrior/skeleton_warrior_get_hit_left.fbx",
		getHitRight = "assets/animations/monsters/skeleton_warrior/skeleton_warrior_get_hit_right.fbx",
		fall = "assets/animations/monsters/skeleton_warrior/skeleton_warrior_get_hit_front_left.fbx",
	},
	moveSound = "skeleton_walk",
	footstepSound = "skeleton_footstep",
	attackSound = "skeleton_attack",
	hitSound = "skeleton_hit",
	dieSound = "skeleton_die",
	hitEffect = "hit_dust",
	capsuleHeight = 0.7,
	capsuleRadius = 0.25,
	collisionRadius = 0.6,
	health = 120,
	sight = 4,
	attackPower = 9,
	accuracy = 10,
	protection = 5,
	immunities = { "poison" },
	movementCoolDown = 2,
	noRecoilInterval = { 0.25, 0.5 },
	exp = 90,
	lootDrop = { 100, "legionary_spear", 100, "legionary_shield" },
	healthIncrement = 15,
	attackPowerIncrement = 5,
	protectionIncrement = 1,
	brain = "Melee",
}

Re: Problems cloning skeleton

Posted: Fri Sep 21, 2012 2:37 am
by Neikun
Hey wait.. since I'm cloning it, maybe I can fix it by deleting all lines I don't plan on editing?
brb testing.

EDIT: Solution found.
There was a close bracket at the end of the animations and no new opening bracket for the rest of the definitions.
To fix this, I deleted all the animation text, including the close bracket(since I won't be touching it)
Now the script reads as one list of definition.

Re: Problems cloning skeleton

Posted: Fri Sep 21, 2012 5:04 am
by Billick
Neikun wrote:Hey wait.. since I'm cloning it, maybe I can fix it by deleting all lines I don't plan on editing?
brb testing.

EDIT: Solution found.
There was a close bracket at the end of the animations and no new opening bracket for the rest of the definitions.
To fix this, I deleted all the animation text, including the close bracket(since I won't be touching it)
Now the script reads as one list of definition.
You can omit any lines that you aren't changing from the original monster. Putting them in shouldn't hurt anything, it just makes your code longer.

Re: Problems cloning skeleton (Solution found)

Posted: Fri Sep 21, 2012 6:53 am
by petri
It's recommended that you set only those fields that are different from the base object and copy nothing else. This way if the base object changes your mod is more likely to work and it's lot cleaner also.