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

GoodMorning

  • Map Maker
  • *****
  • Posts: 2744
  • (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 »
To once take a walk in the Creeper - to build a bridge to the stars.

virgilw

  • Administrator
  • *****
  • Posts: 11619
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: 11619
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: 2744
  • (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 »
To once take a walk in the Creeper - to build a bridge to the stars.

virgilw

  • Administrator
  • *****
  • Posts: 11619
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: 2744
  • (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.
To once take a walk in the Creeper - to build a bridge to the stars.

kajacx

  • Map Maker
  • *****
  • Posts: 96
  • PRPL custom tools creator
Re: [Bug, PRPL] AcNot SetParticlePosition disconnected
« Reply #6 on: March 26, 2017, 02:04:53 pm »
By the way, line 65:
Code: [Select]
<-Dist 1 powI'm like... whaaat? Why not give asfloat some love.

As for the AcNot, I think it would be best at this point to create a list of "Safe" properties/getters/setters to use with AcNot, and if you use it with anything that is not on that list, you get a warning, if not outright compile error.

GoodMorning

  • Map Maker
  • *****
  • Posts: 2744
  • (Pusillanimous)
Re: [Bug, PRPL] AcNot SetParticlePosition disconnected
« Reply #7 on: March 26, 2017, 06:12:58 pm »
This was part of a tuning effort, set to be ineffective at the time of thread creation.

If it does not work, it should break cleanly and immediately. A list of safe property tokens would be overkill, when some tokens are already asymmetrical between AcNot get and set.
To once take a walk in the Creeper - to build a bridge to the stars.

kajacx

  • Map Maker
  • *****
  • Posts: 96
  • PRPL custom tools creator
Re: [Bug, PRPL] AcNot SetParticlePosition disconnected
« Reply #8 on: March 26, 2017, 06:25:12 pm »
If it does not work, it should break cleanly and immediately

Completely agree. However, how are you going to achive that without creating a list of usable functions that take exactly 1 argument? Also having a setter that would work and getter that wouldn't is easy - just put the final function names into the list - with Get or Set.

Given the nature of PRPL (you can't step debug for example, or at least I am not aware of it), you would like to have as little confustion and disabiguity as possible. However I understand there are more importatnt issues, like let players rate the map they have just played.