Nameless Voice on 29/6/2011 at 14:32
Quote Posted by LarryG
I missed unsetting game_mode_backup
You do realise that you can set game_mode_backup 0 while in game mode, right? That's very useful.
LarryG on 29/6/2011 at 14:40
Quote Posted by Nameless Voice
You do realise that you can set game_mode_backup 0 while in game mode, right? That's very useful.
Yes. That's what I was doing, but I miss-typed, and didn't find out until I had left game mode.
edit: did it again and again missed. Looked up the command and saw it is
set game_mode_backup 0
LarryG on 29/6/2011 at 15:29
Ta da!! I got there before the 2nd FireShadow spawned, so I know which one was 1st! And as was guessed, the Firer link is missing from the 1st one.
1st FireShadow
[ATTACH]941[/ATTACH]
2nd FireShadow
[ATTACH]940[/ATTACH]
darthsLair on 1/7/2011 at 15:58
Telliamed, Would it be a great deal of work to write a "Smelter Script" Similar to the T1 version? S&R's are fine to an extent, but having a nice Smelter set up in T2 is difficult without a cool script.
Just a thought !:cool:
darthsLair on 1/7/2011 at 22:33
Cool ! Thankyou Telliamed !
LarryG on 2/7/2011 at 01:33
This is from one of my alpha testers. I had tried using the ecology script to spawn some apparitions. There were only suppose to be two at a time on the lower level, but as you can see, it turned into a convention! Frame rates went down to unbearable :(
[ATTACH]942[/ATTACH]
I think I'll go on to plan B until this script gets fixed and use different approach for fireshadow rejuvenations.
qolelis on 6/6/2013 at 22:24
LGScript is really great for productivity (and for sharing) and easy to setup; I can focus on the scripts I need and don't have to spend time on administrative stuff like I would have to if using the old way. Even though it isn't supposed to be ready for real production, I was going to take my chances - or at least put it thourgh initial beta - but unfortunately I cannot get LGScript to work together with how New Dark's included FM loader organizes things, which, for me, is a deal-breaker.
New Dark's FM loader keeps all FM-specific stuff in its own folder separate from the game folder, but if I put my scripts-folder there, LGScript cannot find it. During development (I have written two scripts for a bow practice area in my mission) I have temporarily put my scripts folder in the game folder, but that won't do for release, so I will most likely turn to the old ways, but still use LGScript for prototyping purposes (because it's so easy - and quick - to get things working).
LarryG on 7/6/2013 at 00:41
@ qolelis: Please post your Lua scripts when you have them such that you want to share. When LGScript was announced I went out an bought a programming with Lua book. Way back when, I was a professional software engineer (Fortran and IBM assembler (BAL) and later on some O-O), all self taught from manuals, but I couldn't figure out how to get LGScript working for Thief from the docs. So I really would appreciate having some working examples to look at.
@ Telliamed: I never did get your Fireshadow scripts to work. Did you ever go back, debug how the Firer link could be missing, and fix them? They would still be very handy to have working.
The Watcher on 7/6/2013 at 09:27
Looking at his code, (
https://github.com/whoopdedo/publicscripts/blob/master/T2Scripts.cpp#L1259) AttemptSpawn() first checks whether a Firer link exists (1262-1266), if it doesn't the remaining code in that function will try to spawn a new AI and set up a time delayed message ((
https://github.com/whoopdedo/publicscripts/blob/master/T2Scripts.cpp#L1279) 1279) which results in (
https://github.com/whoopdedo/publicscripts/blob/master/T2Scripts.cpp#L1251) MakeFirer() being called (via OnTimer) after 100 milliseconds. (I
guess that the delay there is necessary to ensure that the game has finished creating and setting up the AI before any attempt is made to create a link to it, but I find it a bit puzzling since Teleport can be called on it, surely a link can be added...)
My first-stab guess is that the problem may be down to a race condition: if AttemptSpawn() is called twice, and the second call happens within that 100ms or so window between the first call setting up the timed message and the timed message firing to add the Firer link, the Firer link will not have been created before the second call passes its check for the existence of a Firer link. Basically, if calls to AttemptSpawn() can possibly happen with less that approximately 100ms between calls, the mutual exclusion behaviour provided by the Firer link will not work, so you could potentially get more than two spawns at a time depending on the tweq firing rate.
Without the source for the old T1/TG gen.osm, we probably won't know how LGS did it originally, but the first approach I'd probably try is to see if that Firer link could be added immediately in AttemptSpawn(). If it couldn't, I'd probably try adding in a "bSafeToSpawn" member variable, initialised to true, and then do if(!bSafeToSpawn || bFirer) for the link existence check, immediately set bSafeToSpawn = false after that, and only set it back to true after the Firer link has been established in MakeFirer().