Is it possible to call a sparkey spawner case from a script? Example, conversation choice that calls a case # from the sparkey_enc script.
I’m trying to create an object with a conversation that can spawn a large number of mobs/groups. Would be great if I can just call a case from the sparkey_enc to do this.
This is lifted from a script I use that calls sparky from a trigger, but instead this is the speaking NPC.
Now, I realize you may want a different action depending on the conversation choice. You can set the variable in the same script. I will edit the above to show that.
This is awesome. Thank you Mannast! BTW thank you for the base module you created! I’m not great w/ code, but for some reason I’m addicted to getting things working in my nwn module that no one will ever see or play lol.
Would the first method you discussed only allow for 10 encounters? enc01 through enc10 per the predefined variables on the NPC?
Per the updated code, I could just make an individual script per “summon” that I want to happen from the conversation? Is that the idea? Just modify the encounter line per the script.
To better put what I’m trying to do. A simple arena like that from the ‘pretty good character creator’ module, that I can select a goblin or balor from a conversation selection. In which whatever is selected gets spawned into the room at the set wp. I’ll need to figure out how to prevent drops/exp from these mobs, but I can sort that out later.
Sparky goes up to 99 encounters, I think
“encounter_” 01-99 - but you would define the encounter in the individual scripts and just call the one encounter set in the script.
This is related to the previous posts, as I’m just starting to work on this part again. Should the following work? Currently it doesn’t spawn anything for me. Even if I comment out one of the encounter lines. This script is called from a npc conversation choice. abt_minotaur & art_hmerc are the resref and tags for both custom creatures i’m trying to spawn in 5 of each in a pve arena setting.
I have sparkey_enter and sparkey_exit set on the area’s events. Not sure if those are even needed for a script to call an encounter on the fly like this.
Additionally, I’m also trying to figure out if I can create a table/list of 30 encounters, and to have it only pull 5 randomly from that table. So each time this spawn is called it pulls 5 encounters randomly from the list of 30.
Last question if you know - Anytime I set a spawn with Sparkey’s that uses a waypoint, it won’t allow me to include a second encounter with a different waypoint - form the same encounter. Like the code I listed above. Is that just how Sparkey’s works?
If I leave these in, the script doesn’t compile because of the first row (ERROR: UNKNOWN STATE IN COMPILER). If I comment these two out it crashes the module when it kicks off the spawn script. If I save it anyways, and try it - nothing spawns. I assume these two lines are needed but the int is looking for something else?
Edit: Redo-ing some testing. I merged something into the sparkey_inc script like 9 months back and that is maybe my issue.
Yeah I’m not sure why it’s crashing my module. Sparky_inc is restored with the default script.
Played around with the script but I’m running into the same thing regardless.
NPC had a conversation.
oPC gets a “Start Arena” conversation option
“Start Arena” has script set on ‘Actions Taken’
That script is as follows:
arena_red and arena_blue waypoints exist in the same area.
I moved the waypoints to where my PC can walk just to be sure the “pit” I had them in was not out of bounds or something. Even though I could spawn in creatures with DM enabled in said pit. It didn’t have any impact and still crashes.
This also answered another question of mine above that it can indeed spawn seperate encounters at different waypoints. Something I’ve had a hard time getting working with tables or groups for sparkys.
Now… to add a betting system, have the NPC monitor the creatures with art_ abt_ in their tag to determine what team wins (is alive) and announce it. And then clear the remaining winning team creatures so the event can be triggered again. Also pay out to the players that bet on the winning team.
Should be easy right?
Edit: Also… can a script call another script from a list at random? If I created 50 scripts for these arena encounters, could one script be set to pick and run one of them at random? Trying to figure out a good way to make it feel random, and not often would you see the same encounters in the arena.