Error when trying to SpawnZed using Pixie's Zombie Apocalypse programs
Laraqua
23 Mar 2018, 04:00Error running script: Too many parameters passed to SpawnZed function - 1 passed, but only 0 expected
Also for some reason when I first start the game the word Do Attack appears whenever I have any SpawnZeds in any of the rooms.
It's written in After Entering The Room For The First Time as the function: SpawnZed (this)
The actual SpawnZed function is as follows:
game.crittercount = game.crittercount + 1
}
else {
game.crittercount = 1
}
create ("critter" + game.crittercount)
obj = GetObject("critter" + game.crittercount)
obj.parent = room
obj.displayverbs = Split("Look at;Attack;Shoot", ";")
obj.dead = false
obj.changedhitpoints => {
if (this.hitpoints < 1) {
msg ("It is dead!")
this.dead = true
}
}
names = Split("twitchy;feral;wild-eyed;screechng;filthy;hungry", ";")
obj.alias = StringListItem(names, game.crittercount % ListCount(names)) + " zombie"
obj.listalias = CapFirst(obj.alias)
obj.look = ProcessText("A " + obj.alias + ", {random:covered in maggots:missing an arm:one eye hanging out}.")
obj.hitpoints = 10
obj.damage = 3
obj.attack = 0
obj.defence = 0
obj.armour = 0
obj.critdesc = "A well-placed blow by #attacker# sends you reeling (#hits# hits)."
obj.attackdesc = "#Attacker# has hit you (#hits# hits)."
obj.missdesc = "#Attacker# misses you."
obj.selectweapon => {
if (RandomChance(50)) {
obj.weaponcount = GetRandomInt(0, 100)
obj.selectweapon => {
names = Split("zedweapons;zedweapons;zedweapons", ";")
name = StringListItem(names, this.weaponcount % ListCount(names))
this.weapon = GetObject(name)
this.weaponcount = this.weaponcount + 1
}
}
}
obj.searchscript => {
money = GetRandomInt(1, 50)
msg ("You find " + DisplayMoney(money) + ".")
player.money = player.money + money
if (randomChance(10)) {
o = PickOneChild(treasureroom)
msg ("You also find " + GetDisplayName(o) + ".")
CloneObjectAndMoveHere (o)
}
}
obj.changedhitpoints => {
if (this.hitpoints < 1) {
msg ("It is dead!")
this.dead = true
this.displayverbs = Split("Look at;Loot;Harvest", ";")
}
}
if (not ListContains(ScopeReachable(), player)) {
msg ("random:crying;stumbles;falls down.")
}
else if (ListContains(ScopeReachable(), player)) {
msg ("DoAttack")
}

K.V.
23 Mar 2018, 06:11You need to add the parameter room
to that function.