Jump to content

Question

Posted (edited)

Hi,

 

im trying to do something in AI and i keep getting erros in the NPC server as soon as AI is loaded, as if the ai.obj gets corrupted, its a huge stack(after compiling it to .obj and adding the compiled code) if i use the s0 variable but if i remove that variable and use hardcoded strings it works, this code is simple i just want to test something where i manage a string every time MENU_SELECTED is invoked.

What i expected this code to do was basically the NPC would say the string "l2Bbuffer002.htm". (no sense i know, but i cut the code to figure what was corrupting it)

The NASC code

class 1 buffer : default_npc
{
parameter:
  string fnHi = "l2Bbuffer001.htm";
  string page = "l2Bbuffer001.htm";
 
handler:

EventHandler TALKED(talker) {
myself::ShowPage(talker,fnHi);
return;
}

 

EventHandler MENU_SELECTED(ask,reply,item,action_id,s0) {
s0 = "l2Bbuffer002.htm";
myself::Say(s0);
return;
}//event
}//class
 

Edited by caganitas

9 answers to this question

Recommended Posts

  • 0
Posted

While i applaud posting of your test - posting without the specific error or info on when in the process shit goes wrong - makes stuff very hard to help with.

  • 0
Posted (edited)

This is the errors i get with that code, as i said its like the AI get corrupted if i use the s0 or any native string variable to do this. if i remove the s0 and use hardcoded strings it works. Im using interlude compiler and replacing the ID's with the GF ID's (im running GF), this is working fine for other variables and functions that didnt change its signature.

 

Untitled2.jpg

 

And if i use a parameter set by me i get these errors, i guess parameters cant change at run time?

 

 

 

Untitled.jpg

Edited by caganitas
  • 0
Posted

The compiled code for that NASC after replacing the ID's is:
 

class 1 buffer : default_npc
parameter_define_begin
    string fnHi "l2Bbuffer001.htm"
    string page "l2Bbuffer001.htm"
parameter_define_end
handler 3 13    //  TALKED
    variable_begin
        "talker"
        "myself"
        "_choiceN"
        "_code"
        "_from_choice"
    variable_end

    push_event    //  myself
    push_const 784
    add
    fetch_i
    push_event    //  talker
    push_const 40
    add
    fetch_i
    push_parameter fnHi
    func_call 235012165    //  func[showPage]
    shift_sp -2
    shift_sp -1
    exit_handler
handler_end

handler 31 19    //  MENU_SELECTED
    variable_begin
        "ask"
        "reply"
        "item"
        "action_id"
        "s0"
        "myself"
        "_choiceN"
        "_code"
        "_from_choice"
    variable_end

    push_event    //  s0
    push_const 576
    add
    push_reg_sp
    fetch_iS881.    "l2Bbuffer002.htm"
    push_string S881
    assign
    shift_sp -1
    push_event    //  myself
    push_const 784
    add
    fetch_i
    push_event    //  s0
    push_const 576
    add
    fetch_i    func_call 234946622    //  func[say]
    shift_sp -1
    shift_sp -1
    exit_handler
handler_end

class_end

 

  • 0
Posted (edited)

So let me get this straight - you not knowing shit about the language use a compiler for something completely different and replace only IDs.

Yet expect it to work like magic?

 

 

The fact that you don't register this as bad - or think "okay can't use c4 compiler" is scary.

 

 

 

Syntax looks correct per NASC - so get a GF compiler and see if the output is different.

(I'm assuming by logic - it will have to be as param syntax matches other uses of s0 in GF).

 

Most probably error is the assigning to s0 - that does not look GF alike natively.

Edited by mcbigmac
  • 0
Posted (edited)

Well it worked for some cases and i read on another forum that the native syntax didnt change from interlude to GF only some function signature and ID's for functions/variables/handlers, and from the cases i tried it was true (which im aware doesnt make it true for every case), so i tried this case and wanted to know from those who actually have knowledge on the subject if it was the process of "converting" to a newer chronicle or just some other wrong code i had, guess i'll have to buy the GF compiler then.

 

Another question, is there any way from the MENU_SELECTED handler to know or go back to the htm page that requested it, like a variable that has that information or a function that redirects? or i just need to send that information from the htm page to the AI?

Edited by caganitas
  • 0
Posted

People look at GF and C4 AI and see no major differences - and there aren't.

But string assigning like that could have changed, find a native example in both and check.

 

 

There's no way to know requesting html by AI - as far as i remember.

Such info is simply not saved in memory in either daemons.

  • 0
Posted

Now that i look at it again - i'm actually confuzzled.

 

That was until i noticed this...

 

fetch_iS881.    "l2Bbuffer002.htm"

 

 

If that's not a copy paste error by you, well there's your error.

  • 0
Posted (edited)

Now that i look at it again - i'm actually confuzzled.

 

That was until i noticed this...

 

fetch_iS881.    "l2Bbuffer002.htm"

 

 

If that's not a copy paste error by you, well there's your error.

yep your right that was it...

 

comparing to a place from compiled GF AI has an assign to s0

 

push_event    //  s0

    push_const 576            //s0

    add

    push_reg_sp

    fetch_i            //expr =

S278.    "String"

    push_string S278

    assign

    shift_sp -1

 

so yeah.... you can close the topic while i go write on a board im a dummy 200 times :D thanks again 

mcbigmac

Edited by caganitas
Guest
This topic is now closed to further replies.


  • Posts

    • LIVE VERIFICATION? SUMSUB? “IMPOSSIBLE”? ▪ Spoiler: it is possible — if you know who to work with. A client came in with a task to pass **live verification** on **WantToPay**, a Telegram virtual card service. On the platform side — **Sumsub**: liveness check, SMS, manual review. “Fast” and “by eye” simply don’t work here. › What was done: → analyzed the verification scenario and Sumsub requirements → built the correct flow: phone number, email, timing → **completed live verification remotely, without account handover** → handled SMS and confirmation codes → brought the process to final approval ▪ Result: → verification passed → access granted → no flags or repeat requests ▪ Live verification is not luck. It’s scenario-based preparation — not hope. › TG: @mustang_service ( https:// t.me/ mustang_service ) › Channel: Mustang Service ( https:// t.me/ +6RAKokIn5ItmYjEx ) *All data is published with the client’s consent.* #verification #sumsub #livecheck #kyc #case
    • IMPORTANT INFO: In a few days, I will switch to completely new code, written from scratch with a new download system, patch building and management system. The Updater will become true 2026 code with "foolproof systems". I'm going to create a Discord server for customers to request new ideas and features. FIRST CUSTOMERS ARE ALREADY USING THE NEW UPDATER ON LIVE SERVERS! Watch this topic for upcoming info because the new updater is around the corner! Yes, you can still use self-update on the previous updater! No, the new updater won't be compatible with the old patch system! A new build is required, but players who already have game files won't have to download the entire patch again! New templates and updates to existing templates are coming soon! Sneak peek:  
    • i used guytis IL project and source. i found in his project there are 3 Client version source... 1,CliExt_H5   --->this one cant be compiled in VS2005,i did know why..is it for H5 client? 2,CliExtNew  --->this one is IL version ,but when i compiled it and use it.player cant login game,MD5Checksum wrong.i check the source code,but not found any hints. 3,L2Server    --->this one for HB client?im not sure...   so my question is what are the differences between these three versions of cliext.dll?how can i fix the issue of the MD5Checksum not matching problem?   01/29/2026 21:04:11.366, [CCliExt::HandleCheckSum] Invalid Checksum[1130415144] vs [-721420287] packet[dd] len[29] sum[2698] key[30] HWID[] Account[]! 01/29/2026 21:04:11.366, SocketLimiter::UserSocketBadunknownprotocol 11111111111 01/29/2026 21:04:11.366, [usersocket]unknown protocol from ip[113.137.149.115]!      
    • ## [1.4.1] - 2026-01-29   ### ✨ New Features - **Short Description**: Server owners can add a short tagline (up to 240 characters) on the server info page, under the "Online" status. It appears in the server list (By Votes) for VIP, Gold VIP, and Pinned servers so players see a brief summary at a glance.   ### 🔄 Improvements - **Server Info Page**: Description field is limited to 3000 characters with a character counter; the textarea is vertically resizable. A second **Save Changes** button was added at the bottom (after the description) for easier saving. - **Server Name**: In My Servers → Edit, the server name is read-only and can no longer be changed (avoids accidental changes and naming conflicts). - **Server Rows (By Votes)**: Short descriptions wrap correctly and no longer affect row height; long text is clipped to two lines so the list stays tidy and consistent.   ---
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..