Pocket Plane Group

Miscellany, Inc. => Infinity Engine Modding Q&A => Topic started by: aigleborgne on October 10, 2010, 02:04:48 AM

Title: SPRINT and #integer
Post by: aigleborgne on October 10, 2010, 02:04:48 AM
Hello,

I'm trying to store a reference string in a variable.

This line works:
Code: [Select]
SPRINT description #25217
Now, I use a variable for reference index, I tried:
Code: [Select]
SPRINT EVALUATE_BUFFER label #%label_strref%
SPRINT EVALUATE_BUFFER label ~#%label_strref%~
SPRINT label #%label_strref%
SPRINT label ~#%label_strref%~
None work...

Purpose of this : export all kits
Full code:
Code: [Select]
COPY_EXISTING ~kitlist.2da~ ~override~
    COUNT_2DA_ROWS ~9~ kit_rows
    FOR ( kit_index = 1 ; kit_index < kit_rows ; kit_index += 1 ) BEGIN
        READ_2DA_ENTRY %kit_index% 0 9 id
        READ_2DA_ENTRY %kit_index% 1 9 name
        READ_2DA_ENTRY %kit_index% 3 9 label_strref
        READ_2DA_ENTRY %kit_index% 4 9 description_strref
        READ_2DA_ENTRY %kit_index% 5 9 abilities
        READ_2DA_ENTRY %kit_index% 8 9 class_id
        //SPRINT EVALUATE_BUFFER label #%label_strref%
        SPRINT label ~#%label_strref%~
        SPRINT description #25217
        SPRINT ~list5~ ~%list5%[ID]:%id%%nl%~
        SPRINT ~list5~ ~%list5%[NAME]:%name%%nl%~
        SPRINT ~list5~ ~%list5%[LABEL]:%label%%nl%~
        SPRINT ~list5~ ~%list5%[ABILITIES]:%abilities%%nl%~
        SPRINT ~list5~ ~%list5%[CLASS]:%class_id%%nl%~
        SPRINT ~list5~ ~%list5%[DESCRIPTION]:%description%%nl%~
    END
BUT_ONLY_IF_IT_CHANGES

Is is possible or I am forced to use command line to extract strref ?
Title: Re: SPRINT and #integer
Post by: Mike1072 on October 10, 2010, 02:27:15 AM
READ_2DA_ENTRY %kit_index% 3 9 label_strref
READ_2DA_ENTRY %kit_index% 4 9 description_strref

GET_STRREF label_strref label
GET_STRREF description_strref description
Title: Re: SPRINT and #integer
Post by: aigleborgne on October 10, 2010, 04:10:17 AM
Thanks, it works like a charm.
I probably missed something as GET_STRREF in not in WEIDU documentation :)


READ_2DA_ENTRY %kit_index% 3 9 label_strref
READ_2DA_ENTRY %kit_index% 4 9 description_strref

GET_STRREF label_strref label
GET_STRREF description_strref description

Title: Re: SPRINT and #integer
Post by: the bigg on October 10, 2010, 06:53:11 AM
you need to pay $150 for a premium membership before you can ask new features in WeiDU.

GET_STRREF is documented in my local copy of the WeiDU readme, but apparently it was added after the last official release.