UltimaPhoenix's Scripting Help Needed Thread
#1
Posté 03 février 2011 - 01:54
I have two separate encounters where I need three things to happen in sequential order:
1.) The black cloud effect (n2_fx_black_cloud) effect spawns in a number of locations, indicated by a waypoint,
2.) Wave after wave of enemies spawn where the black cloud is and attack the PC,
3.) After the final wave spawns (where a mini-boss would spawn), the black cloud is removed.
4.) After the battle is over, a conversation occurs between the various party members.
Keep in mind that my success thus far has been 95% Lilac Soul's script generator and actions through conversations, so making these events occur is currently beyond my level of scripting skill.
I have tried OnDeath scripts (which does work, but I don't know how to give the script to a newly spawned creature without making a number of different blueprints - these are custom creatures and are used many times throughout the module).
I also tried NESS, which works great except that I only want the two encounters to happen after a conversation and I don't know enough scripting to make NESS activate the waypoints.
Finally, I figured that the use of variables would work great, but I can't a.) make a script that fires when the global int is set regardless of where the PC is, and b.) increments per kill to trigger the next wave of the spawn.
I'm sorry to impose, but if you have the time to walk me through this, I'd really appreciate it. I am also reading the various tutorials, but I'm also a student so it'll take some time to work through them.
Thank you very much, in advance!
-UltimaPhoenix
#2
Posté 03 février 2011 - 05:38
So basically the steps would be
- script A is triggered somehow and creates cloud fx, spawns in first wave, adds first wave creatures into a group, sets the group on death execute script to script B.
- script B is automatically fired when last member of group A dies, and it thens spawns the next wave, adds them to a group and sets the group on death execute script to script C.
- script C (assuming final wave) spawns mini-boss and his compatriots and adds them to a group and sets the group on death script to script D.
- script D destroys the clouds and initiates the party conversation.
Should work. Look at the group functions in the script editor. For a simple working example, look in the OC at the script used when you first meet Khelgar. That initial fight is handled exactly this way, except there are not multiple waves.
Regards
#3
Posté 08 février 2011 - 03:36
It took me a little while to rebuild my module back to the point where I could institute the spawn - corrupted partition. I just wanted to be clear what script I should be looking at: "12tr_khel_intro?" Incidentally, I love how in script 12a_cs_inn_atk, the Duergar are referred to as smurfs.
#4
Posté 09 février 2011 - 12:48
#5
Posté 09 février 2011 - 04:13
void main()
{
object oPC = GetFirstPC();
string sTag = GetLocalString(OBJECT_SELF, "Tag");
object oEncounter = GetNearestObjectByTag(sTag, oPC, 1);
SetEncounterActive(TRUE, oEncounter);
TriggerEncounter(oEncounter, oPC, ENCOUNTER_CALC_FROM_FACTION, -1.0);
SetEncounterActive(FALSE, oEncounter);
}
This will auto fire off the next encounter trigger once the previous one has been exhausted as if the player had walked through it.. The very first wave trigger should be one that the player will actually walk acrossed.
This is just a simpler method than using the group functions but has the same end result. Note though that an encounter is not considered exhausted until all creatures are dead and their dead bodies disappear.
#6
Posté 09 février 2011 - 06:22
#7
Posté 09 février 2011 - 07:58
_Knightmare_ wrote...
I'd just set them up using encounter triggers. Paint down a trigger that has all the encounter settings on it (# of creature types, etc.), paint one for each wave of creatures. Put it in some out of way place that no PC or NPC will be able to walk acrossed it (can be located in a non-walkable mesh place). For each trigger, set a String variable on it called "Tag" with a value of the tag of the next wave encounter trigger. Then place something like the following code for the OnExhausted event of each trigger:
void main()
{
object oPC = GetFirstPC();
string sTag = GetLocalString(OBJECT_SELF, "Tag");
object oEncounter = GetNearestObjectByTag(sTag, oPC, 1);
SetEncounterActive(TRUE, oEncounter);
TriggerEncounter(oEncounter, oPC, ENCOUNTER_CALC_FROM_FACTION, -1.0);
SetEncounterActive(FALSE, oEncounter);
}
This will auto fire off the next encounter trigger once the previous one has been exhausted as if the player had walked through it.. The very first wave trigger should be one that the player will actually walk acrossed.
This is just a simpler method than using the group functions but has the same end result. Note though that an encounter is not considered exhausted until all creatures are dead and their dead bodies disappear.
@ KM
You always have something new that has heaps of useability / functionality! Nice work.
#8
Posté 09 février 2011 - 12:54
Without testing (I'm not yet back at the point in the module where the second wave-after-wave encounter should occur), could I just change "object oPC = GetFirstPC()" to "object oPC = GetPCSpeaker()?" It's not absolutely necessary, but I think the next encounter will fire from a conversation, then likely end with one.
#9
Posté 09 février 2011 - 02:40
@ UP:
If the script is fired from a convo, then yes, make the changes you suggested. In your first post here I thought you were wanting to fire off wave after wave, and then at the end have the convo - not have convos between the different waves of enemies. My mistake if that's what you wanted afterall.
Modifié par _Knightmare_, 09 février 2011 - 02:51 .
#10
Posté 10 février 2011 - 10:39
I just wanted to make sure you two know how much I appreciate your willingness to help me. I believe the term is "Noob," and it describes me well when it comes to modding.
_Knightmare_, I didn't originally specify that the second encounter came from a conversation; and using convos per wave made it easier than fighting with scripts when I don't know what I'm doing. Any fault is mine, truly. This module was inspired from a scenario I ran for my D&D group back when we still had the numbers to play, so it's been amazing to see it actually come to life. Originally, the PC's never had a convo during that second encounter, they were just thrown into the mix. But thought I'd try to expand my story-telling skills. In any event, I will let you know of my success once I get the chance to try out your suggestions.
Incidentally, thank you for pointing me to nwcitadel. I never knew it existed and I've been readily looking through all its posts for more information that I could use.
Gratias habere,
UltimaPhoenix.
#11
Posté 10 février 2011 - 01:18
And for those scripting "Noobs" out there like yourself, you might want to check out my tutorial, linked in my sig below. Its written for those in just your situation.
#12
Posté 10 février 2011 - 03:42





Retour en haut






