Author |
Message |
RandomCoderZ
Joined: Fri Sep 13, 2013 1:39 am Posts: 157 Location: ᴱᵛᵉʳʸʷʰᵉʳᵉ
|
Summon AHuman on your team?
Okay i've been trying to make a summon spell for my adjoint mage mod, and I know that I will need Lua for this. I've been fiddling with the Nanoswarm canister and been trying to summon a AHuman.... And i succeeded.. but i got like +20 more of what i wanted and it ended up becoming a gore bomb instead (Spawned Fat Culled Clones). So what i kinda need help with is a small script attached to a MOPixel or a MOSRotating shot to summon a Actor. Was thinking a weapon that shoots a invisible pixel that upon reaching 200ms will summon whatever applied to do so, and i want it preferably to be on my team so its controllable. What i thought next was that it has some kind of portal opening (When summoning elementals). and when it come to necromancy i can make a animation that looks like a skeleton or zombie rises from the ground, and after the effect the zombie/Skeleton spawns. Bad Sketch.. : You might want to zoom on it... (Sorry for this) Is this doable? If so... I really need help. Got no idea how to code anything in Lua..
|
Sat Jan 24, 2015 3:00 pm |
|
|
Bad Boy
Joined: Fri Sep 10, 2010 1:48 am Posts: 666 Location: Halifax, Canada
|
Re: Summon AHuman on your team?
Easy to do, add a script and attach it to the bullet. Put in the script Code: function Destroy(self) local actor = CreateAHuman("actor name", "actor RTE.rte"); actor.Pos = self.Pos; actor.Team = self.IgnoresTeamHits; MovableMan:AddActor(actor) end This may not work off the bat as it's a really simple and lazy implementation, but I'm too tired at the moment to test it or do better. It should be close to what you want. If you want this to trigger after 200 MS, just make the bullet have a lifetime of 200. Keep in mind that right now this'll also happen if it hits any target, I don't know if you want that or not.
|
Sun Jan 25, 2015 5:32 am |
|
|
RandomCoderZ
Joined: Fri Sep 13, 2013 1:39 am Posts: 157 Location: ᴱᵛᵉʳʸʷʰᵉʳᵉ
|
Re: Summon AHuman on your team?
Bad Boy wrote: Easy to do, add a script and attach it to the bullet. Put in the script Code: function Destroy(self) local actor = CreateAHuman("actor name", "actor RTE.rte"); actor.Pos = self.Pos; actor.Team = self.IgnoresTeamHits; MovableMan:AddActor(actor) end This may not work off the bat It doesn't. Probably needs more code for it to work. Thanks for making a start atleast!
|
Sun Jan 25, 2015 7:35 am |
|
|
clunatic
Joined: Fri Nov 23, 2012 5:42 am Posts: 143
|
Re: Summon AHuman on your team?
change: actor.Team = self.IgnoresTeamHits to: actor.Team = self.IgnoresWhichTeam. Then it should work.
Also, if anything lua related isn't working, it's useful to check the console (by pressing ~) and reporting any error messages you see.
|
Sun Jan 25, 2015 7:11 pm |
|
|
RandomCoderZ
Joined: Fri Sep 13, 2013 1:39 am Posts: 157 Location: ᴱᵛᵉʳʸʷʰᵉʳᵉ
|
Re: Summon AHuman on your team?
Thanks that worked wonders, I even managed to make a super small gibbing script to the summoned zombie. They last 40 seconds before exploding into a bloody pulp. When summoned it seems like they get to AI mode directly which is pretty cool.
I made a close range claw weapon for them to use, but they stop a bit away and tries to "Shoot" the enemy. Which always end up being killed themselves. So my question is that how to make them go close enough for them to hit the enemies? They are controlled by the Base.rte human AI if that helps.
If this is difficult I'll just have to make a real sucky gun for them to hold.
|
Mon Jan 26, 2015 11:44 am |
|
|
Bad Boy
Joined: Fri Sep 10, 2010 1:48 am Posts: 666 Location: Halifax, Canada
|
Re: Summon AHuman on your team?
Whoops, forgot the variable name haha.
Making them move to a target is tough, but here are a few solutions: 1. Set their idle path to walking. Contact uberhen if that doesn't make sense, or look at the zombies in the DayZ release, they do that. 2. Give them some sort of ranged weapon. 3. Wait a while, I'm slowly working on/putting off working on a melee zombie ai. When it's done it'll be available for use to anyone, and probably quite useful to you.
|
Mon Jan 26, 2015 4:42 pm |
|
|
clunatic
Joined: Fri Nov 23, 2012 5:42 am Posts: 143
|
Re: Summon AHuman on your team?
Here's my version of melee AI, which uses a quick and dirty method that I really should "fancify" at some point, but it should work. Make your actors use MeleeHumanAI.lua, any melee weapons need to be in the "Melee Weapons" group (just do AddToGroup = Melee Weapons in the ini code), edit MeleeHumanAI and MeleeNativeHumanAI so that the dofile command at the top of those files points to the right location, and finally you could open up MeleeHumanBehaviours and do a search for this: Code: --CHANGE THIS: you could change this to shorten the distance before the AI starts attacking You might want to tweak the number found on that line.
Attachments:
Lua.zip [27.68 KiB]
Downloaded 454 times
|
Mon Jan 26, 2015 5:27 pm |
|
|
RandomCoderZ
Joined: Fri Sep 13, 2013 1:39 am Posts: 157 Location: ᴱᵛᵉʳʸʷʰᵉʳᵉ
|
Re: Summon AHuman on your team?
clunatic wrote: Here's my version of melee AI, which uses a quick and dirty method that I really should "fancify" at some point, but it should work. Make your actors use MeleeHumanAI.lua, any melee weapons need to be in the "Melee Weapons" group (just do AddToGroup = Melee Weapons in the ini code), edit MeleeHumanAI and MeleeNativeHumanAI so that the dofile command at the top of those files points to the right location, and finally you could open up MeleeHumanBehaviours and do a search for this: Code: --CHANGE THIS: you could change this to shorten the distance before the AI starts attacking You might want to tweak the number found on that line. "I tried, I cried" No but seriously, me and Lua is like eating pancakes and drink red juice... It just doesn't work. I made the zombies wield the vanilla blunderpop for now.
|
Mon Feb 02, 2015 11:48 am |
|
|
clunatic
Joined: Fri Nov 23, 2012 5:42 am Posts: 143
|
Re: Summon AHuman on your team?
What exactly doesn't work? Do you get error messages in the console? There's no reason it shouldn't work, but if you're having trouble making the adjustments I could always do them for you, if you upload your mod, either in this thread or send me a pm if you don't want to post it pubicly.
|
Mon Feb 02, 2015 5:20 pm |
|
|
|