Spawn gadjet help neaded(fixed)

Spawn gadjet help neaded(fixed)

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
scifi
Posts: 848
Joined: 10 May 2009, 12:27

Spawn gadjet help neaded(fixed)

Post by scifi »

ok im converting an old mod remake i did 3 years ago(or at least trying to)

im not sure as what the problem is but i think its the fact that the mod doesnt even recognise gadjets, and just trows up a problem about unsafe changes.

log

Code: Select all

[      0] Using mod FF 1.04
[      0] Sound: OpenAL info:
[      0] Sound:   Vendor:     OpenAL Community
[      0] Sound:   Version:    1.1 ALSOFT 1.11.753
[      0] Sound:   Renderer:   OpenAL Soft
[      0] Sound:   AL Extensions: AL_EXTX_buffer_sub_data AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_OFFSET AL_EXTX_sample_buffer_object AL_EXT_source_distance_model AL_LOKI_quadriphonic
[      0] Sound:   ALC Extensions: ALC_ENUMERATE_ALL_EXT ALC_ENUMERATION_EXT ALC_EXT_CAPTURE ALC_EXT_disconnect ALC_EXT_EFX ALC_EXTX_thread_local_context
[      0] Sound:                   ALC_EXT_EFX found (required for air absorption): yes
[      0] Sound:   Device:     DirectSound Software
[      0] Sound:   Available Devices:  
[      0] Sound:                       DirectSound Software
[      0] Sound: air absorption enabled: 0.1
[      0] Using mod archive FF.sdd
[      0] Loading client data: 703 ms
[      0] User number 0 (team 0, allyteam 0)
[      0] Sound:  parsed 4 sounds from gamedata/sounds.lua
[      0] Loading sounds: 1 ms
[      0] Camera and mouse: 194 ms
[      0] Parsing unit icons
[      0] Loading GameData Definitions
[      0] Loading all definitions:  0.199000
[      0] Loading GameData Definitions: 214 ms
[      0] Parsing Map Information
[      0] Loading SMF
[      0] Loading Map
[      0] Calculating smooth height mesh
[      0] Calculating smooth mesh: 180 ms
[      0] Number of damage types: 13
[      0] Creating unit textures
[      0] Loading weapon definitions
[      0] Sound: WAV file sounds/300mw.wav has data length 1919181172 greater than actual data length 29286
[      0] Sound: WAV file sounds/boom3.wav has data length -1385668236 greater than actual data length 109930
[      0] Sound: WAV file sounds/400mw.wav has data length -1666686604 greater than actual data length 40106
[      0] Sound: WAV file sounds/600MW.wav has data length -1529847436 greater than actual data length 42194
[      0] Sound: WAV file sounds/arrfire.wav has data length 1252024692 greater than actual data length 215714
[      0] Sound: WAV file sounds/thunder_clap.wav has data length 1113874804 greater than actual data length 148070
[      0] Sound: WAV file sounds/ioncann.wav has data length -1563926156 greater than actual data length 41674
[      0] Sound: WAV file sounds/packohit.wav has data length -1519099532 greater than actual data length 42358
[      0] Sound: WAV file sounds/lstart.wav has data length 1495556468 greater than actual data length 22822
[      0] Sound: WAV file sounds/xplosml5.wav has data length -729259660 greater than actual data length 54410
[      0] Sound: WAV file sounds/pulsegun2.wav has data length -1896324748 greater than actual data length 36602
[      0] Sound: WAV file sounds/hit-metal-1.wav has data length -1237294732 greater than actual data length 46658
[      0] Sound: WAV file sounds/laser400.wav has data length -255041164 greater than actual data length 61646
[      0] Sound: WAV file sounds/railgun.wav has data length 102523252 greater than actual data length 132638
[      0] Sound: WAV file sounds/bang2.wav has data length -935829132 greater than actual data length 116794
[      0] Sound: WAV file sounds/DevastatorRocket.wav has data length 2024300916 greater than actual data length 161962
[      0] Sound: WAV file sounds/DevastatorRocket_hit.wav has data length 1303404916 greater than actual data length 282034
[      0] Sound: WAV file sounds/ionfire.wav has data length -474979980 greater than actual data length 58290
[      0] Sound: WAV file sounds/EMPfire.wav has data length -1138728588 greater than actual data length 48162
[      0] Sound: WAV file sounds/bombclose.wav has data length -955489932 greater than actual data length 116494
[      0] Sound: WAV file sounds/nrg.wav has data length -100376204 greater than actual data length 64006
[      0] Sound: WAV file sounds/longbow.wav has data length 824205684 greater than actual data length 143650
[      0] Sound: WAV file sounds/Flak.wav has data length 2091934068 greater than actual data length 97458
[      0] Sound: WAV file sounds/Flak_hit.wav has data length -1950064268 greater than actual data length 35782
[      0] Sound: WAV file sounds/fusion.wav has data length -646422156 greater than actual data length 121210
[      0] Sound: WAV file sounds/pulse3.wav has data length -2082709132 greater than actual data length 33758
[      0] Sound: WAV file sounds/ktorp.wav has data length 1378115956 greater than actual data length 86566
[      0] Sound: WAV file sounds/xplomed8.wav has data length -2046008972 greater than actual data length 99854
[      0] Sound: WAV file sounds/photon.wav has data length -1338482316 greater than actual data length 110650
[      0] Sound: WAV file sounds/laser200.wav has data length -318480012 greater than actual data length 60678
[      0] Sound: WAV file sounds/explosionsmall.wav has data length 291939 greater than actual data length 114066
[      0] Sound: SoundBuffer::AlGenBuffer: Invalid Value
[      0] Sound: Loading audio failed for sounds/explosionbig.wav
[      0] Sound: WAV file sounds/300MW.wav has data length 1919181172 greater than actual data length 29286
[      0] Sound: WAV file sounds/gatling-2.wav has data length 355230068 greater than actual data length 70958
[      0] Sound: WAV file sounds/hit-metal-2.wav has data length -1237294732 greater than actual data length 46658
[      0] Sound: WAV file sounds/gatling-1.wav has data length 502554996 greater than actual data length 73206
[      0] Sound: WAV file sounds/accel.wav has data length 256139636 greater than actual data length 134982
[      0] Could not load sound from def: lasbladehit
[      0] Could not load sound from def: lasbladehit
[      0] Sound: WAV file sounds/explodenew.wav has data length 725901684 greater than actual data length 469830
[      0] Sound: WAV file sounds/laser.wav has data length 801923444 greater than actual data length 77774
[      0] Sound: WAV file sounds/pulse.wav has data length -1272684172 greater than actual data length 46118
[      0] Sound: WAV file sounds/explodemedium.wav has data length 291939 greater than actual data length 149726
[      0] Sound: WAV file sounds/ac2.wav has data length -1567071884 greater than actual data length 41626
[      0] Loading unit definitions
[      0] Sound: WAV file sounds/biggo.wav has data length 566255988 greater than actual data length 205250
[      0] Sound: WAV file sounds/bigsel.wav has data length -1855430284 greater than actual data length 102762
[      0] Sound: WAV file sounds/bigstop.wav has data length -1415552652 greater than actual data length 109474
[      0] Sound: WAV file sounds/furygo.wav has data length -1675337356 greater than actual data length 105510
[      0] Sound: WAV file sounds/furysel.wav has data length -1646239372 greater than actual data length 171490
[      0] Sound: WAV file sounds/minbaristop.wav has data length 890265972 greater than actual data length 79122
[      0] Sound: WAV file sounds/armshipgo.wav has data length -105619084 greater than actual data length 194998
[      0] Sound: WAV file sounds/armselect.wav has data length -690200204 greater than actual data length 120542
[      0] Sound: WAV file sounds/armshipstop.wav has data length 416309620 greater than actual data length 202962
[      0] Sound: WAV file sounds/shipgo.wav has data length 1791517044 greater than actual data length 223946
[      0] Sound: WAV file sounds/shipstop1.wav has data length -365141644 greater than actual data length 191038
[      0] Sound: WAV file sounds/armplant1.wav has data length -1763679884 greater than actual data length 235234
[      0] Sound: WAV file sounds/hoverok1.wav has data length -810786444 greater than actual data length 184238
[      0] Sound: WAV file sounds/odsgo.wav has data length -1837080204 greater than actual data length 37506
[      0] Sound: WAV file sounds/odssel.wav has data length 1326473588 greater than actual data length 20242
[      0] Sound: WAV file sounds/falcongo.wav has data length -156212876 greater than actual data length 194226
[      0] Sound: WAV file sounds/falconstop.wav has data length -2075631244 greater than actual data length 230474
[      0] Sound: WAV file sounds/station.wav has data length -75734668 greater than actual data length 129918
[      0] Sound: WAV file sounds/ionsel.wav has data length -405249676 greater than actual data length 59354
[      0] Sound: WAV file sounds/hoversl1.wav has data length -1602461324 greater than actual data length 106622
[      0] Sound: WAV file sounds/ftlgo.wav has data length -1134272140 greater than actual data length 244838
[      0] Sound: WAV file sounds/ftlsel.wav has data length 986472820 greater than actual data length 146126
[      0] Sound: WAV file sounds/delstop.wav has data length -375627404 greater than actual data length 125342
[      0] Sound: WAV file sounds/corplant1.wav has data length -1464311436 greater than actual data length 174266
[      0] Sound: WAV file sounds/hoversl2.wav has data length -1006083724 greater than actual data length 115722
[      0] Sound: WAV file sounds/hoverok2.wav has data length 1944609140 greater than actual data length 160746
[      0] Loading feature definitions
[      0] Initializing map features
[      0] Reading estimate path costs
[      0] [CPathManager] pathing data checksum: e4c4739b
[      0] You are missing the "ARB_shadow_ambient" extension (this will probably make shadows darker than they should be)
[      0] Loading .smt tile-file "maps/Tumult.smt"
[      0] Loading 50176 tiles from file 1/1
[      0] Reading tiles
[      0] Reading tile map
[      0] generating MipMaps: 8 ms
[      0] Generating 3D trees
[      0] Creating Projectile Textures
[      0] Creating sky
[      0] Loading console: 9 ms
[      0] Sound: Unable to open audio file: FailedCommand
[      0] Sound: CSound::GetSoundId: could not find sound: FailedCommand
[      0] Loading LuaRules
[      0] Lua LoadCode pcall error = 2, LuaRules/main.lua, [string "LuaRules/main.lua"]:1: attempt to call global 'AllowUnsafeChanges' (a nil value)
[      0] Loading LuaGaia
[      0] Loading LuaUI
[      0] Using LUAUI_DIRNAME = LuaUI/
[      0] Reloaded ctrlpanel with: LuaUI/ctrlpanel.txt
[      0] LuaUI: bound F11 to the widget selector
[      0] LuaUI: bound CTRL+F11 to tweak mode
[      0] Loaded widget from mod:   DGunLimit           <gui_limit_dgun.lua>
[      0] Loaded widget from user:  Build costs 1.02    <gui_build_costs.lua>
[      0] Loaded widget from mod:   IdleBuildersNEW     <gui_idle_builders_new.lua>
[      0] Loaded widget from user:  SmartNanos          <unit_smart_nanos.lua>
[      0] Loaded widget from user:  Z Selector          <unit_z_selector.lua>
[      0] Loaded widget from user:  MiniMap Start Boxes  <minimap_startbox.lua>
[      0] Loaded widget from mod:   Start Point Remover  <init_start_point_remover.lua>
[      0] Reloaded cmdcolors with: cmdcolors.tmp
[      0] Loaded widget from user:  Unit-Circles 0.5.1  <unit_circle_0.5.2.lua>
[      0] Loaded widget from user:  Bomber control      <unit_bomber_control.lua>
[      0] Loaded widget from mod:   Select n Center!    <gui_center_n_select.lua>
[      0] Loaded widget from user:  Mouse Buildspacing  <gui_buildspacing.lua>
[      0] LuaUI v0.3
[      0] Finalizing...
[      0] Connection attempt from [Ar]Scifi
[      0]  -> Version: 0.82.3.0 (0.82.3)
[      0]  -> Connection established (given id 0)
[      0] Player [Ar]Scifi finished loading and is now ingame
[      0] [Ar]Scifi added point: Start 0
[      0] [Ar]Scifi added point: Start 0
[      0] GameID: 18bf7b4c58fc38783d2dbf8a1cdf4421
[      0] [Ar]Scifi added point: Start 0
[      1] false
[      1] Error in Update(): [string "LuaUI/Widgets/gui_center_n_select.lua"]:39: Bad unitID parameter in GetUnitPosition()
[      1] Removed widget: Select n Center!
[     91] Game has ended
[    148] User exited
[    148] Path cache hits 0 0%
[    148] Path cache hits 0 0%
[    148] Statistics for local connection:
Received: 946 bytes
Sent: 1601 bytes
i can point out

[ 1] Error in Update(): [string "LuaUI/Widgets/gui_center_n_select.lua"]:39: Bad unitID parameter in GetUnitPosition()

and

[ 0] Lua LoadCode pcall error = 2, LuaRules/main.lua, [string "LuaRules/main.lua"]:1: attempt to call global 'AllowUnsafeChanges' (a nil value)

I dont use unsafe changes, the gadjets i have are only morph related plus the new spawn gadjet.

I cant say for sure whats wrong, just that when i enter the game units arent spawned. Ive tryed loking in other mod folders that used the old modinfo.tdf and sidedata spawn infos e.t.c... XTA and BA, cant seam to find any problem with my files, i just think that maybe theres some corrupt file in luarules folder, due to the age of the mod.
Last edited by scifi on 30 Aug 2010, 20:46, edited 1 time in total.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Spawn gadjet help neaded

Post by zwzsg »

[ 0] Lua LoadCode pcall error = 2, LuaRules/main.lua, [string "LuaRules/main.lua"]:1: attempt to call global 'AllowUnsafeChanges' (a nil value)
  • Open the file: LuaRules/main.lua
  • Remove the line: AllowUnsafeChanges("USE AT YOUR OWN PERIL")
  • PROFIT!!
User avatar
scifi
Posts: 848
Joined: 10 May 2009, 12:27

Re: Spawn gadjet help neaded

Post by scifi »

done that start unit doesnt apear
in fact none of the gadgets seam to work
:wink:
any more sugestions?

this error line does indeed disapear

Code: Select all

[ 0] Lua LoadCode pcall error = 2, LuaRules/main.lua, [string "LuaRules/main.lua"]:1: attempt to call global 'AllowUnsafeChanges' (a nil value)
but the spawn gadget problem persists
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Spawn gadjet help neaded

Post by FLOZi »

Pastebin the spawn gadget you're using and sidedata?
User avatar
scifi
Posts: 848
Joined: 10 May 2009, 12:27

Re: Spawn gadjet help neaded

Post by scifi »

zwzsg helped me and its fixed, problem was in draw.lua and main.lua both of them had tprint and print commands.

By eliminating some strings and just adding VFS.Include("LuaGadgets/gadgets.lua")
its fixed
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Spawn gadjet help neaded(fixed)

Post by zwzsg »

Inside a function(...), how does one get the arguments? arg seem to be nil.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: Spawn gadjet help neaded(fixed)

Post by trepan »

local arg = { ... } -- do not trust #arg if nils are present
local a2, a3, a4 = select(2, ...)
local argCount = select('#', ...)

http://www.lua.org/manual/5.1/manual.html#2.5.9
http://www.lua.org/manual/5.1/manual.html#pdf-select
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Spawn gadjet help neaded(fixed)

Post by zwzsg »

Thanks!
Post Reply

Return to “Lua Scripts”