Check if is GZDoom or Skulltag!

Moderator: Graf Zahl

User avatar
Logan MTM
Posts: 179
Joined: Wed Jan 04, 2006 2:52
Location: Rio de Janeiro - BRAZIL

Check if is GZDoom or Skulltag!

Post by Logan MTM »

Would possible that something check if the wad is runing with GZDoom or Skulltag?

Maybe a ACS function.

If (GetExecutable() == GZDOOM)
{
Print("Isn't Skulltag");
}


I know that this kind of feature need of a cooperative development between Graf and Torr.

This is possible?
So as you read this know my friends I'd love to stay with you all.
Please smile when you think of me. My body's gone that's all...
User avatar
Rachael
Developer
Developer
Posts: 3651
Joined: Sat May 13, 2006 10:30

Re: Check if is GZDoom or Skulltag!

Post by Rachael »

Actually, Randy would need to be involved to, and it's not so much cooperative development so much as reminding child port authors that it would need work in order to work.

So... I think this is more of an "Ask ZDoom"

Actually, I think what would be best for this feature is to simply use inheritance, i.e. if you're using Skulltag, it responds to "GZDoom", "Skulltag", and "ZDoom", whereas if you're only using GZDoom, it would respond to "ZDoom" and "GZDoom" only, etc. And of course, it would have to be called differently for that... if MyPortIsChildOf("GZDoom") for example. That's my opinion.
User avatar
Logan MTM
Posts: 179
Joined: Wed Jan 04, 2006 2:52
Location: Rio de Janeiro - BRAZIL

Re: Check if is GZDoom or Skulltag!

Post by Logan MTM »

Sure! :)
At least you got the point! ^^
So as you read this know my friends I'd love to stay with you all.
Please smile when you think of me. My body's gone that's all...
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Check if is GZDoom or Skulltag!

Post by Gez »

I guess you could try [zwiki]SpawnSpot[/zwiki]ting an FS_MapSpot.

Code: Select all

if (SpawnSpot("FS_MapSpot", 1337))
{
    Print("We're in GZDoom!");
}
else if (SpawnSpot("PointLight", 1337))
{
    Print("We're in Skulltag or maybe Vavoom or something.");
}
else
{
    Print("We're in ZDoom!");
}

This assumes that when SpawnSpot tries to spawn a class that doesn't exist, it fails gracefully and just spawns nothing (which means it returns 0).
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany

Re: Check if is GZDoom or Skulltag!

Post by Graf Zahl »

Wow! That's one crude hack... :mrgreen:

Of course you should not forget to delete such an actor afterward...
Gez wrote: This assumes that when SpawnSpot tries to spawn a class that doesn't exist, it fails gracefully and just spawns nothing (which means it returns 0).

It does.
User avatar
Logan MTM
Posts: 179
Joined: Wed Jan 04, 2006 2:52
Location: Rio de Janeiro - BRAZIL

Re: Check if is GZDoom or Skulltag!

Post by Logan MTM »

I doesn't understood the logic but all right.
So as you read this know my friends I'd love to stay with you all.
Please smile when you think of me. My body's gone that's all...
User avatar
Enjay
Developer
Developer
Posts: 4752
Joined: Tue Aug 30, 2005 23:19
Location: Scotland

Re: Check if is GZDoom or Skulltag!

Post by Enjay »

I think the logic is to use spawnspot to try and spawn an actor that is specific to the various engines and check if the spawn is successful. If it is, you are using that engine. If the spawn is not successful, you are using a different engine.
User avatar
Logan MTM
Posts: 179
Joined: Wed Jan 04, 2006 2:52
Location: Rio de Janeiro - BRAZIL

Re: Check if is GZDoom or Skulltag!

Post by Logan MTM »

Gez wrote:if (SpawnSpot("FS_MapSpot", 1337))
I did not know that such check was possible. Interresting...

Thank you Gez!
So as you read this know my friends I'd love to stay with you all.
Please smile when you think of me. My body's gone that's all...
jengelh
Posts: 41
Joined: Sat Jun 24, 2006 10:21

Re: Check if is GZDoom or Skulltag!

Post by jengelh »

And is going to fall apart once someone defines an FS_Mapspot in his decorate.txt.
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Check if is GZDoom or Skulltag!

Post by Gez »

jengelh wrote:And is going to fall apart once someone defines an FS_Mapspot in his decorate.txt.
Why would they?
jengelh
Posts: 41
Joined: Sat Jun 24, 2006 10:21

Re: Check if is GZDoom or Skulltag!

Post by jengelh »

Jokewads or sheer ignorance. If I remember correctly, Ghoul's Forest also had some sort of — quite annoying — ZDoom-vs-GZdoom (more like software vs GL rendering) test.
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Check if is GZDoom or Skulltag!

Post by Gez »

Well.
1. There's no reason to define custom map spots. There are already enough of them.
2. Doubly so for anything that could be put in an autoload list.
3. If a mod uses this hack and defeats it at the same time, it's its own problem.
User avatar
Rachael
Developer
Developer
Posts: 3651
Joined: Sat May 13, 2006 10:30

Re: Check if is GZDoom or Skulltag!

Post by Rachael »

Nevertheless, I think ZDoom and its child ports, and its neighbors too (Vavoom and whatnot), could benefit from such a function. It's still more likely though that you'll have to try the ZDoom forums to ask that.

Return to “Closed Feature Suggestions”