Page 1 of 1
Help Please (Multiple Things)
Posted: Thu Aug 15, 2013 2:35 am
by CtrlAltDestory
So, Ive been trying to do a few things but with the limited knowledge I have I really don't think that I can do it. If someone could help me figure out how to do the following I would be grateful:
1. When you look at a Specific Actor it would tell you something in the middle of the screen and it would not fade away until you looked away.
2. A dynamic round system that would slowly spawn monsters to a certain point until it hits monster cap while at the same time dynamically making them stronger each round.
RE: Help Please (Multiple Things)
Posted: Thu Aug 15, 2013 6:46 pm
by Klofkac
The first you can hack with checking angle range looking at that actor. If you were paying attention in maths and physics you can know how to work with vectors. You can use VectorAngle function.
Code: Select all
script 1 (void) //Activator is player, the actor has TID 1
{
while(1) {
int lookangle,vector;
lookangle = GetActorAngle(0);
vector = VectorAngle(GetActorX(1)-GetActorX(0),GetActorY(1)-GetActorY(0));
if(vector-lookangle > -0.1 && vector-lookangle < 0.1)
{
HudMessage(s:"Stop looking at me, I am shy!";HUDMSG_PLAIN0,1,CR_WHITE,0.5,0.5,0.1);
}
delay(1);
}}
Note that walls will obstcure it, so you will probably need distance check.
The second can be achieved by ThingCount, SetActorProperty etc. There are alot of functions, be sure to check ZDoom Wiki.
RE: Help Please (Multiple Things)
Posted: Thu Aug 15, 2013 7:17 pm
by CtrlAltDestory
Klofkac wrote:-snip-
Sadly I was never taught Vectors, I will try and learn it right away.
RE: Help Please (Multiple Things)
Posted: Thu Aug 15, 2013 8:56 pm
by Ænima
RE: Help Please (Multiple Things)
Posted: Fri Aug 16, 2013 11:24 am
by Klofkac
I guess that could work, but...
For weapons and inventory, jumps if the player has a suitable line target under their crosshair.
Doesn't this mean that it activates when player looks at any monster?
Edit, found a function called CheckSight, but I doubt it is ported to zan.
RE: Help Please (Multiple Things)
Posted: Fri Aug 16, 2013 2:31 pm
by Ænima
Klofkac wrote:
I guess that could work, but...
For weapons and inventory, jumps if the player has a suitable line target under their crosshair.
Doesn't this mean that it activates when player looks at any monster?
No, he'll be calling the function on
the monster itself, which will check if the player is looking at it.
RE: Help Please (Multiple Things)
Posted: Fri Aug 16, 2013 2:45 pm
by Klofkac
*sigh* Why does Zan have to be so behnid? CheckSight doesn't compile.
I guess you have to use the DECORATE then...