So, I am trying to make a script that modifies some of the objects in existing maps. It is being done for a reason, and I can not modify the maps at all (they are retail maps).
Anyway, adding an actor is easy - I can simply use Spawn or SpawnForced
However, replacing an existing actor (based on their position) is a lot more difficult.
Currently, I am doing this:
Spawn a dummy object (an empty actor I defined in DECORATE) at the location of the object I want to replace with a custom TID
Call CheckProximity in ACS to get the closest actor to the dummy object (it requires a class, but using the class "actor" and the CPXF_ANCESTOR flag allows it so select any actor of any type), to check anything within 2 map units, which is set to it's TARGET
call Thing_Remove() on the dummy actor's target
Then, spawn the new actor
This works fine in (G)Zdoom. However, Zandronum has an older version of the CheckProximity function, which doesn't allow using "actor".
I am looking for a zandronum compatible way to replace an actor without a tid, in a way which isn't horrible. I really wish there was a "GetActorAt" function, or some equivalent.
There is probably a simpler/more obvious solution to this, but I do not know it.
Question
sarge945
So, I am trying to make a script that modifies some of the objects in existing maps. It is being done for a reason, and I can not modify the maps at all (they are retail maps).
Anyway, adding an actor is easy - I can simply use Spawn or SpawnForced
However, replacing an existing actor (based on their position) is a lot more difficult.
Currently, I am doing this:
Spawn a dummy object (an empty actor I defined in DECORATE) at the location of the object I want to replace with a custom TID
Call CheckProximity in ACS to get the closest actor to the dummy object (it requires a class, but using the class "actor" and the CPXF_ANCESTOR flag allows it so select any actor of any type), to check anything within 2 map units, which is set to it's TARGET
call Thing_Remove() on the dummy actor's target
Then, spawn the new actor
This works fine in (G)Zdoom. However, Zandronum has an older version of the CheckProximity function, which doesn't allow using "actor".
I am looking for a zandronum compatible way to replace an actor without a tid, in a way which isn't horrible. I really wish there was a "GetActorAt" function, or some equivalent.
There is probably a simpler/more obvious solution to this, but I do not know it.
Share this post
Link to post
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.