Raised This Month: $51 Target: $400
 12% 

[CSGO] Adding a material/texture to a box


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stece
Junior Member
Join Date: May 2021
Old 03-19-2022 , 05:44   [CSGO] Adding a material/texture to a box
Reply With Quote #1

I've been able to spawn a trigger_multiple box in my map using sourcemod.

PHP Code:
  //Create entity
  
int triggerbox CreateEntityByName("trigger_multiple");
  
DispatchKeyValue(triggerbox"spawnflags""1");
  
SetEntityModel(triggerboxMODEL_DEFAULT); // I don't understand why we need a model, but without it doesn't work

  
TeleportEntity(triggerboxposNULL_VECTORNULL_VECTOR);
  
DispatchSpawn(triggerbox);
  
  
float fMins[3];
  
float fMaxs[3];

  
fMins[0] = -64.0 4.0;
  
fMins[1] = -64.0 4.0;
  
fMins[2] = -64.0 4.0;
  
fMaxs[0] = 64.0 8.0;
  
fMaxs[1] = 64.0 8.0;
  
fMaxs[2] = 64.0 8.0;
  
SetEntPropVector(triggerboxProp_Send"m_vecMaxs"fMaxs);
  
SetEntPropVector(triggerboxProp_Send"m_vecMins"fMins);

  
SetEntProp(triggerboxProp_Send"m_nSolidType"2);

  new 
enteffects GetEntProp(triggerboxProp_Send"m_fEffects");
  
enteffects |= 32;
  
SetEntProp(triggerboxProp_Send"m_fEffects"enteffects);

  
HookSingleEntityOutput(triggerbox"OnStartTouch"EntOut_OnStartTouch); 

Now I would like to add a material/texture to the box. So that when I run the console command "showtriggers_toggle" I can clearly see the boundaries of the trigger box. Also in the future, I might want to add just solid boxes with a specific material/texture.


SCREENSHOT
On the screenshot, the red arrow shows a trigger box that was already default inside the map. The green arrow points to a trigger box I know is there because the onStartTouch triggers correctly. I just can't see it as it doesn't have the correct material (or at least I assume that's the reason).

Last edited by stece; 03-19-2022 at 05:50.
stece is offline
EMINEM_FB
Senior Member
Join Date: Dec 2010
Location: Czech republic
Old 03-20-2022 , 03:12   Re: [CSGO] Adding a material/texture to a box
Reply With Quote #2

Hello,

Maybe custom models will be easier?



__________________
EMINEM_FB is offline
stece
Junior Member
Join Date: May 2021
Old 03-21-2022 , 04:00   Re: [CSGO] Adding a material/texture to a box
Reply With Quote #3

Quote:
Originally Posted by EMINEM_FB View Post
Hello,

Maybe custom models will be easier?

Hey Thanks for your reply!
I'm in the assumption that you can't use these custom models if they are not inside the BSP, is that correct? I'm working with the official maps and adding some extra mechanics, so that wouldn't be an option for me.

Last edited by stece; 03-21-2022 at 04:00.
stece is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:20.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode