Trevliga Spel forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

program change script : don't extract #value#

2 posters

Go down

program change script : don't extract #value# Empty program change script : don't extract #value#

Post by kekule Sat Dec 30, 2023 3:24 pm

Hi,

The purpose of this script is simply to display the value of a program change received, but it always display "PGM 0"

(@pgm:127)
[(pc:*,*){@pgm:#value#}]
[(@pgm:*){text:PGM #@pgm#}]

I attached the log


Rgds
Attachments
program change script : don't extract #value# Attachment
program change log.txt The logYou don't have permission to download attachments.(3 Kb) Downloaded 1 times

kekule

Posts : 4
Join date : 2023-12-30

Back to top Go down

program change script : don't extract #value# Empty Re: program change script : don't extract #value#

Post by Admin Sat Dec 30, 2023 5:39 pm

There seems to be a problem with the #value# reference; I need to investigate that. Use the direct event reference instead:

[(pc:*,*){@pgm:#@e_pc#}]
[(@pgm:*){text:PGM #@pgm#}]

I don't know what the line (@pgm:127) is meant to do. Since it is not enclosed by square brackets, the script engine treats it as a comment.

Admin
Admin
Admin

Posts : 952
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

program change script : don't extract #value# Empty Re: program change script : don't extract #value#

Post by kekule Sat Dec 30, 2023 5:50 pm

Thank you, it works better now.
My mistake for line 1, I thought it was needed to 'declare' the variable.

kekule

Posts : 4
Join date : 2023-12-30

Back to top Go down

program change script : don't extract #value# Empty Re: program change script : don't extract #value#

Post by Admin Sat Dec 30, 2023 11:38 pm

The variable is created with the value 0 at the first reference. If you want it to be initialized with another value, you can use an init command:

[(init){@pgm:127}]
Admin
Admin
Admin

Posts : 952
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

program change script : don't extract #value# Empty Re: program change script : don't extract #value#

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum