|
Post by Chronicman on May 13, 2020 4:21:42 GMT
Your getting a null ref error, meaning the script is trying to use a reference but it is null. So it could possibly be the motor ref or the target ref.
|
|
opida
Junior vMember
Posts: 38
|
Post by opida on May 18, 2020 17:32:57 GMT
beinomat are you using another ai system for your enemies? Chronicman wave spawner is set to work with invectors AIMotor, so example if you are using emerald ai it would only spawn the one single instance of a enemy, and not in a wave.
So if you out comment this inside AIWaveSpawnerBrain it should work for emerald or other ai systems:
var motor = go.GetComponent<v_AIMotor>();
motor.currentTarget.transform = spawner.toTarget;
motor.currentTarget.colliderTarget = spawner.toTarget.GetComponent<Collider>();
motor.currentTarget.character = spawner.toTarget.GetComponent<vIHealthController>();
motor.currentState = v_AIMotor.AIStates.Chase;
But this would not fix it intreally as at the system would not know if your ai is dead and begin new wave.
|
|
Aaron
Junior vMember
Posts: 44
|
Post by Aaron on Oct 4, 2020 17:12:06 GMT
I love the concept of this and tried it out. I got it to spawn once, so that's a plus, but I've also run into numerous errors from doing it wrong.
Could you post documentation or even a quick tutorial of how it all works?
|
|
|
Post by jbacal on Mar 9, 2021 19:55:09 GMT
Working well so far. Thanks for another useful addon.
|
|
favo
New vMember
Posts: 2
|
Post by favo on Apr 15, 2021 6:55:18 GMT
Hi, Can I request a step-by-step instruction on how to operate this? I don't have the slightest understanding on how to use it. If someone can help out, I'll greatly appreciate it. Thanks!
|
|
|
Post by manwitch on Jan 10, 2022 20:47:14 GMT
Its more or less for Invector items, Should have named it better. I mean it could spawn objects once but if you wanted it to repeat you would need to tell the spawner its been collected or destroyed what ever the case might be. I've been trying and trying to accomplish this but I'm having epic fails. The object I'm trying to get to respawn is an invector item but I have a GAction (from the hobbycoder addon) on it. I can't seem to get the spawner to recognize that the item has been destroyed or that items have been added to the inventory. To be precise, I have a log that has a GAction on it that chops the log, then destroys it, and gives the character a min max number of boards when it's finished. I just can't seem to get the spawner to recognize that the log has been destroyed or that boards have been added to the inventory. I've tried so many things and can't figure it out. I have the using directives and name spaces so the scripts can "see" each other, but I can't get it to respawn after the GAction. I know Chronicman and Hobbycoder don't stop in here that much these days but maybe someone else has ideas? Any help is welcomed.
|
|
|
Post by Chronicman on Jan 16, 2022 21:49:22 GMT
Updated addon see first page
|
|
|
Post by manwitch on Jan 17, 2022 19:20:48 GMT
Updated addon see first page You're a rockstar in my book! Thanks for the update.
|
|
|
Post by Chronicman on Jan 18, 2022 12:16:30 GMT
No worries mate, let me know if your still having trouble with with the gAction. Pretty sure I fixed it though.
|
|
|
Post by manwitch on Jan 18, 2022 15:46:02 GMT
No worries mate, let me know if your still having trouble with with the gAction. Pretty sure I fixed it though. I'm still not able to get it working. I think it has something to do with the way hobbycodders Gaction uses his autoaddtoinventory, and I just can't figure out how to get the spawner to recognize it has added the resulted items. I'm usually pretty good at editing scripts to get what I want but this one has me baffled. Being self taught with C#, I don't think I've learned quite enough yet to understand how to get these two addons working together. Maybe more learning about coroutines... I don't know lol. I don't expect either you or hobbycoder to fix it. Both of you guys' scripts work as expected. But any help I get I will really appreciate lol.
|
|
|
Post by Chronicman on Jan 19, 2022 5:54:25 GMT
I just looked and gAction is free so when I get a chance I’ll download and look into it just helping someone on discord with saving system when I’m done with that I’ll check on this matter.
|
|
|
Post by manwitch on Jan 19, 2022 13:48:13 GMT
You're going above and beyond, and I thank you.
|
|
|
Post by Chronicman on Jan 19, 2022 20:29:18 GMT
Ok so I looked into it a bit and I think this might be how we can do it. None of the hobby's objects are not working for me in the demo so I could not test it. I'm not sure if this event "onEndGAction" gets called when the action is complete and or is canceled so we will see.
In the class spawnerhelper replace this into the start function
private void Start()
{
if(objectSpawner != null)
{
var genericAction = GetComponent<vTriggerGenericAction>();
if(genericAction == null)
{
var tList = GetComponentsInChildren<Transform>();
for (int i = 0; i < tList.Length; i++)
{
if (tList[i].GetComponent<vTriggerGenericAction>())
{
genericAction = GetComponent<vTriggerGenericAction>();
break;
}
}
}
if (genericAction != null)
{
genericAction.OnPressActionInput.AddListener(OnChangeCount);
}
// Hobby code gAction section
var gHolder = GetComponent<GHolder>();
if (gHolder == null)
{
var tList = GetComponentsInChildren<Transform>();
for (int i = 0; i < tList.Length; i++)
{
if (tList[i].GetComponent<vTriggerGenericAction>())
{
gHolder = GetComponent<GHolder>();
break;
}
}
}
if(gHolder != null)
{
gHolder.onEndGAction.AddListener(OnChangeCount);
}
}
if(aiSpawner != null || aiWaveSpawner != null)
{
var character = GetComponent<vHealthController>();
if (character != null)
character.onDead.AddListener(OnChangeCount);
}
}
|
|
|
Post by manwitch on Jan 19, 2022 22:02:30 GMT
You sir are a gentleman and a scholar! It works perfectly. You have no idea how much I appreciate your time and trouble on this. And I think I learned a thing or two from your code so an extra yahoo! Thanks again Hopefully I will soon have a playable game to share. Just need to finish up some of the npcs and then the save system.
|
|
|
Post by Chronicman on Jan 20, 2022 2:37:57 GMT
That’s awesome news! Glad it worked 😀
Ps Would love to check out the demo.
|
|