View topic - Mod Question Repository... Questions come in, answers go out



All times are UTC + 1 hour


Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 1168 posts ]  Go to page Previous  1 ... 53, 54, 55, 56, 57, 58, 59  Next
Author Message
PostPosted: 26 Sep 2010, 22:49 
Blood & Steel Developer
User avatar

Joined: 25 Aug 2004, 12:31
Location: Has not played *a in years.
Here is KDR's toggle gadget. It works great.
http://sl.pastebin.com/faC7aVHL

Lookes like this in unit files:
Code:
    toggle1 = 3,
        toggle1a = [[Option 1a]],
        toggle1b = [[Option 1b]],
        toggle1c = [[Option 1c]],
        toggle1tooltip = [[1st Options]],
        toggle2 = 2,
        toggle2a = [[Option 2a]],
        toggle2b = [[Option 2b]],
        toggle2tooltip = [[2nd Option]],
        toggle3 = 1,
        toggle3a = [[Super D Gun]],
        toggle3tooltip = [[Fires super Dgun]],

and this in the cob:
Code:
(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?


Top
 Offline Profile  
 
PostPosted: 05 Oct 2010, 15:57 
Zero-K Developer
User avatar

Joined: 14 Mar 2007, 03:44
Location: Fillydelphia
Is it me or can you not use gadget callins within a Lua unit script?


Top
 Offline Profile  
 
PostPosted: 10 Oct 2010, 18:59 
Blood & Steel Developer
User avatar

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?


Top
 Offline Profile  
 
PostPosted: 17 Oct 2010, 00:45 
User avatar

Joined: 19 Aug 2009, 15:09
Location: Sol 3
bobthedinosaur wrote:
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.
Image

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?


Top
 Offline Profile  
 
PostPosted: 17 Oct 2010, 01:51 
Blood & Steel Developer
User avatar

Joined: 25 Aug 2004, 12:31
Location: Has not played *a in years.
probably bad model radius, check the hitsphere radius in upspring, if it is okay, then try adjusting the normals.


Top
 Offline Profile  
 
PostPosted: 17 Oct 2010, 02:52 
Battletech Developer
User avatar

Joined: 21 May 2007, 01:09
Location: New Zealand
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.


Top
 Offline Profile  
 
PostPosted: 17 Oct 2010, 03:26 
Blood & Steel Developer
User avatar

Joined: 25 Aug 2004, 12:31
Location: Has not played *a in years.
since it was a ballistic i just limited the gun elevation. that seems to work.


Top
 Offline Profile  
 
PostPosted: 17 Oct 2010, 10:19 
User avatar

Joined: 19 Aug 2009, 15:09
Location: Sol 3
bobthedinosaur wrote:
probably bad model radius, check the hitsphere radius in upspring, if it is okay, then try adjusting the normals.


I feel a bit silly. Guess I was to tired to check basic stuff. But in any case:
Image


Top
 Offline Profile  
 
PostPosted: 17 Oct 2010, 13:19 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
Planet Express!


Top
 Offline Profile  
 
PostPosted: 17 Oct 2010, 17:19 
User avatar

Joined: 19 Aug 2009, 15:09
Location: Sol 3
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. :-)


Top
 Offline Profile  
 
PostPosted: 17 Oct 2010, 18:21 
Blood & Steel Developer
User avatar

Joined: 25 Aug 2004, 12:31
Location: Has not played *a in years.
Cute ship. It would be some work but maybe you could have units stroll down the ramp with an invisible attachment arm.


Top
 Offline Profile  
 
PostPosted: 17 Oct 2010, 18:40 
User avatar

Joined: 19 Aug 2009, 15:09
Location: Sol 3
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.

Image
Large Image


Top
 Offline Profile  
 
PostPosted: 17 Oct 2010, 18:48 
User avatar

Joined: 19 Aug 2009, 15:09
Location: Sol 3
bobthedinosaur wrote:
invisible


Oh, wait i misunderstood. But yes, that is worth considering, perhaps also possible using Lua MoveCtrl stuff.


Top
 Offline Profile  
 
PostPosted: 18 Oct 2010, 07:18 
Blood & Steel Developer
User avatar

Joined: 25 Aug 2004, 12:31
Location: Has not played *a in years.
What is the easiest way to send a mod option variable to a specific unittype's cob?


Top
 Offline Profile  
 
PostPosted: 20 Oct 2010, 01:11 
Modeler
User avatar

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 ?


Top
 Offline Profile  
 
PostPosted: 20 Oct 2010, 05:38 
Conflict Terra Developer
User avatar

Joined: 21 Jan 2010, 06:21
Location: Tucson
If you're asking what I think you're asking, it's a tag in the unit def:

Code:
          unitRestricted      = 10,


If you're asking something else, I'm not sure.


Top
 Offline Profile  
 
PostPosted: 21 Oct 2010, 11:31 
User avatar

Joined: 19 Aug 2009, 15:09
Location: Sol 3
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


(hope I encounter some noob-friendliness :-) )


Top
 Offline Profile  
 
PostPosted: 21 Oct 2010, 12:38 
P.U.R.E. Developer
User avatar

Joined: 21 Feb 2005, 03:38
Location: Herding cats uphill whilst wearing roller skates.
Quote:
What is the easiest way to send a mod option variable to a specific unittype's cob?
Read the mod option, then call a script in the Unit, sending it the data it needs as a parameter:

Code:
Spring.CallCOBScript(u, "ComScript", 0,X)
Where X is whatever you need to communicate.


Top
 Offline Profile  
 
PostPosted: 21 Oct 2010, 12:51 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
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.


Top
 Offline Profile  
 
PostPosted: 21 Oct 2010, 13:07 
User avatar

Joined: 19 Aug 2009, 15:09
Location: Sol 3
tanks zwzsg.
I now (think I) understand.
(and can carry on more confidently :-) )


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 1168 posts ]  Go to page Previous  1 ... 53, 54, 55, 56, 57, 58, 59  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.