Jump to content
  • 0

Ai Error


caganitas

Question

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
Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

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
Link to comment
Share on other sites

  • 0

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

 

Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • to my store : https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore11 Whatsapp ; +212614849119  to my store : https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore11 Whatsapp ; +212614849119
    • 2 Factor Authentication Code for 100% secure login. Account provided with full information (email, password, dob, gender, etc).
    • ready server for sale, also available for testing with ready and beautiful npc zone pvp with custom 2 epic core orfen lvl2 with all maps ready all quests work at 100% ready comm  board with buffer teleport gm shop service anyone interested send me a pm many more that I forget  Exp/Sp : x30 (Premium: x40)    Adena : x7 (Premium: x10)   Drop : x7 (Premium: 10)   Spoil : x7 (Premium: 10)   Seal Stones : x7 (Premium: 10)   Raid Boss EXP/SP : x10   Raid Boss Drop : x3 (Premium: x5)   Epic Boss Drop : x1 Enchants   Safe Enchant : +3   Max Enchant : +16   Normal Scroll of Enchant Chance : 55%   Blessed Scroll of Enchant Chance : 60% Game Features   GMShop (Max. B-Grade)   Mana Potions (1000 MP, 10 sec Cooldown)   NPC Buffer (Include all buffs, 2h duration)   Auto-learn skills (Except Divine Inspiration)   Global Gatekeeper   Skill Escape: 15 seconds or /unstuck   1st Class Transfer (Free)   2nd Class Transfer (Free)   3rd Class Transfer (700 halisha mark)   Subclass (Items required from Cabrio / Hallate / Kernon / Golkonda + Top B Weapon + 984 Cry B)   Subclass 5 Subclasses + Main (Previous subclasses to level 75 to add new one)   Noblesse (Full Retail Quest)   Buff Slots: 24 (28 with Divine Inspiration LVL 4)   Skill Sweeper Festival added (Scavenger level 36)   Skill Block Buff added   Maximum delevel to keep Skills: 10 Levels   Shift + Click to see Droplist   Global Shout & Trade Chat   Retail Geodata and Pathnodes   Seven Signs Retail   Merchant and Blacksmith of Mammon at towns   Dimensional Rift (Min. 3 people in party to enter - Instance)   Tyrannosaurus drop Top LS with fixed 50% chance   Fast Augmentation System (Using Life Stones from Inventory)   Chance of getting skills (Normal 1%, Mid 3%, High 5%, Top 10%)   Wedding System with 30 seconds teleport to husband/wife Olympiad & Siege   Olympiad circle 14 days. (Maximum Enchant +6)   Olympiads time 18:00 - 00:00 (GMT +3)   Non-class 5 minimum participants to begin   Class based disabled   Siege every week.   To gain the reward you need to keep the Castle 2 times. Clans, Alliances & Limits   Max Clients/PC: 2   Max Clan Members: 36   Alliances allowed (Max 1 Clans)   24H Clan Penalties   Alliance penalty reset at daily restart (3-5 AM)   To bid for a Clan Hall required Clan Level 6 Quests x3   Alliance with the Ketra Orcs   Alliance with the Varka Silenos   War with Ketra Orcs   War with the Varka Silenos   The Finest Food   A Powerful Primeval Creature   Legacy of Insolence   Exploration of Giants Cave Part 1   Exploration of Giants Cave Part 2   Seekers of the Holy Grail   Guardians of the Holy Grail   Hunt of the Golden Ram Mercenary Force   The Zero Hour   Delicious Top Choice Meat   Heart in Search of Power   Rise and Fall of the Elroki Tribe   Yoke of the Past     Renegade Boss (Monday to Friday 20:00)   All Raid Boss 18+1 hours random respawn   Core (Jewel +1 STR +1 DEX) Monday, Wednesday and Friday 20:00 - 21:00 (Maximum level allowed to enter Cruma Tower: 80)   Orfen (Jewel +1 INT +1 WIT) Monday to Friday, 20:00 - 21:00 (Maximum level allowed to enter Sea of Spores: 80)   Ant Queen Monday and Friday 21:00 - 22:00 (Maximum level allowed to enter Ant Nest: 80)   Zaken Monday,Wednesday,Friday 22:00 - 23:00 (Maximum level allowed to enter Devil's Isle: 80)   Frintezza Tuesday, Thursday and Sunday 22:00 – 23:00 (Need CC of 4 party and 7 people in each party min to join the lair, max is 8 party of 9 people each)   Baium (lvl80) Saturday 22:00 – 23:00   Antharas Every 2 Saturdays 22:00 - 23:00 Every 2 Sundays (alternating with Valakas) 22:00 – 23:00   Valakas Every 2 Saturdays 22:00 - 23:00 Every 2 Sundays (alternating with Antharas) 22:00 – 23:00   Subclass Raids (Cabrio, Kernon, Hallate, Golkonda) 18hours + 1 random   Noblesse Raid (Barakiel) 6 hours + 15min random   Varka’s Hero Shadith 8 hours + 30 mins random (4th lvl of alliance with Ketra)   Ketra’s Hero Hekaton 8 hours + 30 mins random (4th lvl of alliance with Varka)   Varka’s Commander Mos 8 hours + 30 mins random (5th lvl of alliance with Ketra)   Ketra’s Commander Tayr 8 hours + 30 mins random (5th lvl of alliance with Varka)
  • 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