![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
#1 |
Ironworks Webmaster
Join Date: January 4, 2001
Location: Lakeland, Florida
Age: 52
Posts: 11,727
|
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] |
![]() |
![]() |
![]() |
#2 |
Avatar
![]() ![]() ![]() ![]() Join Date: July 11, 2001
Location: Austin, Texas
Age: 44
Posts: 525
|
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 ![]() 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 ]
__________________
There more of it there is,<br />The less you see. |
![]() |
![]() |
![]() |
#3 |
Zartan
![]() Join Date: July 18, 2001
Location: America, On The Beautiful Earth
Age: 51
Posts: 5,373
|
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 ]
__________________
Support Local Music and Record Stores! Got Liberty? |
![]() |
![]() |
![]() |
#4 |
Zartan
![]() Join Date: July 18, 2001
Location: America, On The Beautiful Earth
Age: 51
Posts: 5,373
|
And here is how I actually do it in my arena, minus the visual effect.
____________ code:location lTarget;[/QUOTE]
__________________
Support Local Music and Record Stores! Got Liberty? |
![]() |
![]() |
![]() |
#5 |
Ironworks Webmaster
Join Date: January 4, 2001
Location: Lakeland, Florida
Age: 52
Posts: 11,727
|
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 ![]() |
![]() |
![]() |
![]() |
#6 |
Jack Burton
![]() Join Date: May 31, 2002
Location: Ireland
Posts: 5,854
|
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.
__________________
Still I feel like a child when I look at the moon, maybe I grew up a little too soon... |
![]() |
![]() |
![]() |
#7 |
Zartan
![]() Join Date: July 18, 2001
Location: America, On The Beautiful Earth
Age: 51
Posts: 5,373
|
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]
__________________
Support Local Music and Record Stores! Got Liberty? |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Drow vs Drow argument | Sythe | Baldurs Gate II: Shadows of Amn & Throne of Bhaal | 8 | 04-07-2003 06:56 PM |
Always Toughest Random Spawns (Spoil) | Thorfinn | Baldurs Gate II: Shadows of Amn & Throne of Bhaal | 5 | 03-10-2003 04:08 PM |
Script help | Lord Splynncryth | Dungeon Craft - RPG Game Maker | 2 | 09-15-2002 11:35 PM |
Script | Wedin | Icewind Dale | Heart of Winter | Icewind Dale II Forum | 3 | 04-06-2002 02:14 PM |
Drow attacks in Underdark ""HELP"" SPOILER | Moridin | Baldurs Gate II Archives | 2 | 02-27-2001 03:12 AM |