B-model error ?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

B-model error ?

Post by G3mInI »

I am scripting objectives into the stock maps. Everything is working just fine but I am getting an error in the console complaining about the collision entity being used for the obj (sherman tank).

Here are some excerpts from my script:

Code: Select all

//*********************
// Spawn the collision
//*********************

	level.collide = spawn script_object "targetname" "tank_collision"
	level.collide.origin = ( -1455.36 1776.48 638.50 )
	level.collide setsize ( -148 -64 -40 ) ( 148 64 40 )

//*******************
// Spawn the bomb
//*******************

  level.device = spawn items/pulse_explosive.tik 
  level.device.targetname = sherman_tank1_explosive
  level.device.target = sherman_tank1
  //level.device.exploder_set = 1 //not needed since I am not using any exploderfires or explodersmashes 
  level.device.trigger_name = sherman_tank1_trigger
  level.device.explosion_fx = fx/fx_tank_explosion.tik
  level.device.explosion_sound = explode_tank
  level.device.origin = ( -1451.05 -377.15 -23.76 )
  level.device.angles = ( 0.00 90.00 0.00 )
  level.device.scale = 1.0
I have tried to spawn it as a script_model also and have the same results. I have made obj maps using the collision entity without any problems in the past but these were maps that I made. In the past I would just make a set of brushes that I wanted to use as my collision and then make them into a script_object and give them a targetname. I would then have my obj target that script_object. Works like a charm. But spawning in a collision entity into an existing map is having problems. Here is what the console is reporting...

Code: Select all

Adding autosave names
Spawned Exploder 1
Spawned Exploder 2
Spawned Exploder 3
Spawned Exploder 4
Spawned Exploder 5
Spawned Exploder 6
Spawned Exploder 7
Spawned Exploder 8
Spawned Exploder 9
Spawned Exploder 10
Spawned Exploder 11
Spawned Exploder 12
Spawned Exploder 13
Spawned Exploder 14
20 entities spawned
63 simple entities spawned
0 entities inhibited
-------------------- Spawning Entities Done ------------------ 266 ms
Going from CS_PRIMED to CS_ACTIVE for *Area51*G3mInI_2LT
------ Server Initialization Complete ------  5.13 seconds
soundtrack switched to music/mohdm2.mus.
playing music/mohdm2.mus
music set to normal with fallback normal
Loading Ambient.scr
----------------------Z-----------------------
self = sherman_tank1_explosive
self.target (flak 88 or other) = sherman_tank1
self.target.destroyed_model = vehicles/shermantank_damaged.tik
self.target.target (collision entity) = tank_collision
self.trigger_name = sherman_tank1_trigger
self.exploder_set = NIL
self.explosion_fx = fx/fx_tank_explosion.tik
self.explosion_sound = explode_tank
self.killarea = NIL
----------------------Z-----------------------
	self.target.collisionent = self.target.target (global/obj_dm.scr, 40)
	self.target^

^~^~^ Script Error: Model for Entity not of a valid type. Must be B-Model.

waittill trigger sherman_tank1_trigger
------- S_StopAllSounds (don't stop music) -------
------- S_StopAllSounds Complete-------
Called FadeSound with: 0.000000
Called FadeSound with: 0.000000
*Area51*G3mInI_2LT has entered the battle
SOUNDTRACK: Loading music/mohdm2.mus
I have tried many things but keep getting this B-model error. Even though the script runs into this error the obj works just fine still. Anyone have any ideas on what would make the global/obj_dm.scr happy ?


G3mInI
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Post by G3mInI »

Well upon searching the forums I did come up with this reply from jv_map for someone who had a similar problem....
You can't spawn a good collision ent by script.

Why is this?

G3mInI
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

A collisionent must be a brushmodel, and you can't really spawn brushes via script (they should be in the bsp) :?
Image
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Post by G3mInI »

Thanks for the reply. At least I know what a B-model is now 8-)
And I also now know a little more about the limitations of script spawning. :wink:

G3mInI
Post Reply