Define ZONE_PAR_GROUP

paul0133
paul0133 Member Posts: 5 Newcomer
edited October 2024 in Scripting Workshop

hello, very new ksp scripter/creator tools user here. i am attempting to modify the Ambient Escapes project but i am struggling to add a 3rd and 4th waveform. i have the drop point working correctly but am unsure how to define the groups that should be assigned to each waveform. waveformA just keeps repeating. can anyone point me in right direction? any help is greatly appreciated.

Comments

  • theodorech
    theodorech Member Posts: 73 Member

    attach_zone KSP line has three slots: attach_zone(<ui_waveform id>, <zone ID>, <flags>)

    If you examine the Ambient Escapes script closely, you'll see that the zone IDs are already decided. The first layer is labeled as 0, and the second layer uses a variable called $MAX_ZONES_PER_LAYER, which is set to 32. Depending on the number of user zones you've defined in your project, this ID might vary. You can experiment with this by adjusting the variables accordingly.

    attach_zone($main_slota_waveform, %NI_USER_ZONE_IDS[0], 0) {first user zone}
    attach_zone($main_slota_waveform, %NI_USER_ZONE_IDS[1], 0) {second user zone}

  • paul0133
    paul0133 Member Posts: 5 Newcomer

    thanks for that! its not quite doing what im trying to accomplish. i guess the naming is the part im confused about, "zones" are the keys that are mapped right? i think it is "groups" im trying to choose between. is that right? it is these (1,2,3,4):

  • theodorech
    theodorech Member Posts: 73 Member

    Then, all you need is to adjust this line:

    set_zone_par(%NI_USER_ZONE_IDS[0], $ZONE_PAR_GROUP, <group idx>)
    

  • paul0133
    paul0133 Member Posts: 5 Newcomer

    thank you! do you mean like this? it doesnt seem to be working

    attach_zone($main_slota_waveform %NI_USER_ZONE_IDS[set_zone_par(%NI_USER_ZONE_IDS[0] $ZONE_PAR_GROUP 0)] 0)	
    attach_zone($main_slotb_waveform %NI_USER_ZONE_IDS[set_zone_par(%NI_USER_ZONE_IDS[1] $ZONE_PAR_GROUP 1)] 0)	
    attach_zone($main_slotc_waveform %NI_USER_ZONE_IDS[set_zone_par(%NI_USER_ZONE_IDS[2] $ZONE_PAR_GROUP 2)] 0)	
    attach_zone($main_slotd_waveform %NI_USER_ZONE_IDS[set_zone_par(%NI_USER_ZONE_IDS[3] $ZONE_PAR_GROUP 3)] 0)
    
    

  • theodorech
    theodorech Member Posts: 73 Member

    I’ve already provided the answer to your question along with the necessary code line. :)

    The function attach_zone is utilized to connect a waveform to the ui_waveform module.

This discussion has been closed.
Back To Top