Author Topic: [Bug, PRPL] AcNot SetParticlePosition disconnected  (Read 148 times)

GoodMorning

  • Map Maker
  • *****
  • Posts: 1966
  • (Pusillanimous)
[Bug, PRPL] AcNot SetParticlePosition disconnected
« on: March 06, 2017, 07:17:40 pm »
See attached script, red particles are unmoved, blue are shifted. Relevant lines are 69 and 89, as labelled by Notepad++.

Also see test map attached. (Side note: Blue emitter destruction doesn't have an event tag, unlike red.)

Note: It seems that the same bug happens for ships, I'm not sure about units. The ship-bug is, I seem to recall, present in that test map.
« Last Edit: March 07, 2017, 06:28:31 am by GoodMorning »
At the end of the game, the king and the pawn go into the same box.

virgilw

  • Administrator
  • *****
  • Posts: 11576
Re: [Bug, PRPL] AcNot SetParticlePosition disconnected
« Reply #1 on: March 08, 2017, 08:37:18 am »
Added to the TODO list... thanks.

virgilw

  • Administrator
  • *****
  • Posts: 11576
Re: [Bug, PRPL] AcNot SetParticlePosition disconnected
« Reply #2 on: March 20, 2017, 01:52:53 pm »
On line 69 you have this:
   <-BadParticle.ParticlePosition swap <-DelX sub swap <-DelY sub ->BadParticle.ParticlePosition

On line 89 you have this:
   <-NiceParticle <-NiceParticle.ParticlePosition swap <-DelX sub swap <-DelY sub SetParticlePosition

Line 89 deals with the blue particles and line 69 deals with the red particles. Look like you want what is on line 89 to also be on line 69 if you want the red particles to be moved like the blue particles.  Could just be a copy paste error.

GoodMorning

  • Map Maker
  • *****
  • Posts: 1966
  • (Pusillanimous)
Re: [Bug, PRPL] AcNot SetParticlePosition disconnected
« Reply #3 on: March 20, 2017, 07:27:56 pm »
The two lines should (assuming the AcNot works as it seems to elsewhere) have the same effect, one assigning using AcNot, the other with SetParticlePosition. The fact that the AcNot did not have the same (any?) effect seemed a bug.

I left that in intentionally, so you had both cases at your disposal. I used SetParticlePosition in the other half as an example of intended behaviour.

Thanks for taking the time to let me know. :)

Side note: You are, I think, the gold standard for what a lone dev might do after release.
« Last Edit: March 21, 2017, 01:08:35 am by GoodMorning »
At the end of the game, the king and the pawn go into the same box.

virgilw

  • Administrator
  • *****
  • Posts: 11576
Re: [Bug, PRPL] AcNot SetParticlePosition disconnected
« Reply #4 on: March 21, 2017, 09:55:22 am »
Ahh, ok I was focused on the wrong thing.

Acnot notation for setting only works for single arguments.  You can use for to replace a "Get" call when the Get function returns more than one thing, but for setting the function can only take 1 argument.  Acnot does this when used for a Set.
Ex:
1 2 add ->var.Property
Becomes
1 2 add <-var swap SetProperty

In your code, SetParticlePosition needs two arguments, so it can't be used with AcNot notation.  Not very clear or obvious, I know.  I always add something late in the process (like AcNot) and then regret it months later :)  But next game I hope to address all of these edge issues with a sweeping change.

GoodMorning

  • Map Maker
  • *****
  • Posts: 1966
  • (Pusillanimous)
Re: [Bug, PRPL] AcNot SetParticlePosition disconnected
« Reply #5 on: March 21, 2017, 06:00:38 pm »
Interesting. So you have implemented AcNot parsing by seeking a property token and then prepending Get/Set?

Time to do a light test of whether <-PID <-Y ->X.ParticlePosition works. Or perhaps better not to, as it would generate some of the worst code ever written in RPL.

Given that it is not designed to work, I ask that you have the compiler choke on it, so that poor fools such as I do not bumble along thinking it will.

Also, I'll make a note to reduce use of AcNot, because a heavyweight script does not need any additional commands, even those as lightweight as swap.

Thanks again.
At the end of the game, the king and the pawn go into the same box.