Jump to content

How to discover the new state in a texture changed with mapspot (UDMF)


Recommended Posts

Let's say I need to check a floor where the texture was changed, but I don't know which texture it was changed to, as this new texture is in a list of 5 textures, I know the names of the 5... but I don't I know which one, which of the 5 textures that was used to change the floor, if I know which one, then I check which one it is, and a weapon appears on the green floor...

script.png

floor.png

Edited by Knightware Lorewaster

Share this post


Link to post

There is no function that just checks which floor is where and returns the name, CheckActorFloorTexture only checks if it's the one you specified or not. I guess you could try making some kind of switch or if/else, but seems unnecessarily complicated - at least for me :)

Since you already know which texture is the one that spawns the gun, maybe you could use a check like script below, to spawn the gun if and when the texture changes to FWATER1. If it doesn't, it won't spawn anything, and you don't need to know the name of the texture.

script 3 OPEN
{
    if(CheckActorFloorTexture(23, "FWATER1"))
    {
        SpawnSpot ("Shotgun", 23);
        Terminate;
    }
    Delay(1);
    Restart;
}

Share this post


Link to post

Hello my friend, My idea itself I'm trying to figure out a perfect explanation because what I'm doing is very complex... for example... I think of something like I have 2 switches, the 2 have a list with 5 colors... however only one of them uses random colors and knows which color was chosen, and the other one does not know and needs to find out which color was selected, for him to perform the function of showing the weapon... practically he would have to check the 5 colors and if it is possible for him to know what color it is, then he makes the weapon appear... (Practically a different script, knowing what the other changed... checking all the possibilities... Script #2, knowing which texture script #1 changed... without them communicating, just the 2 having the list of textures...)

Edited by Knightware Lorewaster

Share this post


Link to post

I created a mockup that's good for one use, if it was to be used more than once, it would have to be changed again. Basically it uses exclusion to find out the texture, and you need to put the names in. I used 3 to make the example. Maybe someone knows a more elegant solution :)

 

str CheckFloorAfterChange = "";        
script 3 (void)
{
    until(CheckFloorAfterChange != "")
    {
        switch(CheckActorFloorTexture(23, "FWATER1"))
        {
        case 1:
        CheckFloorAfterChange = "FWATER1";
        break;

        case 0:
        break;
        }
        switch(CheckActorFloorTexture(23, "BLOOD1"))
        {
        case 1:
        CheckFloorAfterChange = "BLOOD1";
        break;

        case 0:
        break;
        }
        switch(CheckActorFloorTexture(23, "NUKAGE1"))
        {
        case 1:
        CheckFloorAfterChange = "NUKAGE1";
        break;

        case 0:
        break;
        }
    }
    Print(s:CheckFloorAfterChange);
}

Share this post


Link to post
29 minutes ago, Rifleman said:

I created a mockup that's good for one use, if it was to be used more than once, it would have to be changed again. Basically it uses exclusion to find out the texture, and you need to put the names in. I used 3 to make the example. Maybe someone knows a more elegant solution :)

 

str CheckFloorAfterChange = "";        
script 3 (void)
{
    until(CheckFloorAfterChange != "")
    {
        switch(CheckActorFloorTexture(23, "FWATER1"))
        {
        case 1:
        CheckFloorAfterChange = "FWATER1";
        break;

        case 0:
        break;
        }
        switch(CheckActorFloorTexture(23, "BLOOD1"))
        {
        case 1:
        CheckFloorAfterChange = "BLOOD1";
        break;

        case 0:
        break;
        }
        switch(CheckActorFloorTexture(23, "NUKAGE1"))
        {
        case 1:
        CheckFloorAfterChange = "NUKAGE1";
        break;

        case 0:
        break;
        }
    }
    Print(s:CheckFloorAfterChange);
}

WOW!!! U ARE A GENIUS!!! YEAHH!!! GOD BLESS YOU!!!

 

 

Edited by Knightware Lorewaster

Share this post


Link to post

Whatever it is, I don't see it. I copied it straight from the editor and it works for me. I've attached my version, you can see it there - it's just bastardized version of your map :)

CHECKTEST.zip

Share this post


Link to post

I think adding this line should take care of it:

 

str CheckFloorAfterChange = "";        
script 3 (void)
{

    CheckFloorAfterChange = "";
    until(CheckFloorAfterChange != "")

Share this post


Link to post

This works without:


"CheckFloorAfterChange =" ";


But I need to work with him,
when you put it on, the switches stop.

 

With an "intermediate" = (slime01 / brown) I can do the 3 run...

 

download:  EXAMPLE.rar

 

Not using: ("CheckFloorAfterChange =" ";)

 

Using: ("CheckFloorAfterChange =" ";)

I need it to work with this:  CheckFloorAfterChange = "";

Like this:

ex3.png

Edited by Knightware Lorewaster

Share this post


Link to post
  • 9 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...