(t,value) { if(t==1) { if(value==0) { opt1= 1; //can really do anything here this just means the toggle settings a,b,c where a =0, b=1, c=2. Value is set to 0 when unit is created e } if(value==1) { opt1= 2; //this is what well be slected the 1st time you hit the switch } if(value==2) { opt1= 3; } } if(t==2) { if(value==0) { opt2 = 1; } if(value==1) { opt2 = 2; } } if(t==3) { if(value==0 ) { superdgun = true; } } }
Now, back to bitching about units stopping to push instead of pushing and continuing to move. Are there any hacks around this?
Joined: 25 Aug 2004, 12:31 Location: Has not played *a in years.
if I wanted to make a weapon only fire past a minimum range could I use GET SET_WEAPON_GROUND_TARGET weaponID xzCoord yCoord userTarget to find the targets range?
if I wanted to make a weapon only fire past a minimum range could I use GET SET_WEAPON_GROUND_TARGET weaponID xzCoord yCoord userTarget to find the targets range?
I'm probably misunderstanding but how about you just moving the flare-point, by witch i mean the origin of the weapon projectile?
On a completely different note: Of all the problems I've encountered trying making a spring game, i believe this is a new one.
the texture works fine on a different unit, and is 'properly flipped' The texture is mostly team colour, but that can't be it, right? Works for Fibre if i recall correctly. Anyone any ideas why my unit is black but transparent for trees?
id just use a fake weapon slaved to the weapon with the minimum range set to what you want the minimum range to be, and use CHANGE_TARGET and/or BlockShotX to get the desired result.
Ha ha, yes, kinda... I didn't noticed yet. Although I did worry about things not looking to Simpsons-like. I guess this will be my favourite team colour, though.
Going a bit of topic but I promise i won't derail the Mod Question Repository any further after this post.
I didn't want to share my ideas already, because i don't have all the answers yet to questions that may arise in the community/on the forum, but the unit was already supposed to have a mechanical arm, with a resource reclamation device at the end.
Joined: 15 Dec 2008, 15:53 Location: at front, llt pushing
question - is it possible to 'apply' unit limit to concrete type of unit ? like, lets say, u can have only 2 peewees alive at the same moment ? lua im right ?
I really just need to be sure, and feel it would take a lot of time if I had to accomplish that myself. So hopefully a question will solve it: (To specify, this is about a Lua Unit script.)
About Signals and Signalmasks, callouts to mark and kill a running tread.
Quote:
Spring.UnitScript.SetSignalMask ( number mask ) -> nil Spring.UnitScript.Signal ( number signal ) -> nil
When i look at example scripts, I see the same typical names in all of them, for instance, "SIG_BUILD". Is there is reason for this consistency? Or would the following work as well? :
Code:
local function my_script() SetSignalMask( a_custom_signal_to_kill_the_myscript_tread ) Signal( a_custom_signal_to_kill_the_myscript_tread ) Spring.Echo('Executing my script') end
The name of the signal doesn't matter at all. However it's very important that each signal is a power of 2 distinct from other signals (Do you speak binary? Ever worked with bitfields?)
Code:
local function my_script() SetSignalMask( a_custom_signal_to_kill_the_myscript_tread ) Signal( a_custom_signal_to_kill_the_myscript_tread ) Spring.Echo('Executing my script') end
You inverted Signal and SetSignalMask. You want to kill previous instance of my_script, not yourself! And don't forget to assign some 2^n number to a_custom_signal_to_kill_the_myscript_tread.
Then what I'm saying is from Cob, I assume it's the same for Lua unit scripts but I never tried.
Users browsing this forum: No registered users and 1 guest
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum