project-navigation
Personal tools

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.


Messages - joe davis

Pages: [1] 2 3 4
1
Tactics / Re: What's a good 2.3 squad loadout?
« on: February 19, 2010, 08:30:12 pm »
I am not progressing too far until 2.3 is released since I don't want to have to start all over when it is released.  And I have only played on single player so that may make a difference, not sure. 

But based on my current experience, and the lack of weight being a factor I load out my squad with both long distance and short distance weaponry based on their skills and as long as there is room I provide them with medikits. 

On top of this I provide grenades to the units based on their most likely positions, ie snipers and machine guns get smoke grenades,  assault gets smoke grenades, frag grenades, and flashbangs. 

There is usually one or two units that are pretty mediocre in everything except close combat and these I give smgs with flashbangs, smoke, and frag, plus the medikits. 

The units with heavy skills which get the machine guns also get flamethrowers. 

Assault can also use riot shotguns.

If the unit has HE skills then the grenade launcher is sweet. 

I place the long distance weapon in the units hand and the close range in the backpack or holster so that when I first start out I have long range on almost all of my units.

I try to have 2 snipers, 2 assault, 2 machine gunners, and 2 close range.  I use the Assault units to gain ground, machine gunners like mobile turrets primarily set on reaction fire, and snipers to pick off long distance targets.  The close range units probe the buildings and act like scouts at times.  I of course bring extra ammo. 

This load out provides full versatility and plays to the units strengths.  If any of the men get hit then there is normally another unit close by that can heal him.  And if need be, most any unit can fill in for another, so if I have any on the wrong side of the map making its way to the hot spot I can usually use a unit currently at the hot spot to provide the function I need.

In this loadout flamethrowers are decent as they are only utilized in close range when they are needed, and the units carrying them also carry a long range weapon.  Machine guns are decent because they throw a lot of metal around, and when you have a lot of metal flying, something is bound to be hit, just make sure your men in front of the machine gunners are not in the way.  Problem with this is that flamethrowers are not always available since they are either acting as a turret somewhere or they have to catch up with the rest of the team.

I realize that once the weight restrictions become implemented that I wont be able to load my men up with so much firepower, but since it isn't at this time, I see no reason not to take advantage of the versatility that is provided by doing so.

2
Duke that makes sense, though I would like to get more details on what you mean by
Quote
Not to mention erroneous situations like playing a corrupted sound file at a volume other than 0 ...
  Is there a possible complication of me playing the volume at 0.0?  And how does this vary from me using the current gui layout to turn the volume of the effects or sound all the way down? 

  Basically all I am doing is adding a checkbox to turn the volume all the way down and, for aesthetic purposes, making sure that it plays well with the bar that is already there.  Are you seeing a possibility for future complications with the way that I am implementing it?

3
Awesome, I have been studying this earlier and since I was experiencing problems with the code for the onClick event I switched over to the onChange event.  The onChange event works fine, not sure why the onClick didn't.  Also with the path confusion, I was trying to call something that wasn't defined yet so I put the check box after the bar and that helped immensely. 

I don't know about the integer and float values.  They work, guess I could make them both float, huh.

I appreciate this information about the echo and querying cvars.  That is very useful information.  I didn't know about that, was that in the documentation somewhere?

Since there isn't anything coded in C for the effects or music I will stick with my quasi coded solution and lower the volume to 0.0.

As to the cvars, guess I am still confused on how they work.  I have resolved to using surrounding values until it makes more sense to me.  And in regards to saving the previous value, prior to clicking on the checkbox, since it isn't in the CVAR_ARCHIVE, I will use arbitrary values that work for me.

That being said ,I have my first functional solution.  Thank you for your assistance with this.

The onClick event didn't seem to work so used the onChange event and got it to work. 
Code: [Select]
checkbox effects_box
{
current *cvar:snd_volume
pos "85 170"
size "20 18"
image "ui/checkbox_blue"
onChange { if ( *node:this@current > 0 ) { *cvar:snd_volume = 0.5 }
else { *cvar:snd_volume = 0.0 }
             }
       
}

The music check box is different due to the music_snd_volume being coded differently appearantly.

Code: [Select]
checkbox music_box
{
current *cvar:snd_music_volume
pos "85 195"
size "20 18"
image "ui/checkbox_blue"
onChange { if ( *node:this@current > 0 ) { *cvar:snd_music_volume = 100.0 }
     else { *cvar:snd_music_volume = 0.0 }
             }
}

interestingly enough this doesn't put the volume at 100% which I thought it would at first.  The position of the sound seemed fine so left it there.

As to the path, it would appear that my problem with that was I needed to define the check box after the bar since I was trying to call a property of the bar from the checkbox.  Silly me, huh.  lol.

But in the end I decided to change the sound cvars values instead of the bars current value.  This was primarily due to the fact that I couldn't get it to work by calling the bars current value.  Regardless, this works.

So I learned:
  • the importance of spaces
  • defining something prior to trying to use it
  • and simple if else blocks
  • about some basic debugging methods mentioned above(ie querying cvars, and use of echo
   

I was confused 
  • on why the check boxes onClick event didn't seem to want to work
  • the sound volume for the effects and music were handled differently

Thanks for your assistance.

4
Thanks again for the awesomely quick reply and wonderful feedback.  I wish I could understand it better.  Sorry I'm slow and thanks for your patience.  I don't mean to question your knowledge or your experience, I only try to probe further so that I can understand better.

O.K., so the first thing was that I needed spaces around my parens and brackets, like geever said, and then it would run, Thanks geever.

However the code in the onClick event of the checkboxes didn't seem to work.  Does my code in onClick over ride the checkbox's code?  Does the checkbox's onClick event work?  I'm lost on why it's not working.  Here is what I did:
Code: [Select]
checkbox effects_box
{
current *cvar:snd_volume
pos "85 170"
size "20 18"
image "ui/checkbox_blue"
onClick { if ( *node:this@current < 1 ) { *cvar:snd_volume = 0.5 }
              if ( *node:this@current > 0 ) { *cvar:snd_volume = 0.0 }
          }
}



Duke, I am sorry man, that went right over my head. 

Why is there a big difference with playing sound at 0.0 and not playing it at all?  Do you think I should release those resources instead of using them at an imperceptible level? 

Are you saying I should use *cvar:snd_init = 0.0 instead of *cvar:snd_volume = 0.0 in the checkboxes onClick event?  Is that what you meant by split the enabling cvar and handle it in the code?

Side Note: I didn't touch the sound_init checkbox code but when I hit it in the game it shuts off the sound like I would expect but when I re-check it, it  doesn't come back on.  Does it work right on your copies?  Maybe I just broke mine.

Quote
If you wanna run the same event as it would run on clicking you can call *node:thatnode@onClick.
Ok, I understand the calling the onClick event to trigger it, and that is cool, but I am like majorly lost on the thatnode part.  I think I tried *node:parent.effects_box, and *node:options.options_sounds.effects_box and *node:effects_box, all with the @onClick and it wouldn't parse.  The Console said it had no clue what I was talking about and I responded, yeah that apparently makes two of us.  I don't know if I had a typo or if it's just my syntax but the console didn't like my node paths.

Quote
Btw. using the same cvar for the checkbox and the volume bar is not a nice solution. I suggest using a different one for checkboxes.
  You are most likely right in this opinion, and I don't mean to question your knowledge or experience, but why?  From my newbish position I am getting interaction with the bar and checkbox simply in response to the value of the cvar.  Since I am still confused on what I am doing, it is nice to tie it in that way.  The user clicks on the bar and if the value is higher than 0.0 and the checkbox is unchecked then the checkbox becomes checked, and also if the bar's value is 0.0 the checkbox becomes unchecked.  No additional coding required.  This also occurs when the checkbox is checked or unchecked, the bar is changed to reflect the status.  Though I still don't understand why the music volume is being set to what appears to be 0.1 instead of 1.0.  What am I missing by doing this?  Why do you feel that it's not a nice solution?  What benefit do I get by using a new cvar for the checkboxes?

Quote
You can save them to other cvars..
(Assigning a value to a cvar also creates it if didn't exist.)
I am still pending on this as I can't get my onClick event to work, but I was wondering if this would carry over after I exit the game?  For example I have it set to 0.23 and then click on the checkbox.  The checkbox saves the 0.23 to the
Code: [Select]
*cvar:previous_sound_setting = *node:thatnode@current where thatnode is the path to the relevant bar.  Then I play and exit out with the sound off.  Later that day I get back on the game but this time want sound so I click the checkbox which fires for example, the code:
Code: [Select]
*cvar:snd_volume = *cvar:previous_sound_setting  Will the *cvar:previous_sound_setting still be set to 0.23?

5
Newbie Coding / Scripting questions, don't know if that constitutes coding
« on: February 15, 2010, 12:34:44 am »
So, I am a Newb and would like to study the game and have decided to start with scripting since that seems to be the easiest and the most visible in regards to having more instant visual feedback.  I figure I should try to learn how to crawl before trying to learn how to run.  

So I checked out the documentation on the wiki and have more questions.  

A user requested a modification and I wanted to see what it would entail to make a user modification for it.  The request was to add checkboxes next to the effects_str and the music_str to turn them off and on similar to the checkbox sound_init node.  He posted a pic  here: http://ufoai.ninex.info/forum/index.php?topic=4428.msg33974#msg33974

I added the checkboxes and have obtained general functionality, but I am not satisfied with my results and have generated a few questions, which I find to be a positive thing as my primary interest is more in studying than making this work.

Code: [Select]
checkbox effects_box
{
current *cvar:snd_volume
pos "85 170"
size "20 18"
image "ui/checkbox_blue"
}
and
Code: [Select]
checkbox music_box
{
current *cvar:snd_music_volume
pos "85 195"
size "20 18"
image "ui/checkbox_blue"
}

This works well enough in regards to setting the volume to 0.0 when it is unchecked.  
However I run into a couple of various concerns and snags:

1. When I re-check the checkbox from an unchecked state, each of the volumes respond differently.  
a. The effects volume is changed to 1.0 I would assume, ie. it is turned all the way up.
b. The music volume is changed to what appears to be 0.1 or just a sliver.

The questions this brings to mind is:
A. can I assign a value to the *cvar(s) in the onClick event?  like
Code: [Select]
*cvar:snd_volume = 0.5
B. How can I check if the checkbox is checked or not?  This did not seem to work:
Code: [Select]
onClick {if (*node:this@current < 1) { *cvar:snd_volume = 0.5}
         if (*node:this@current > 0) { *cvar:snd_volume = 0.0}
        }

C. How could I click another node from within an onClick event.  For example user clicks on checkbox and I check if supposed to be at 0.0 or 0.5 volume based whether checked or not and then I click on the appropriate bar, for example the effects_bar, at the appropriate location(ie 0.0 or 0.5)?  

D. If the user clicks on the bar how could I code the onClick event in the bar to check or uncheck the checkbox?

2. Is there a method of saving the original position of the sound prior to me hitting the checkbox to turn it off so that when I re-check the checkbox I can place it at the original position instead of the current positions of 1.0 and 0.1 or my proposed position 0.5?

6
User modifications / Re: Mouse position in Debug_menu
« on: February 14, 2010, 09:20:48 pm »
Yay ;D

7
Feature Requests / Re: Get to Market menu from Equipment Menu
« on: February 14, 2010, 09:13:37 pm »
That is pretty cool.  So I can place an onclick event in the buy\sell button which will add an event listener for a different node.  When the event occurs the code in the confunc will be triggered to update the information and remove the listener, (in this example). 

The mn_addlistener command requires 2 parameters: event to listen for and the confunc script to perform when the event is triggered.

we want to remove the listener when we are done with it.

The mn_removelistener command requires 2 parameters: event to stop listening for and a path.  What is the path to?  Will it always be <path:this> and if so, why require it?

Sweet, now I can remove the refresh button and it's code from my second posting and replace my buy\sell button with the code you disclosed in your latest posting, giving me the ability to navigate to the market (buy\sell) menu, the production menu, or the transfer menu directly from the equipment menu.

8
Feature Requests / Re: Get to Market menu from Equipment Menu
« on: February 13, 2010, 10:11:37 pm »
Ouch.  I apologize for posting it without testing it.  Like I said, I can be slow at times.  Thank you for catching that. 

Ok, so I checked it again and everything works except, like you said, the equipment that I bought or sold is not updated so it doesn't look like I did anything, but when I back out of it one level and click back in it is updated and it shows that it worked correctly. 

So how does one refresh that information without having to back out and reenter?  Is there a way of doing a callback?  Is there an onEvent event that fires that can be used?  I am stumped here.  Through me a friggin bone.  lol.

ok, so since I am not a dev, and this is a user modification, and I dont have to be proper with my methods, only functional, I add this at the end of my previous code:
Code: [Select]
button refresh
{
string "_Refresh"
tooltip "_Refresh Inventory"
image ui/button_background
pos "387 293"
size "100 25"
color "1 1 1 1"
selectcolor "0 0.8 0 1"
font f_small
onClick { cmd "team_updateequip;update_item_list;" }
}

my screen looks like the picture attached below.  It's functional.  It does the job, but I aint happy about it.  Sure, for my purposes it works, and I don't have to back out of the screen 2 levels to buy something I forgot to buy and then click in 2 levels to equip it, but it aint right. 

How do I fix it please?

9
Feature Requests / Re: Get to Market menu from Equipment Menu
« on: February 13, 2010, 05:53:55 pm »
Also thought it might be nice to have the transfer menu available as well.  

Made a user modification, but since this version is still in development and can change from current revision, thought I would place the code here:

Code: [Select]
button buysell
{
string "_Buy/Sell"
tooltip "_Buy/Sell equipment"
image ui/button_background
pos "387 127"
size "100 25" 
selectcolor "0 0.8 0 1"
color "1 1 1 1"
font f_small
onClick { cmd "mn_push market;" }
}

button production
{
string "_Production"
tooltip "_Produce new equipment"
image ui/button_background
pos "387 160"
size "100 25"
color "1 1 1 1"
selectcolor "0 0.8 0 1"
font f_small
onClick { cmd "mn_push production;" }
}

button transfer
{
string "_Transfer"
tooltip "_Transfer equipment or personnel"
image ui/button_background
pos "387 193"
size "100 25"
color "1 1 1 1"
selectcolor "0 0.8 0 1"
font f_small
onClick { cmd "mn_push transfer;" }
}

This was modified code taken from bases.ufo, why reinvent the wheel.  I placed this code at the end of equipment.ufo right above this code:
Code: [Select]
// ==================
// additional stuff
// ==================


As you can see I used a background image already there, though I am not sure if I like the onover event of that background image.

This enables access to the market, production, and transfer menus from the equipment menu, if I need it.  

10
User modifications / Mouse position in Debug_menu
« on: February 13, 2010, 04:00:26 pm »
Is there a way of getting the mouse position when using debug_menu?  If not, is there a way of adding that ability by the devs.  I feel that would help with position layout for users who want to modify their menus.  Maybe display the mouse x,y positions right by the mouse, or even under the menu stack display.

11
Do you feel that it takes a while to locate the right position and size of a node when building a menu or have you grown accustomed to placement?  In other words, do you get it placed on your first try or does it take a couple of times to tweak the placement?

12
Feature Requests / Re: Start Production at 0 instead of 1
« on: February 12, 2010, 05:21:11 pm »
  The reason I say it is more natural is because when I  start production I feel that the production queue shouldn't know how many I want to make so it starts at 0.  Then when I hit the x1 or x10 button it makes sense that I have 1 or 10, or increments\decrements thereof based on how many times I have hit the increment or decrement arrow.  I find this as being more noticeable with the X10 button as when I hit it the first time I get 11 instead of 10. 
  That seems odd to me, but then, that may be due to my exposure to XCOM: UFO Defense starting at 0 and this game being similar to that game.  I realize UFO:Alien Invasion is not XCOM: UFO Defense and doesn't claim to be nor does it want to be. I realize my preferences are my own and that you guys have provided me with the ability to modify my version of the game to meet my preferences.  I shared this feedback as I felt it was a bit awkward and in hopes that my feedback might be of some use.
  I would like to mention that I think you guys have done an amazing job on the game and would love to see it be the best that it can be.  I know that this feature request is infinitesimal in comparison to the other factors you are working on, but sometimes the little things can influence the overall feel of the game play, and since I experienced it, thought I should share my feedback. 
  I do not profess to be an expert in GUI design by any means, I do not expect you to fulfill my every whim, and I apologize if I offended you.  The feedback was influenced by years of game play and then my subjective experience with this awesome game we discuss, the genuine desire to see it be the best that it can be, and a hope that by sharing my experiences with the game that I can help give back to it for the entertainment that it has provided me.  Though my logic may be influenced by many subjective influences from past experiences, I must assert that my logic is not broken (A prime example of a game using this logic being the primary influence for this game itself).
Thank you for your time in reviewing this request and your feedback.  I appreciate your quick replies, as always, and your dedication and hard work on your game.  I hope you keep up the great work.  I look forward to the new release.  ;D

13
Feature Requests / Start Production at 0 instead of 1
« on: February 12, 2010, 05:10:24 am »
I click on start production and then I want to make 10 items.  I click on the 10x and I get 11.  Seems silly but starting at 0 is more natural I think. 

14
When I am in the Equipment screen and I am giving my units what I want them to carry and then decide that I would like to put the ammo in a different container so that I could put my smoke grenade and I. Grenade in the belt container.  I click on the ammo to move it and the tab changes to the Primary Tab from the Misc. Tab, usually.  But the thing is, is that I am on the Misc. Tab for a reason and dragging the ammo out of that container so that I can buy something from the Misc. Tab. 
The only time it makes sense to change the tab is if I click on a weapon, which I most likely will just click that Tab to get that ammo type if I decide I want more ammo for that weapon later.

15
Feature Requests / Get to Market menu from Equipment Menu
« on: February 12, 2010, 05:00:14 am »
I would like to be able to push the market menu from the equipment menu so that I can request weapons, armour, equipment, etc. for my units instead of having to back all the way out.  I guess while I am requesting it, being able to push production menu from equipment menu may also make sense.

Pages: [1] 2 3 4