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 - Yankes

Pages: 1 ... 132 133 [134] 135 136 ... 211
1996
OpenXcom Extended / Re: [EXE] OpenXcom Extended
« on: July 04, 2016, 09:01:55 pm »
https://github.com/Yankes/OpenXcom/commit/dcd84b09cd25a3090e361d8240c9e8251e5c5f29
This commit should fix VS bug. Meantime I'm working on rest of bugs.

1997
OpenXcom Extended / Re: [EXE] OpenXcom Extended
« on: July 04, 2016, 06:16:02 pm »
1: confirmed.
2 - 4: at leas on my exe and some old piratez version I can't get it. Did you do it on exe compiled by my or yourself?

1998
OpenXcom Extended / Re: [EXE] OpenXcom Extended
« on: July 03, 2016, 09:16:49 pm »
I am getting following errors when trying to compile oxce 3.0 in visual studiio 2015... any idea what's wrong?
sh**, probably bug in VS. I will think how I could avoid it.

[ps]
Ok I manage reproduce it on web compiler and fix it: https://rextester.com/DQH12645
Problem is that VS can't handle static functions (and nested types too) when template pack is expanded.
One way to work around is access it indirectly (`helper` function from that link).
Tomorrow I will prepare special commit that will fix it.

1999
XPiratez / Re: Balance of bows and bullets
« on: July 03, 2016, 12:36:45 pm »
I will most probably take this into my fork.
Currently I am in process of merging it with oxce3.0... which will take "forever" since I got a conflict basically on every single file :(

After it's done, I fully agree with accuracy drop, makes sense.
I have one suggestion that save me couple of days of work:
https://stackoverflow.com/questions/9776527/merging-without-whitespace-conflicts
https://stackoverflow.com/questions/18131515/how-can-i-see-a-three-way-diff-for-a-git-merge-conflict

Without this two I would probably do rage quite and refuse to merge master branch.

2000
OpenXcom Extended / Re: [EXE] OpenXcom Extended
« on: July 03, 2016, 12:26:39 pm »
Not yet. I will merge recent changes from master at end of this month or beginning of next.

2001
OpenXcom Extended / Re: [EXE] OpenXcom Extended
« on: July 02, 2016, 05:19:48 pm »
I think in future I could add option for that script could react to if current tile is selected by mouse.
Adding text is impossible and for long time will be. You can only change sprites.

I'm now working on implementing example scripts that will change corpse ground image based on unit state (stunned/wounded/dead).
Whiled doing that I find couple small bugs and missing features needed to do it. In beginning of next week I will release new version that fix that problems and allow crating fully functioning corpse replacer. With that I will post example script that will implements this functionality.

2002
OpenXcom Extended / Re: [EXE] OpenXcom Extended
« on: July 01, 2016, 09:29:23 pm »
I prepare short tutorial for OXCE scripts. Before expanding it more I would like hear some feedback.
Is it easy to understand? What you would want be more elaborate? Anything is missing?



Tutorial of using scripts

List of available function and vales in script is available in log file with debug mode enabled.

Assume you want add reaction to melee attacks.
Then you can do it in two ways:
Code: [Select]
#script defined per item
items:
  - type: STR_WEAPON_WITH_MELEE
    scripts:
      reactionWeaponAction: |
        if eq action action_hit; #when you hit with this weapon enemy can react to it.
          return 100;
        else;
          return reaction_chance;
        end;
#script defined for all items
extended:
  scripts:
    offset: 1.0
    reactionWeaponAction: |
      if eq action action_hit; #all items used as melee will case enemies to react.
        return 100;
      else;
        return reaction_chance; #return old reaction chance
      end;

every thing after `#` is comments, exactly same as in yaml.
each operation need end with `;`.
`if` is condition operation. It will control what code will be executed.
Code: [Select]
someScriptCode: |
  if OPERATION A B; #OPERATION can be: `lt` - less, `le` - less equal, `gt` - greater, `ge` - greater equal, `eq` - equal, `neq` - not equal
    #some code 1
  else OPERATION A B; #`else` can have same condition as first `if`.
    #some code 2
  else OPERATION A B; #you can repeat `else` with test multiple times.
    #some code 3
  else;
    #final case, can be skipped.
  end;


`reaction_chance` in `reactionWeaponAction` is current percent chance of enemy to react. You can modifi it and return it:
Code: [Select]
reactionWeaponAction: |
  var int shade; #definition of new variable that can be used by script.
  BattleUnit.getTileShade action_unit shade; #getting shade of tile that unit is standing on.
  if gt shade 10; #shade of tile is greater than 10.
    div reaction_chance 2; #now is two time less chance to react.
  end;
  div distance 16; #distance between units is in vexels, dividing by 16 give us distance in tiles.
  if gt distance 10; #distance is greater than 10 tiles.
    sub reaction_chance 30; #subtracting
  end;
  return reaction_chance;
Now if acting unit is in dark place (unit lighting count!) and 10 tiles away, then enemy units will have only 20% chance to
react (20 = 100/2 - 30).

We can define variables, each variable have fixed type and can't store anything else:
Code: [Select]
someScriptCode: |
  var int var_name;
`var` mean that we create new variable. `int` is type of it, in this case this is number.
`var_name` is name of variable. New variable start with empty value, in case of `int` this is 0.
You can set different value when you define it:
Code: [Select]
someScriptCode: |
  var int answer_to_every_thing 42; #42 is starting value of this variable.
  set answer_to_every_thing 13; #it was 42 but now is 13.
We have other types than `int`. They are pointers to object from OpenXcom engine.
Code: [Select]
someScriptCode: |
  var int unit_size;
  var ptr BattleUnit unit; #read only pointer to battle unit, this mean unit that you can see in battlescape.
  var ptr RuleArmor unit_armor; #read only pointer to armor that unit can use and what is defined in `armors` node.
  set unit action_unit; #now `unit` and `action_unit` represents same unit.
  BattleUnit.getRuleArmor unit unit_armor; #we get pointer to armor of that unit.
  unit.getRuleArmor unit_armor; #shortcut of previous operation.
  unit_armor.getSize unit_size; #now we have size of unit armor in variable `unit_size`.

2003
XPiratez / Re: Balance of bows and bullets
« on: July 01, 2016, 07:29:33 pm »
I think proper way of doing bug fix is upload it to github (as your fork) and after that create pull request to supsuper master branch: https://github.com/SupSuper/OpenXcom/

2004
OpenXcom Extended / Re: [EXE] OpenXcom Extended
« on: June 30, 2016, 06:59:17 pm »
One point to avoid "exploits" is that this should be considered even with the facility "being build", otherwise you could potentially chain the constructions and surpass the limitation. I imagine this complicates things  ???
In case of OXC "harder" is test for finished buildings :> From game engine you create new thing when you place it on grid. Its simply deactivated until construction is finished.

2005
OpenXcom Extended / Re: [EXE] OpenXcom Extended
« on: June 29, 2016, 08:00:25 pm »
After some thoughts I come to conclusion that this property should prevent building other buildings.
If you list some base functionality on forbid list then when this building is build you can't build any building that provide that functionality.
In case if you already have that functionality in base, you can't place building with it on forbid list.

2006
`std::tuple` is C++11 class, OXC targets C++03. You portably should download older yaml that not use C++11 features yet.
Or switch to VS 2015 that have reasonable C++11 support.

Of course your work around is fine, but is possible that new yaml could have more problems on VS 2012.

2007
OpenXcom Extended / Re: [EXE] OpenXcom Extended
« on: June 28, 2016, 10:37:09 pm »
Give both the same prevention condition and also make them both cause the condition?
Then it should be "unique" instead of "forbid".

2008
OpenXcom Extended / Re: [EXE] OpenXcom Extended
« on: June 28, 2016, 07:27:32 pm »
I probably could add it, right now I don't see any possible complication that it could cause.

2009
OpenXcom Extended / Re: Meridian's resources and mods for X-PirateZ
« on: June 26, 2016, 03:39:49 pm »
I didn't want to make this sound "small"... I'm sure you went through hell merging all this... just wanted to say that functionality-wise, there are only 3 features a modder can notice, player will notice even less.
In this release, it is definitely your new features that deserve the most attention, not the vanilla stuff.
Right this is another way how measure changes. And each give different answer :)

2010
OpenXcom Extended / Re: Meridian's resources and mods for X-PirateZ
« on: June 26, 2016, 03:04:13 pm »
There were only less than 2 months of OXC dev merged in 3.0, so there's not many changes.
Worth mentioning are only three:

1. SupSuper: merged SoldierDiaries
2. Warboy: modularize unit stat adjustment, using TFTD formula: https://github.com/SupSuper/OpenXcom/commit/5c317ce82dcfdd06d487b9991f56d9b3013e8f99
3. Warboy: make damage range a mod instead of an option: https://github.com/SupSuper/OpenXcom/commit/e98da3a56079a4a450e50fca835e2f8d21ce4a49

SoldierDiaries was developed bit more time than 2 months and I merge 500 of 800 commit that difference between OXCE and OXC. This mean that time between merge points are not accurate to measure how much changes goes in (numbers of commits could be screwed too based how many changes go in per commit).
I guess that I pull half of changes from basic version.

Some info about point 3. I was thinking about dropping it completely because I already have same functionality in OXCE. But it would break default compatibility.
Because of that I made that only when weapon have default damage range it will use global values added by Warboy, exception of this is fire damage range that always get it from global range.

Pages: 1 ... 132 133 [134] 135 136 ... 211