Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - PCCL

Pages: 1 ... 5 6 [7]
91
Suggestions / choosing which ships can be refitted in missions
« on: January 01, 2013, 07:42:12 PM »
mostly for modding, but would make some existing missions make more sense, basically another boolean variable on the end of the add ship parameters on whether if the ship can be refitted.

it would make sense for people mounting a defense to have the time to refit the fleet, but not a phase group on active mission being ambushed by hegemony convoys

also for missions like for the greater lud, maybe you can only refit the black star but not the luddite ships

92
Discussions / [programming] finding a specific data type in an array
« on: December 22, 2012, 05:38:02 PM »
Hi all,

So I ran into another problem in my programming project (thanks to thaago for solving my last one :) ), hoping someone here might know what to do. The code is in actionscript 3 but it's similar enough to java that any code that work there probably works here too

Say there's an array as follows:

var a: Array = [Number:3.14, int:5, string:"Hello World!!"]

and I want to check which one of these is the data type I want, preferably its position in the array.

Example: myFunction(a, int) should return 1, myFunction(a, string) should return 2.

Now I suppose I can just do this with a for loop going through everything in the array and check if it is the datatype, but is there a more elegant way to go about this?

thanks in advance

gunny

93
hi all, not sure if this is the right place to ask this, but I've seen a share of good programmers around here (not to mention the man himself):

So I'm trying to make a turret (for a project) point towards the mouse, much like how sf does, and give the turret limited speed (so it doesn't simply snap to the mouse, again much like sf)

Current code determines the rotation the turret wants to be at as a function of mouse position and turret position:
Spoiler
return(Math.atan2((stage.mouseY-this.y),(stage.mouseX-this.x))*180/Math.PI);
[close]

and rotates the turret by increments to either side depending on if its rotation is greater than or smaller than the desired rotation
Spoiler
         if (rotation - desired > rotationspeed* -1 && rotation - desired <  rotationspeed)
         {
            return desired;
         }
         else if (desired > rotation)
         {
            return rotation + rotationspeed;
         }
         else if (desired < rotation)
         {
            return rotation - rotationspeed;
         }
[close]


More or less does what I want. However, when the mouse is at the back of the turret, the desired rotation snaps from -180 to +180 and the turret goes all the way around to the mouse, and then around again if the mouse crosses the line again.

if you set the firing arc to 360 on a sf turret that won't be a problem, so there is a way around that. Wondering if anyone here knows this way and is willing to share it.

thanks in advance

gunny

94
Suggestions / disabling tactical view for ships unsuited to command?
« on: November 22, 2012, 02:48:53 PM »
wondering if anyone wants this, I think it's a bit jarring that a garbage barge like the Hound can command a whole armada.

Maybe we don't allow cheap ships like the Hound, non-combat ships like the buffalo, and small ships like hyperion or phase frigates to enter tactical map.

This, besides possible realism (which is subjective anyways), will bring the tactical depth of hunting down command ships and protecting your own (if you kill all enemy command ships they basically can't change orders, same for you)

maybe the command ships will be indicated by something, not sure about that

also maybe non-command ships can have a command room/interface installed for OP as a hull mod

thoughts?

gunny

95
Discussions / starcraft 2
« on: November 21, 2012, 12:34:56 AM »
hi, just started playing sc2, pretty intense games I must say

wondering if anyone here plays it

league? advises? practice partner?

things like that

Pages: 1 ... 5 6 [7]