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

    • Yes, but it also includes extra features like autofarm, autofarm interface button, dressme, many bug fixes from rusacis and premium geodata aswell.
    • discord mass dm service, discord bulk dm, discord dm service, discord mass messaging, discord dm bot, discord dm tool, discord mass dm bot, discord dm automation, discord bulk messaging, discord dm blast, discord mass dm tool, discord dm campaign, discord direct message service, discord dm software, discord mass dm advertising, discord dm marketing, discord bulk dm service, discord dm spammer, discord mass dm script, discord dm sender, discord automated dm, discord dm outreach, discord mass messaging service, discord dm promotion, discord bulk dm bot, discord dm advertising service, discord mass dm platform, discord dm marketing tool, discord bulk messaging bot, discord dm automation tool, discord mass dm sender, discord dm blast service, discord bulk dm tool, discord dm marketing service, discord mass dm system, discord dm advertising bot, discord bulk messaging service, discord dm promotion service, discord mass dm automation, discord dm outreach tool, discord bulk dm automation, discord dm marketing platform, discord mass dm software, discord dm advertising tool, discord bulk messaging platform, discord dm campaign service, discord mass dm marketing, discord dm blast tool, discord bulk dm marketing, discord dm automation service   discord mass dm service, discord bulk dm, discord dm service, discord mass messaging, discord dm bot, discord dm tool, discord mass dm bot, discord dm automation, discord bulk messaging, discord dm blast, discord mass dm tool, discord dm campaign, discord direct message service, discord dm software, discord mass dm advertising, discord dm marketing, discord bulk dm service, discord dm spammer, discord mass dm script, discord dm sender, discord automated dm, discord dm outreach, discord mass messaging service, discord dm promotion, discord bulk dm bot, discord dm advertising service, discord mass dm platform, discord dm marketing tool, discord bulk messaging bot, discord dm automation tool, discord mass dm sender, discord dm blast service, discord bulk dm tool, discord dm marketing service, discord mass dm system, discord dm advertising bot, discord bulk messaging service, discord dm promotion service, discord mass dm automation, discord dm outreach tool, discord bulk dm automation, discord dm marketing platform, discord mass dm software, discord dm advertising tool, discord bulk messaging platform, discord dm campaign service, discord mass dm marketing, discord dm blast tool, discord bulk dm marketing, discord dm automation service  
    • buy discord accounts, discord accounts for sale, buy discord accounts bulk, cheap discord accounts, aged discord accounts, discord account marketplace, buy aged discord accounts, discord accounts cheap, wholesale discord accounts, buy bulk discord accounts, discord account shop, verified discord accounts, discord pva accounts, discord accounts online, phone verified discord accounts, email verified discord accounts, discord account vendor, discord accounts wholesale, buy old discord accounts, discord account supplier, fresh discord accounts, discord account store, discord account service, buy discord account online, discord accounts bulk buy, discord account seller, discord accounts package, discord account bundle, premium discord accounts, discord account provider, discord accounts instant delivery, discord accounts fast delivery, discord account generator, discord account creator, multiple discord accounts, discord accounts ready, discord accounts quality, discord account dealer, buy discord tokens, discord early supporter accounts, discord nitro accounts for sale, discord 2015 accounts, discord 2016 accounts, discord accounts with badges, discord server accounts, buy discord accounts secure, discord accounts reliable, discord account trading, discord accounts inventory, discord account collection, discord accounts stock  
    • Buying & Selling WOW Gold
    • Buying & Selling POE & POE2 Divine-Mirrors
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock