Jump to content

How to spawn "named" entities, and the special pets


Recommended Posts

local vargling = c_spawn("critter_puppy"); vargling.components.crittertraits.dominanttrait = "combat"; vargling.components.crittertraits.dominanttraitlocked = true

I haven't tested it, personally, but my research suggests this should work.

in console:

c_spawn("pigman").components.named:SetName("anyname")

If you mean any entity then:

namedent = c_spawn("spider"); namedent:AddComponent("named"); namedent.components.named:SetName("Cool Spider");

 

6 hours ago, TemporaryMan said:

local vargling = c_spawn("critter_puppy"); vargling.components.crittertraits.dominanttrait = "combat"; vargling.components.crittertraits.dominanttraitlocked = true

I haven't tested it, personally, but my research suggests this should work.

This works, but this makes the pet just sit there since it has no owner, so add 1 more line

specialpet = c_spawn("critter_puppy"); specialpet.components.crittertraits.dominanttrait = "combat"; specialpet.components.crittertraits.dominanttraitlocked = true; ThePlayer.components.leader:AddFollower(specialpet)

 

you can combine parts to get a named pet, just make sure you separate each part with a semicolon.

 

Edit: I was messing around and made a command that spawns an unowned pet, which becomes owned by the player that goes close to it:

specialpet = c_spawn("critter_puppy"); specialpet.findownertask = specialpet:DoPeriodicTask(1, function() local nearby = FindEntity(specialpet, 6, nil, {"player"}, {"ghost"}, nil) if nearby and neraby.components.leader then nearby.components.leader:AddFollower(specialpet) specialpet.findownertask:Cancel() specialpet.findownertask = nil end end);

 

TheWorld:ListenForEvent("ms_playerjoined", function(world, player) player:ListenForEvent("equip", function(inst, data) if data.eslot == "hands" and data.item.components.lighter then data.item.components.lighter.onlight = function(lighter, target) if target:HasTag("structure") then TheNet:SystemMessage("[" .. inst.userid .. "]-" .. inst.name .. " started a fire on " .. "[" .. target.GUID .. "]-" .. target.prefab) end end end end) end)

This should work, Kinda took me a while to figure out a way to go about it, but this method requires you to run it before any players join. It checks for when they equip an item that has the lighter component, and uses the lighter component's ONLIGHT function to announce it in the chat.

 

However, it can easily be bypassed by igniting something near the structure, such as trees, which would eventually lead to the structures burning

 

It would be easier to put in a small server side mod so you don't have to do it each time a world is loaded

On 12/8/2016 at 0:53 PM, Aquaterion said:

This works, but this makes the pet just sit there since it has no owner, so add 1 more line


specialpet = c_spawn("critter_puppy"); specialpet.components.crittertraits.dominanttrait = "combat"; specialpet.components.crittertraits.dominanttraitlocked = true; ThePlayer.components.leader:AddFollower(specialpet)

 

What are the other trait names for the console? I was just wandering if the console trait changes for the consoles as in the case of scrappy/combat or if the other remain the same (playful, crafty, well-fed)

6 minutes ago, FreyaMaluk said:

What are the other trait names for the console? I was just wandering is scrappy changes as well (combat) or if the other remain the same (playful, crafty, well-fed)

well-fed is "wellfed" I think, as for the others i don't really know. just try them out I guess

On 12/8/2016 at 0:53 PM, Aquaterion said:

 

34 minutes ago, DarkXero said:

COMBAT, WELLFED, PLAYFUL, CRAFTY.

 

This works, but this makes the pet just sit there since it has no owner, so add 1 more line


specialpet = c_spawn("critter_puppy"); specialpet.components.crittertraits.dominanttrait = "combat"; specialpet.components.crittertraits.dominanttraitlocked = true; ThePlayer.components.leader:AddFollower(specialpet)

 

 

 

This didn't work for me.... I do get the pet to follow me, but the trait is not there (no adjective added to the name's pet) and if I relog the pet stops following me, but it now has the "scrappy" adjective.... weird o.O

1 minute ago, FreyaMaluk said:

This didn't work for me.... I do get the pet to follow me, but the trait is not there (no adjective added to the name's pet) and if I relog the pet stops following me

According to wiki not all traits give your pet a title? I think..

15 minutes ago, MrDeepDarkmind said:

I think the only trait is just scrappy 

(iPad is bad at autocorrecting) edit

http://images.akamai.steamusercontent.com/ugc/112984788731790183/475C7354C67CCC51379F1F03D8E29390848596BF/

1 hour ago, FreyaMaluk said:

Spanish huh

1 hour ago, GiddyGuy said:

There is peppy, plump, crafty and scrappy. I wish the four forms changed their looks, would be nice to have an actual plump kittykit. c:

Plump kitty kit sounds pretty nice ( ͡° ͜ʖ ͡°)

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...