[SOLVED] Interactive Objects problem

For the discussion and creation of tutorials for use with the SDL Version of the Wolfenstein Source

Moderators: ronwolf1705, TheTalentedMrLeo, Schabbs, Andy_Nonymous

User avatar
deloubli
Registered User
Registered User
Posts: 2
Joined: Sun May 26, 2024 4:06 pm

[SOLVED] Interactive Objects problem

Post by deloubli »

sooo i've been implementing this tutorial: viewtopic.php?t=5549&hilit=Using+objects+Usable+objects
when i tried compiling it i had errors about syntax (fixed by adding some brackets) and undeclared "statptr" (fixed by adding statobj_t *statptr; in the beginning of Cmd_Use routine)
it compiles without any errors now, but "spacebarring" my object still does nothing :(

Code: Select all

    for (statptr = &statobjlist[0] ; statptr !=laststatobj ; statptr++)
    {
            if(statptr->tilex == checkx && statptr->tiley == checky && !buttonheld[bt_use])
            {
                buttonheld[bt_use] = true;
                switch (statptr->shapenum)
                        {
                            case bo_cross:
                                GetMessage("Hello world");
                                break;
                        }
            }
    }
also i have made bo_cross a blocking tile and deleted it from GetBonus routine
Last edited by deloubli on Thu May 30, 2024 3:33 pm, edited 1 time in total.
Layla
Registered User
Registered User
Posts: 8
Joined: Fri Jun 16, 2023 10:45 am

Re: [HELP] Interactive Objects problem

Post by Layla »

I think shapenum is actual picture number in the vswap so it would be something like case SPR_STAT_31 instead of case bo_cross but not sure if I counted correctly
User avatar
deloubli
Registered User
Registered User
Posts: 2
Joined: Sun May 26, 2024 4:06 pm

Re: [HELP] Interactive Objects problem

Post by deloubli »

bo_cross is SPR_STAT_29, but yeah you're right, that works perfectly. thank you!