Created VScript : VScriptProxy (markdown)

Blixibon 2020-06-01 09:55:57 -05:00
parent ff0ede4b3f
commit a81195e9e4

57
VScript-:-VScriptProxy.md Normal file

@ -0,0 +1,57 @@
Mapbase introduces a material proxy which allows mappers to manipulate material variables from within a script file.
```squirrel
function OnBind()
{
local scale = self.GetVarFloat(1)
if (entity != null)
{
printl("VScriptPoxy: Entity " + entity.GetClassname() + ", " + entity.GetName())
}
printl("VScriptProxy: Scale is " + scale)
scale += 0.0005
if (scale >= 2.0)
{
scale = 1.0
}
self.SetVarFloat(1, scale)
}
```
```
"Proxies"
{
"VScriptProxy"
{
scriptfile "test_matproxy_2"
var0 "$baseCenter"
var1 "$baseScale"
var2 "$baseRotate"
var3 "$baseTranslate"
}
"TextureTransform"
{
centerVar "$baseCenter"
scaleVar "$baseScale"
rotateVar "$baseRotate"
translateVar "$baseTranslate"
resultVar "$basetexturetransform"
}
}
```
<p align="left">
<img src="https://cdn.discordapp.com/attachments/548984482578038784/715441795315662948/SPOILER_mapbase_demo010008.jpg" width="512"/>
</p>
---
| Signature | Description |
|:------------- | :-----|
| *bool* DidHitWorld()| Returns whether the trace hit the world entity or not. |