Page 1 of 1

[Help]Assigning Textures via Code

Posted: Fri Feb 14, 2014 4:28 pm
by D-9999
Hello. I am attempting to assign textures to a model via the Source Code, but I can't seem to do it correctly and I get an error message

Code: Select all

"Expecting identifier. File: c:\users\REDACTED\documents\REDACTED\scp - containment breach\source code\npcs.bb Line: 190, Column: 10"
This is the code for SCP-096 that I'm using.(Some parts are unaltered.)
v

Code: Select all

		Case NPCtype096
			n\Collider = CreatePivot()
			EntityRadius n\Collider, 0.25
			EntityType n\Collider, HIT_PLAYER
			n\obj = LoadAnimMesh("GFX\npcs\scp096.b3d")
			Local 096tex = LoadTexture("GFX\npcs\character_infected.jpg")
			EntityTexture n\obj, 096tex
			
			MeshCullBox (n\obj, -MeshWidth(n\obj)*2, -MeshHeight(n\obj)*2, -MeshDepth(n\obj)*2, MeshWidth(n\obj)*2, MeshHeight(n\obj)*4, MeshDepth(n\obj)*4)
			
			n\Speed = (GetINIFloat("DATA\NPCs.ini", "SCP-096", "speed") / 100.0)
			
			temp# = (GetINIFloat("DATA\NPCs.ini", "SCP-096", "scale") / 3.0)
			ScaleEntity n\obj, temp, temp, temp	

Re: [Help]Assigning Textures via Code

Posted: Fri Feb 14, 2014 4:48 pm
by juanjp600
You're starting a variable name with a number.

Re: [Help]Assigning Textures via Code

Posted: Fri Feb 14, 2014 7:01 pm
by CLgaming
Usually, if the code doesn't assign a texture already, I just go into fragmotion and apply a material over the entire model used face selection, to which I can apply a texture to the model and vwala. That's my fast way of doing it.