where are you telling blitz that smokespeed=0.5
Those things you assign in custom need To be parsed by you into whatever variable is in your game.
For example, using the code above, you would simply use the same technique as used for loading all the other data into the arrays.
eg:
Function Parse_Custom_Inits(key$,file)
;here is where you can put any condition you would like to be checked from the init script in ted.
If Instr(key$,"[CUSTOM]")
Repeat
lines$=ReadLine(file)
DebugLog lines
If lines<>"" And lines<>"[/CUSTOM]"
cmd$=Lower(misc_usv(lines,1,"="))
values$=misc_usv(lines,2,"=")
;Custom conditions can go here-------------------------------------------------------
;for example:
If cmd="type"
;for each type do something like this:
If value="smoker"
;assuming you have a datastructure/array for this kind of object:
s.smoker=New smoker
;because we now know it is a smoke Object we can now extract the Data:
Repeat
scriptnext$=ReadLine(file)
If Lower(misc_usv(scriptnext,1,"="))="smokespeed" s.smokespeed# = misc_usv(scriptnext,2,"=")
If Lower(misc_usv(scriptnext,1,"="))="smokealpha" s.smokealpha# = misc_usv(scriptnext,2,"=")
;etc....
Until Lower(scriptnext)="endtype" ;<-use whatever you like to terminate your type
EndIf
filename$=misc_usv(values$,1,"=") ;first comma sep value could be filename to load sound
volume=Float(misc_usv(values$,2,"=")); second could be volume, third could be... etc
EndIf
;------------------------------------------------------------------------------------
EndIf
If Eof(file) misc_error(1,"ERROR IN CUSTOM")
Until Instr(lines,"[/CUSTOM]")
EndIf
End Function
When doing it like this (ie using your own daya arrays/structures instead of ted's, its also a good idea to save the instance's handle to the data structure as well so its nicely contained in your own system.
-----------------
Alternatively you can just add your own arrays to the ted style ones for use within the system eg.
INS_type() <- could contain a simple type constant or string to identify it
INS_ScriptCommands(0,10) <- saves the 10 lines of script so you can access it easily.
You would fill these in the same way as above and as all the other arrays get their data. This is preferable for dynamic style objects as you can then process the data in realtime rather than at loadtime.
(but dont forget to add them to the object removal code, so they get freed when an instance gets deleted!)
-------------------------------------------
PS:
dont be confounded by that weird looking USV function, it is simply userdefined-separated-values. It is a little function i whipped up to split a string by a number and a separator. EG:
USV("Hi-my-name-is-dan", "-", 3)
would return the third item, "name". Its a very useful little routine :)