FALSE = objekt wird nur kaputt gemacht
warum? geht der befehl nicht:FritzHugo3 wrote:Transporter + Debris = keine Kaputten Schiffe mehr. Da das Schiff die nun nicht mehr persönlich einsammelt, sondern direkt in den Frachtraum "gebeamt" werden, müssen die Debris mit destruct zerstört werden.
Code: Select all
$gesammelte.menge = [THIS] -> catch ware object $truemmer
das vanilla-script sieht so aus:
Code: Select all
Script !move.collectrocks
Version: 1
for Script Engine Version: 43
Description
Let ship collect debris flying around in an active sector
Arguments
1: wareobj , Value , 'GALOBJ of debris'
Source Text
001 @ = wait randomly from 100 to 200 ms
002 skip if $wareobj -> exists
003 |return null
004 skip if $wareobj -> is of class Debris
005 |return null
006
007 * check if debris mineral typ is loadable
008
009 $ware = $wareobj -> get resource waretype of asteroid
010
011 skip if [THIS] -> can transport ware $ware
012 |return null
013 $free = [THIS] -> get free amount of ware $ware in cargo bay
014 skip if $free
015 |return null
016
017 * mining hack to speed up the process
018 if not [THIS] -> is in active sector
019 |$mineral.yield = $wareobj -> get asteroid yield
020 |$unit.amount = $wareobj -> get debris count
021 |skip if $unit.amount
022 ||inc $unit.amount =
023 |$sector = $wareobj -> get sector
024 |$x = $wareobj -> get x position
025 |$y = $wareobj -> get y position
026 |$z = $wareobj -> get z position
027 @ |= [THIS] -> call script '!move.movetoposition' : sector=$sector position x=$x position y=$y position z=$z precision=2500
028 |if not [THIS] -> is in active sector
029 ||while $mineral.yield > 0
030 |||dec $mineral.yield =
031 |||$ret = = random value from 25000 to 35000 - 1
032 @ |||= [THIS] -> move around $ret ms
033 @ |||= [THIS] -> move to position: x=$x y=$y z=$z with precision 1500 m
034 @ |||= wait 130 ms
035 |||skip if [THIS] -> get free amount of ware $ware in cargo bay
036 ||||break
037 |||skip if not [THIS] -> is in active sector
038 ||||break
039 |||= [THIS] -> add $unit.amount units of $ware
040 ||end
041 |end
042 |return null
043 end
044
045 * normal collecting routine
046 while 1
047 |skip if $wareobj -> exists
048 ||return null
049 |
050 |skip if $wareobj -> has collectible rocks
051 ||return null
052 |
053 |$sector = $wareobj -> get sector
054 |if $sector != [ENVIRONMENT]
055 @ ||= [THIS] -> call script '!move.movetosector' : sector=$sector
056 @ ||= wait randomly from 250 to 500 ms
057 ||continue
058 |end
059 |if $ret == FLRET_FIREFREE
060 ||if $wareobj -> has collectible rocks
061 |||$catchedamount = [THIS] -> catch ware object $wareobj
062 |||return $catchedamount
063 ||end
064 ||$ret = FLRET_TIMEOUT
065 @ ||= wait randomly from 100 to 200 ms
066 ||continue
067 |end
068 |
069 @ |$ret = [THIS] -> move to ware object $wareobj for collecting: timeout=60000 ms
070 |if $ret != FLRET_FIREFREE
071 ||skip if $ret == FLRET_INTERRUPTED OR $ret == FLRET_TIMEOUT
072 |||return null
073 @ ||= wait randomly from 100 to 200 ms
074 |end
075 end
076 return null