Before I get into a long description of what I think is wrong can you tell me if you think the ACR scripts on placeables (especially applying visual effects) is working? The description of variable names on the wiki is inconsistent and doesn't seem to match up with definitions in some of the scripts e.g. acr_vfx_i?
Cheers
Teric
Edit: Sorry, belay all that ... I didn't track back through the include file far enough. The wiki is wrong, though. The instructions for adding an effect;
For example, to construct a knockdown physical effect to be used with the fire beam visual effect described above that expires after 10 seconds, you would create the following:
Variable Name : ACR_VFX_ON_USE_PHYSICAL_EFFECT
Variable Type : string
Variable Value : KNOCKDOWN/10.0
The name should be ACR_VFX_ON_USE_EFFECT_PHYSICAL as at the paragraph header higher up.
TnD
Er, no. After another evening spent chasing my tail I realised that it wasn't what I wanted as placeables don't have an OnSpawn script. Doh. So I then put the VFX as a variable on a spawn point and that didn't work either. *sigh*
What I'm trying to do is spawn some "Phosphorescent Moss" which is a moss placeable that glows in the dark.
I've finally discovered that ACR_SpawnObject("light", OBJECT_TYPE_LIGHT) is a valid command (at least from a group script) so I can spawn the placeable and the light at the same time. The light will spawn on the landscape surface, however, so I think I need to use ACR_SpawnObjectAtLocation and make the z-coordinate 0.5 metres higher than GetPosition of the spawn point. Can I work out how to do this? Er, no. Can someone please tell me how to add a quantity to the z-coordinate of a vector and define it as a new position? I'm pulling my damn teeth out over this because it's the only thing stopping me putting a new Beta up.
Thanks
Teric
I've finally discovered that ACR_SpawnObject("light", OBJECT_TYPE_LIGHT) is a valid command
Really?! That's very useful information. In trade I offer this snippet of code modified from a NWN1 script I wrote to move a siege tower. I don't like the looks of the nStart integers I plugged into the GetSubString. They look way too big as start points for nCount to me, but it's been a year or more since I looked at this. Hopefully it will work or you can tinker with the idea:
If it doesn't work or it's returning the wrong part of the substring, try a test message in your game. Send the substring to your PC as a message and count the digits in it for nStart and nCount.
You can also modify parts of a vector (like the Z coordinate) by using the . operand. For example, to spawn a light 12.5 above placeable oCandle, one could do the following:
Thanks Wynna and AL.
This is now working - what I needed was the syntax of how to perform maths on a vector, which AL provided. (The "dot operator). Only thing missing from AL was the fact that you also need to define the facing for the spawn.
If anyone needs anything similar the code came out as:
This is at the bottom of a group script; call it "as_group_myscript" and add the string "myscript" as the value of the ACR_SPAWN_GROUP_1 variable on the waypoint.
Teric