PDA

View Full Version : What's wrong with this script?


ModderEarthHAHA
10-14-2005, 05:59 PM
What's wrong?


void main()
{
effect EffectDisguise(Random(225) + 83);
}


I tried putting the integer declarations (int) before the values. It still didn't work but should I do that?

I know, I'm a noob at this... only programming I've done is Visual Basic...

stoffe
10-14-2005, 07:10 PM
What's wrong?


void main()
{
effect EffectDisguise(Random(225) + 83);
}




You are missing the name of the effect variable you have declared. It should be something like:

effect eDisguise = EffectDisguise(Random(225) + 83);

Provided that what you want a disguise effect with a randomly picked appearance type between 83 (Tach) and 308 (NPC Jedi). It would be a bit odd since it includes everything from turrets to Hutts in that range. :)

Det. Bart Lasiter
10-14-2005, 07:23 PM
Don't forget to apply the effect as well, that script on it's own won't do anything without a few more lines similar to the following:

void main()
{
object oTarget = /*Object*/; // Assign a value to this such as 'GetSpellTargetObject() or the like
effect eDisguise = EffectDisguise(Random(225) + 83);
ApplyEffectToObject(1, eDisguise, oTarget, /*floating point duration*/);
}

ModderEarthHAHA
10-15-2005, 12:28 PM
What I want to do is make an "Appearence Modulator", which will be a device that let's you transform yourself into whatever the randomizer lets you become.

It's for the PC (EDIT: Player Controlled and not Personal Computer, just in case anyone wondered), and yes it's going to make you into a hutt or a turret from time to time, I want to see what happens.

EDIT2:
What about now?

void main()
{
eApeMod = EffectDisguise(Random(225) + 83);
ApplyEffectToObject(1, eApeMod, GetFirstPC(), /*floating point duration*/);
}


(4): Error: Syntax error at ")".

EDIT3:
Nevermid, changed it to this. Now it compiled.


void main()
{
effect eApeMod = EffectDisguise(Random(225) + 83);
ApplyEffectToObject(1, eApeMod, GetFirstPC(), 0.0);
}