Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
zzzornbringer

can't get getactor function to work properly

Recommended Posts

for reference, i try to use this function:

http://zdoom.org/wiki/GetActorX

what i want to do is get the actor position of a monster and spawn fireballs around it. it's not working.

i actually tried to copy&paste the above example but it's not working at all. nothing happens when i trigger the function.

could anyone explain how this works so that even an idiot is able to understand?

Share this post


Link to post

i don't have a script. i pretty much used the example script but put it in a loop so it checks the actor position every 10 tics and changed the actor tid, so it spawns the objects around the monster and not around the player.

Share this post


Link to post
Quineotio said:

post it?

it's under the link i've posted:

script 1 (int count, int dist)
{
    int basex = GetActorX (0);
    int basey = GetActorY (0);
    int angle, n;
 
    for (n = 0; n < count; n++)
    {
        angle = 1.0 * n / count;

        Spawn(
            "DoomImp",
            basex + dist * cos (angle),
            basey + dist * sin (angle),
            GetActorZ (0), 0,
            (angle + 0.5) >> 8
        );
    }
}

Share this post


Link to post

Put the following line at the very top of your entire SCRIPTS lump/window:

#include "zcommon.acs"

Share this post


Link to post
scifista42 said:

Put the following line at the very top of your entire SCRIPTS lump/window:

#include "zcommon.acs"


that much i know. i even got something to spawn next to the actor but it's not circular around the actor.

Share this post


Link to post

What arguments are you calling the script with? The script accepts 2 arguments, "count" and "dist", together influencing the appearance/behavior of the effect, and from the look of it, if "count" was 0, nothing would happen.

Share this post


Link to post

i was using an actor special to execute the script. i actually don't know how i can run a script with arguments.

edit: ok, tried it with some arguments. got the imps spawn inside me. testing some other numbers.

thanks, i think i can go from here.

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  
×