Re: is it possible...


[ Follow Ups ] [ Post Followup ] [ The Massassi Temple Message Board ]

Posted by Hideki on October 30, 1998 at 22:20:25:

In Reply to: Re: is it possible... posted by Slapshot on October 30, 1998 at 21:05:04:

: : : is it possble to:

: : : 2: Is it possible to change the tint color and intensity of force sight, and get rid of that annoying sound, and then make it everlasting and cost no mana?

: : It's possible. In the cog change
: : FarsightEffectHandle = newColorEffect(0, 0, 0, 0, 0, 0, 64, 64, 0, 1.0);
: : and delete all the lines that play sounds.
: : Delete the 2nd timer not to deactivate and turn cost and usecost to 0 to cost none.

: : 3: is it possible to make it so that when the crosshair passes over an enemy, it says in the upper corner of the screen how much health he has left?

: : Not when crosshair passes over an enemy but FirstThingInView or targetting would work.

: How would I do this?, And what does FirstThingInView? does that mean the first thing the player sees? How would you target something. I'm new and require guidance. My mind is open to your knowledge, so fill it up.
: once again, thx a lot

OK. I'm gonna.. FILL IT UP!
FirstThingInView is often used in force powers.(Deadly Sight, every targetting with circles around victim).

FirstThingInView(the thing that's trying to find something in its sight, FOV(eye width), the max distance to search, [0x404(players + actors), 0x424(players + actors + items)])

So for example of FirstThingInView will be..

==================================================

pulse:
victim = -1;
maxDot = 0;

potential = FirstThingInView(player, 70, 8, 0x404);
while(potential != -1)
{
if(
HasLOS(player, potential) &&
(potential != player) &&
(VectorDist(GetThingPos(player), GetThingPos(potential)) <= 50) &&
!((jkGetFlags(potential) & 0x20) && !IsInvActivated(player, 23))
)
{
dot = ThingViewDot(player, potential);
if(dot > maxDot)
{
victim = potential;
maxDot = dot;
}
}
potential = NextThingInView();
}
if(victim != -1)
{
if(GetThingHealth(victim) == 0)
print("Enemy dead");
else
{
jkSetTarget(victim);
jkSetTargetColors(20, 20, 20);
print("Enemy Life Left..");
printInt(GetThingHealth(victim));
}
}
else
jkEndTarget();

Return;
==================================================

Example of targetting is

==================================================

activated:
if(active)
Return;
victim = -1;
active = 1;
SetInvActivated(player, 25, 1);
ActivateBin(player, 0, 25);
SetPulse(0.33);
Return;

pulse:
victim = -1;
maxDot = 0;

potential = FirstThingInView(player, 100, 7, 0x404);
while(potential != -1)
{
if(HasLOS(player, potential) &&
(potential != player) &&
(VectorDist(GetThingPos(player), GetThingPos(potential)) <= 4) &&
!((jkGetFlags(potential) & 0x20) &&
!IsInvActivated(player, 23)))
{
dot = ThingViewDot(player, potential);
if(dot > maxDot)
{
victim = potential;
maxDot = dot;
}
}
potential = NextThingInView();
}

// If we have a victim...
if(victim != -1)
{
if(GetThingHealth(victim) == 0)
print("Enemy dead");
else
{
jkSetTarget(victim);
jkSetTargetColors(20, 20, 20);
print("Enemy Life Left..");
printInt(GetThingHealth(victim));
}
}
else
jkEndTarget();

Return;

deactivated:

DeactivateBin(player, 25);
call stop_power;
Return;

stop_power:
SetPulse(0);
SetInvActivated(player, 25, 0);
active = 0;
jkEndTarget();
Return;
==================================================
PrintInt can be replaced to PrintFlex if you want decimals.
I can give you my example cogs if you want.
Hope you get it.


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ The Massassi Temple Message Board ]