![]() |
Here is the deal, I have this NPC, and he is good at first, then I talk to him, say "Die" and he attacks me. At the exact same time I say "die", (in conversation) I want some of his friends to spawn in as an encounter. Here is what I have, and it DOESN'T work. Argh. [img]smile.gif[/img]
---------------- void main() { int bVisualEffect = SPELL_HARM; string sObj = "DROWGUARD02"; location lLoc1 = GetLocation(GetWaypointByTag ("WP_SPAWN01")); location lLoc2 = GetLocation(GetWaypointByTag ("WP_SPAWN02")); location lLoc3 = GetLocation(GetWaypointByTag ("WP_SPAWN03")); location lLoc4 = GetLocation(GetWaypointByTag ("WP_SPAWN04")); location lLoc5 = GetLocation(GetWaypointByTag ("WP_SPAWN05")); CreateObject(OBJECT_TYPE_CREATURE, sObj, lLoc1, bVisualEffect ); CreateObject(OBJECT_TYPE_CREATURE, sObj, lLoc2, bVisualEffect ); CreateObject(OBJECT_TYPE_CREATURE, sObj, lLoc3, bVisualEffect ); CreateObject(OBJECT_TYPE_CREATURE, sObj, lLoc4, bVisualEffect ); CreateObject(OBJECT_TYPE_CREATURE, sObj, lLoc5, bVisualEffect ); } ------------------- And I have 5 waypoints where I want these dudes to appear (I want 5 of them). but nothing happens. Any ideas? Each waypoint is named in succession as in the script above, I've triple checked everything, and am at a loss. Help?? [img]smile.gif[/img] |
I think bVisualEffect needs to be set as TRUE or FALSE.
If you want to show a specific animation when the Drow are summoned, I believe you must use a separate command to do that. So you would create a Drow, CreateObject(OBJECT_TYPE_CREATURE, sObj, lLoc1, FALSE); Then you would do a visual effect of your choice at that location, AssignCommand ( GetObjectByTag(sObj), ApplyEffectAtLocation (DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_HARM), lLoc1, 3.0) ); I think that's how to do it... Lemme check to see if it works :D EDIT: It works [img]smile.gif[/img] Also, be sure that you have this script in the ActionTaken slot in your NPC's conversation. You can mess around with DelayCommand if you want the Drow to be summoned one at a time or something. Also you can use a wide variety of effects for the visual - pretty much every constant starting with VFX is valid. [ 02-10-2004, 07:35 PM: Message edited by: Darkman ] |
Here is how Lilac Soul script generator does this, I use it to learn for spawns fired by conversation in my arenas and it works fine. Note: the visual effect used in the example is death rather than the harm spell due to the Script gen's defaults
___________ /* Script generated by Lilac Soul's NWN Script Generator, v. 1.6 For download info, please visit: http://www.lilacsoul.revility.com */ //Put this on action taken in the conversation editor void main() { object oPC = GetPCSpeaker(); object oTarget; object oSpawn; location lTarget; oTarget = GetWaypointByTag("WP_Spawn"); lTarget = GetLocation(oTarget); oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "resref of spawn creature", lTarget); oTarget = oSpawn; //Visual effects can't be applied to waypoints, so if it is a WP //apply to the WP's location instead int nInt; nInt = GetObjectType(oTarget); if (nInt != OBJECT_TYPE_WAYPOINT) DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DEATH), oTarget)); else DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DEATH), GetLocation(oTarget))); } [ 02-10-2004, 07:38 PM: Message edited by: Chewbacca ] |
And here is how I actually do it in my arena, minus the visual effect.
____________ </font><blockquote>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">location lTarget; location lTarget2; location lTarget3; object oSpawn; object oSpawn2; object oSpawn3; object oTarget; object oTarget2; object oTarget3; void main() { object oPC = GetPCSpeaker(); oTarget = GetWaypointByTag("WP_UD_Arena4"); oTarget2 = GetWaypointByTag("WP_UD_Arena5"); oTarget3 = GetWaypointByTag("WP_UD_Arena6"); lTarget = GetLocation(oTarget); lTarget2 = GetLocation(oTarget2); lTarget3 = GetLocation(oTarget3); oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "drowhighmage", lTarget); oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "x2_mephdrow008", lTarget2); oSpawn3 = CreateObject(OBJECT_TYPE_CREATURE, "x2_mephdrow008", lTarget3); }</pre>[/QUOTE] |
Thanks, but the error I made was using the actual TAG and I should have used the resref. [img]smile.gif[/img] UGH! I totally forgot about calling objects and items, you gotta do a resref instead of a tag.
Thanks though!! You can see the results of this script near the exit to the third level on level 2 in my Mod :D Loki's quest is NOW working, and you can complete it and the XP and rewards are really good. |
Yes the tag has problems with custom spawning. You can easily make these guys spawn to the same waypoint, giving a 'togetherness' feel to them and saving on unnecessary cpu consumption.
|
I almost always make my tags and resrefs identical on all custom objects, including creatures. Saves me the trouble of remembering when Im supposed use which for what.
I'll hafta check out the EFU additions soon, if I can drag myself away from the toolset long enough! [img]smile.gif[/img] |
All times are GMT -4. The time now is 10:40 AM. |
Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
©2024 Ironworks Gaming & ©2024 The Great Escape Studios TM - All Rights Reserved