.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > SDK Programming discussions > Half-Life 1 SDK
Half-Life 1 SDK For developments focused around Half-Life (and its mods) Half-Life

Reply
 
Thread Tools
Having a problem creating a entity...
Old
  (#1)
EclipseX
Guest
 
Status:
Posts: n/a
Default Having a problem creating a entity... - 25-01-2004

I know this probably ain't the place to ask this question, but when I try to spawn a new entity using a model I precahed before hand... seems to crash the server..


PHP Code:
 In DispatchSpawn:
   const 
char *pClassName STRING(pent->v.classname);
   
DWORD pCrc32 CRC32::Generate((BYTE *)pClassNameutils::mstrlen(pClassName));
   if (
pCrc32 == 0x13EF7D28)
   {
     
// "worldspawn"
     // Do all our level initialization shit here...
 
     // Precache the models & sounds...
     
PreCacheModel("models/crystal.mdl");
 
     
// Initialize the string-name...
     
locator::markerName AllocString("item_locmarker");
   }
 
 
In Locator::AddMarker:
   
// Create the entity... 
   
locs[s].ent CreateNamedEntity(markerName);
 
   
// Give the entity a model...
   
SetModel(locs[s].ent"models/crystal.mdl");
 
  
// Set the model size...
  
SetSize(locs[s].entvec3_t(-1, -1, -1), vec3_t(1,1,1));
 
  
// Set the model origin...
  
SetOrigin(locs[s].ent, (float *)&locs[s].origin);
 
  
// Spawn the entity...
  
Spawn(locs[s].ent); 
Upon adding a marker the server crashes... (swds.dll: 0656D166 89B8 34010000 MOV DWORD PTR DS:[EAX+134],EDI)
  
Reply With Quote
Re: Having a problem creating a entity...
Old
  (#2)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Having a problem creating a entity... - 25-01-2004

Is there an exported class for "item_locmarker" entities in your game DLL ? You can only add entities that are supported by the game DLL, not create new ones on the go.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Having a problem creating a entity...
Old
  (#3)
EclipseX
Guest
 
Status:
Posts: n/a
Default Re: Having a problem creating a entity... - 26-01-2004

doh! I completely forgot all about that thx for reminding me PM, how o_O I seem to be now LOL..
  
Reply With Quote
Re: Having a problem creating a entity...
Old
  (#4)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: Having a problem creating a entity... - 26-01-2004

"You can only add entities that are supported by the game DLL, not create new ones on the go."

Well..., not if you add hooks to your plugin to handle these new entities.

Take a look at my Monster plugin for metamod as an example of adding new entities to a MOD that doesn't normally support them. It's pretty complicated to get working properly and it has some limitations interacting with the game DLL code, but it can be done if you know what you are doing.

botman
  
Reply With Quote
Re: Having a problem creating a entity...
Old
  (#5)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Having a problem creating a entity... - 26-01-2004

heck, I am once again given lessons by the Jedi Master... thanks for correcting, botman



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com