|
member
|
OP
member
Joined: Jul 2015
|
slogging on  here is the beta script so far... Sadly its not working but were in striking range for sure. The main issue: the script is not recognizing the current spawn of the zombie, so more than one can appear if the PC runs through the trigger more than once. so the logic of it is quarry is not functioning. we set a DB and we add the template to the DB, with concatenation. MonkWorksZombieDatabase(_Zombie) anyway here's the script most of the commented stuff was tested and I only left in working tests. so through Commenting I hope to have a default type script that can spawn monster, items and so on... Bata 0.000000000000000001 -INIT--------------------------------------------- DB_IsPlayer(CHARACTERGUID_S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406); //TriggerRegisterForPlayers(TRIGGERGUID_Monkworks_EventTrigger_000_7c51d4d5-1730-4e3c-88f3-9e07746e3ab5); TriggerRegisterForPlayers(TRIGGERGUID_MonkworksBOXtrigger000_287131ab-cb9a-4506-841a-d40afdd5b53c);
-KB---------------------------------------------------- /*stuff*/ IF CharacterEnteredTrigger(_Character, TRIGGERGUID_MonkworksBOXtrigger000_287131ab-cb9a-4506-841a-d40afdd5b53c) AND GetPosition(TRIGGERGUID_MonkworksSpawnPoint_001_c42ca452-5558-43a7-a05a-56b1def46723, _X, _Y, _Z) AND CharacterCreateAtPosition(_X, _Y, _Z, "CHARACTERGUID_Monkworks_Undead_Zombie000_2f62a479-299e-44e8-9688-8ac78bbce0f0", 1, _Zombie) AND NOT DB_MonkWorksZombieDatabase(_) THEN DB_MonkWorksZombieDatabase(_Zombie);
IF CharacterDied(_Zombie) AND DB_MonkWorksZombieDatabase(_Zombie) THEN NOT DB_MonkWorksZombieDatabase(_Zombie);
Last edited by Detect; 07/01/18 11:54 PM.
|
|
|
|
member
|
member
Joined: Nov 2017
|
My previous post may have somewhat mislead you. Mea culpa. The CharacterCreateAtPosition query spawns the character. This means that
AND CharacterCreateAtPosition(_X, _Y, _Z, "CHARACTERGUID_Monkworks_Undead_Zombie000_2f62a479-299e-44e8-9688-8ac78bbce0f0", 1, _Zombie) AND NOT DB_MonkWorksZombieDatabase(_) THEN DB_MonkWorksZombieDatabase(_Zombie);
in human terms means "Create a character at position (_X,_Y,_Z) (and return what character it is) and, if no character is in the Database, add that character to the database".
What you need is "if no character is in the database, create a character at position (_X, _Y, _Z) (and return what character it is) and add them to the database".
Last edited by LarIlya; 07/01/18 11:25 PM.
|
|
|
|
member
|
OP
member
Joined: Jul 2015
|
simpler layout for review. I think you mean to call out right off the start that if _zombie is in fact not in the DB, add to DB and spawn the _Zombie?? (logic)we started off with if the PC hit the trigger, call out DB, is the _zombie in DB, then don't do anything. spawn _Zombie.
\head hurts/
Old structure.
IF CharacterEnteredTrigger(_Character, TRIGGERGUID_*ID*) //checks if the trigger is triggered. AND GetPosition(TRIGGERGUID_*ID*, _X, _Y, _Z) //checks the position of the point trigger, were the mob will spawn and returns. AND CharacterCreateAtPosition(_X, _Y, _Z, "CHARACTERGUID_*ID*", 1, _Zombie) //Create the Zombie from the CHARACTERGUID_*ID* AND NOT DB_MonkWorksZombieDatabase(_) //checks to conferm if Zombie is NOT in DB. THEN DB_MonkWorksZombieDatabase(_Zombie); //Adds Zombie (CHARACTERGUID_*ID*) to DB
IF CharacterDied(_Zombie) //check if Zombie is dead. AND DB_MonkWorksZombieDatabase(_Zombie) //aadd to db THEN NOT DB_MonkWorksZombieDatabase(_Zombie); //then don't add it to DB.
Last edited by Detect; 08/01/18 12:17 AM.
|
|
|
|
member
|
OP
member
Joined: Jul 2015
|
Looks like this is working. I need more time testing it. I haven't spent more than an 20 m testing this.. but only one Zombie spawn after a run through the trigger a few times...
INIT--------- DB_IsPlayer(CHARACTERGUID_S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406); /*TriggerRegisterForPlayers(TRIGGERGUID_Monkworks_EventTrigger_000_7c51d4d5-1730-4e3c-88f3-9e07746e3ab5); //swapout to EventTrigger*/ TriggerRegisterForPlayers(TRIGGERGUID_MonkworksBOXtrigger000_287131ab-cb9a-4506-841a-d40afdd5b53c); KB------------ IF CharacterEnteredTrigger(_Character, TRIGGERGUID_MonkworksBOXtrigger000_287131ab-cb9a-4506-841a-d40afdd5b53c) AND GetPosition(TRIGGERGUID_MonkworksSpawnPoint_001_c42ca452-5558-43a7-a05a-56b1def46723, _X, _Y, _Z) AND NOT DB_MonkWorksZombieDatabase(_) AND CharacterCreateAtPosition(_X, _Y, _Z, "CHARACTERGUID_Monkworks_Undead_Zombie000_2f62a479-299e-44e8-9688-8ac78bbce0f0", 1, _Zombie) THEN DB_MonkWorksZombieDatabase(_Zombie);
IF CharacterDied(_Zombie) AND DB_MonkWorksZombieDatabase(_Zombie) THEN NOT DB_MonkWorksZombieDatabase(_Zombie);
Last edited by Detect; 10/01/18 02:03 AM.
|
|
|
|
member
|
OP
member
Joined: Jul 2015
|
further testing. reboot of the editor and this scripted stopped working. Nothing is spawning at all now... not sure why
|
|
|
|
member
|
OP
member
Joined: Jul 2015
|
so I'm back to this script and it spawns every time you run through the trigger..
IF CharacterEnteredTrigger(_Character, TRIGGERGUID_MonkworksBOXtrigger000_287131ab-cb9a-4506-841a-d40afdd5b53c) AND GetPosition(TRIGGERGUID_MonkworksSpawnPoint_001_c42ca452-5558-43a7-a05a-56b1def46723, _X, _Y, _Z) AND NOT DB_MonkWorksZombieDatabase(_) AND CharacterCreateAtPosition(_X, _Y, _Z, "CHARACTERGUID_Monkworks_Undead_Zombie000_2f62a479-299e-44e8-9688-8ac78bbce0f0", 1, _Zombie) THEN DB_MonkWorksZombieDatabase(_Zombie); IF CharacterDied(_Zombie) AND DB_MonkWorksZombieDatabase(_Zombie) THEN NOT DB_MonkWorksZombieDatabase(_Zombie);
|
|
|
|
member
|
OP
member
Joined: Jul 2015
|
So confusing guys. This in fact might be working and the way I am testing it is not correct. here is some of the behaviour.
1. reload level and story. zombie spawns. 2. test the trigger a few times.. one Zombie once.
1. Reload level Nothing spawns. 2. reboot editor Nothing spawns... 3. reload level and story. zombie spawns once!!
what is happening here???
will test in game don't have time tonight.
IF CharacterEnteredTrigger(_Character, TRIGGERGUID_Monkworks_eventTrigger_001_aa7348aa-423b-4b65-936b-a741fd61245b) AND GetPosition(TRIGGERGUID_Monkworks_spawnEventTrigger_000_8b450762-1957-408a-b91d-b6ce4353cf4a, _X, _Y, _Z) AND NOT DB_MonkWorksZombieDatabase(_) AND CharacterCreateAtPosition(_X, _Y, _Z, "CHARACTERGUID_Monkworks_Undead_Zombie000_2f62a479-299e-44e8-9688-8ac78bbce0f0", 1, _Zombie) THEN DB_MonkWorksZombieDatabase(_Zombie); IF CharacterDied(_Zombie) AND DB_MonkWorksZombieDatabase(_Zombie) THEN NOT DB_MonkWorksZombieDatabase(_Zombie);
Meh.. had to test in game...
Is working perfectly in game.
run into the level. Run through the trigger. spawns the zombie at the spwnpoint.. run back through to see if more spawn.. only one spawns.
leave the level return. one zombie..
Needs further testing...
Last edited by Detect; 11/01/18 03:17 AM.
|
|
|
|
member
|
member
Joined: Nov 2017
|
The story state isn't rest if you just reload the level. To do that, you need to reload the level and the Story both.
|
|
|
|
member
|
OP
member
Joined: Jul 2015
|
Final script for the community. Beta version 0.001 tested Spawns a monster from a trigger. If the monster is killed and the trigger is used again the monster will respawn. If the monster is not killed and the trigger is used again only one monster will spawn at that location. The script checks if there is a monster spawned already at that location and if so then don't spawn another. If there is no monster there then spawn the monster. remember that spawing large amounts of monsters will be CPU intensive. KB--- /*tells the tool that this dummy is the PC*/ DB_IsPlayer(CHARACTERGUID_S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406); /*Registers the PC fo rthe tigger, with out it will not function*/ TriggerRegisterForPlayers(TRIGGERGUID_Monkworks_eventTrigger_001_aa7348aa-423b-4b65-936b-a741fd61245b);
InIt--- /* Monkworks Spawn Monster Script V0.001. If the PC runs through the trigger, Fire!
Thanks to Windemere & LarIlya Spawns one mob and only one no matter how many times the PC runs through the trigger. One Mob will allways spawn at that location. If the mob is killed, and the trigger it used again, One Mob will spawn again.*/
IF CharacterEnteredTrigger(_Character, TRIGGERGUID_Monkworks_eventTrigger_001_aa7348aa-423b-4b65-936b-a741fd61245b)/*<<<add your Trigger here*/ /*and get the Position of that SpawnPoint trigger that the Mob will spawn to*/ AND GetPosition(TRIGGERGUID_Monkworks_spawnEventTrigger_000_8b450762-1957-408a-b91d-b6ce4353cf4a /*<<<add your SpawnPoint here*/, _X, _Y, _Z) /*and the Mob is not in the DB yet*/ AND NOT DB_MonkWorksZombieDatabase(_) /*so create the ID at the said Position*/ AND
CharacterCreateAtPosition(_X, _Y, _Z, "CHARACTERGUID_Monkworks_Undead_Zombie000_2f62a479-299e-44e8-9688-8ac78bbce0f0"/*<<add your CHARACTERGUID there*/ , 1, _Zombie) /*while your at it add to the DB we have been taling about*/ THEN DB_MonkWorksZombieDatabase(_Zombie); /*_Zombie is the name of the DB entry*/
/*Hey if the MOb is dead already*/ IF CharacterDied(_Zombie) /* and it already in the DB*/ AND DB_MonkWorksZombieDatabase(_Zombie) /* Then do not add it to the DB and spawn the monster already*/ THEN NOT DB_MonkWorksZombieDatabase(_Zombie);
Last edited by Detect; 13/01/18 12:41 AM.
|
|
|
|
|