This is a script I made that applies an effect to a throne when the person with the correct cd-key will sit on it:
void main()
{
object oPC = GetLastUsedBy();
object oThrone = OBJECT_SELF;
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW);
if(GetIsObjectValid(oThrone)&&
!GetIsObjectValid(GetSittingCreature(oThrone)) &&
GetPCPublicCDKey(oPC)== "xxx")
{
AssignCommand(oPC, ActionSit(oThrone));
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis, OBJECT_SELF);
SetLocalInt(OBJECT_SELF, "DM_No_Magic", 1);
}
else
{
string NoSit = "You are not allowed to sit on this throne!";
FloatingTextStringOnCreature(NoSit, oPC);
}
}
Now I think it would be more funny when the visual effect is removed again when the person moves out of the throne.
I fear I have to use a loop?? And how? :blink:
[snapback]15211[/snapback]
You use a onbeat on your thrones anyway, add a check on it that gets the sitting creature. Check for the cdkey and apply the visual for 6 (or a bit more) seconds to it. The visual will wear off and readded as long the creature sits on it. This is prolly the easy way.
-Mel
not to sound totally stupid, but which CD would u use? (i have 3 keys from each of the CDs)
[snapback]15448[/snapback]
Hmmmm I have SOU & HOTU so I have 3 cd-keys too. But since I am not able to start the game only by using the SOU-CD or the basic NWN-CD I think checking only one CD-Key is okay for me.
And the problem is not which CD-Key to use but how to script this on and off effekt but I think I try this while loop mel posted above your post Khadgar :D
Thanks anyway :)
ya know...you could just make portable thrones then you won't have to worry about ppl sittin in them
[snapback]15595[/snapback]
LOL Khadgar, I am not worrieing about ppl sitting in thrones which doesn't belong to them. That's not the problem at all.
Besides, I think I'll try Mel's idea.
However thanks for your post :D
not to sound totally stupid, but which CD would u use? (i have 3 keys from each of the CDs)
[snapback]15448[/snapback]
It's your Public CD Key.. It's not a game CD key.. More like Gamespy one I think.. I'm not sure where you find it, but it is easy enough to loo kat server logs or make a small script for the pc to say his own key or whatnot.
LOL Khadgar, I am not worrieing about ppl sitting in thrones which doesn't belong to them. That's not the problem at all.
Besides, I think I'll try Mel's idea.
However thanks for your post :D
[snapback]15599[/snapback]
I think he was being sarcastic...lol