I have a Function within a UserType that needs to modify a Global outside the UserType. When I try my code I get the error "Compile Error: Operator ''-'' can not be used with strings".
The variable I'm trying to modify is Energy:Float at the top.
I've been lost since BlitzWiki's been offline. What are the possible solutions?
The variable I'm trying to modify is Energy:Float at the top.
I've been lost since BlitzWiki's been offline. What are the possible solutions?
Global Energy:Float 'Player Energy 'Projectile Type Projectile Field Node:ISceneNode 'Projectile SceneNode Field Style:Int 'Style ID of Projectile Field Lifetime:Int 'Elapsed LifeTime of Projectile Field State:Int 'State of Projectile Global Count:TList = CreateList() 'List of Projectiles Global Info:String[][] 'Projectile Table 'Use Function Use:Projectile( StyleID:Int ) Local P:Projectile = New Projectile 'New Instance of Projectile Local ProjectileMesh:IAnimatedMesh = Scene.getMesh( "Media/" + Projectile.Info[0][StyleID] + ".ms3d" ) 'Projectile Mesh 'Check Projectile Mesh If( ProjectileMesh >< Null And ProjectileMesh.isValid() = True ) P.Node = Scene.addMeshSceneNode( ProjectileMesh.getMesh( 0 ), Null, Null, PlayerNode.getAbsolutePosition(), PlayerNode.GetRotation()) 'Projectile Mesh Invalid Else 'Display Error Message End End If 'Check Projectile Node If( P.Node.isValid() = True ) P.Style = StyleID 'Set Style ID P.Lifetime = 0 'Set Initial LifeTime P.State = Null 'Set Initial State Ammo[0][Ammo[1][0]] :- 1 'Subtract Ammo Energy :- Projectile.Info[1][StyleID] 'Subtract Energy ActionTimer[Ammo[1][0]] = 1000 'Set Reload 'Subtract Accuracy * Accuracy Radius AlphaIndication[0] = 100 'Apply Ammo Indicator 'Insert Projectile ListAddLast Projectile.Count, P 'Projectile Node Invalid Else 'Display Error Message End End If Return P End Function End Type