Hello,
i got stuck in a type problem. It would be great if somebody can help.
Description:
I create some NPC's (Bot's) and some of the NPC's get a Type called Effect assigned during Gameplay.
But i'm not sure if i did it correctly. The type Effect is an child of the type NPC. And there can be more than one Effect types for a NPC.
I think this part should be ok ! Some lines are ommited ...
Type NPC
Field entity
Field model
...
Field his_effect.Effect
End Type
Type Effect
Field entity
Field model
...
End Type
...
Function CreateBot()
this.NPC = New NPC
this\model = CopyEntity(..
...
End Function
Function CreateEffect(this.NPC)
If this<>Null
For i = 1 To 6
this.NPC\his_effect.Effect = New Effect
this.NPC\his_effect\entity = CopyEntity(sprite)
...
Next
End If
End Function
And here is where i got stuck.
Function UpdateNPC()
For this.NPC = Each NPC
If this\his_effect <> Null
ScaleSprite this\his_effect\entity,0.1,0.1
TurnEntity this\his_effect\entity2,90,0,0
...
Next
Next
End Function
With this method i can just iterating through the first type Effect in type NPC but not though all, so:
- How can i iterate though all of them.
I tried also this\his_effect = After this\his_effect but this goes to the next NPC handle.
best rgds
Karel
i got stuck in a type problem. It would be great if somebody can help.
Description:
I create some NPC's (Bot's) and some of the NPC's get a Type called Effect assigned during Gameplay.
But i'm not sure if i did it correctly. The type Effect is an child of the type NPC. And there can be more than one Effect types for a NPC.
I think this part should be ok ! Some lines are ommited ...
Type NPC
Field entity
Field model
...
Field his_effect.Effect
End Type
Type Effect
Field entity
Field model
...
End Type
...
Function CreateBot()
this.NPC = New NPC
this\model = CopyEntity(..
...
End Function
Function CreateEffect(this.NPC)
If this<>Null
For i = 1 To 6
this.NPC\his_effect.Effect = New Effect
this.NPC\his_effect\entity = CopyEntity(sprite)
...
Next
End If
End Function
And here is where i got stuck.
Function UpdateNPC()
For this.NPC = Each NPC
If this\his_effect <> Null
ScaleSprite this\his_effect\entity,0.1,0.1
TurnEntity this\his_effect\entity2,90,0,0
...
Next
Next
End Function
With this method i can just iterating through the first type Effect in type NPC but not though all, so:
- How can i iterate though all of them.
I tried also this\his_effect = After this\his_effect but this goes to the next NPC handle.
best rgds
Karel