![]() |
AI Help
ok so im making a seal stone converter. My question is now:
How do i get the output of this push_const 6360 func_call 184680579 // func[OwnItemCount] into a separate variable. such as "blue1" Thanks for the help |
i don't understand.
You mean push_const 6360 as blue1? |
Im trying to convert this:
class ancient_trader : citizen { handler: EventHandler MENU_SELECTED(ask, i0, i1, i2, i3, reply, talker) { if ((ask == 1) && (reply == 1)) { i1 = OwnItemCount(talker, 6360); i2 = OwnItemCount(talker, 6361); i3 = OwnItemCount(talker, 6362); i0 = (((i1*3)+(i2*5))+(i3*10)); if (i0 == 0) ShowPage(talker, "seal_stone_none.htm"); else { GiveItem1(talker, @adena_of_ancient, i0); DeleteItem1(talker, 6360, i1); DeleteItem1(talker, 6361, i2); DeleteItem1(talker, 6362, i3); ShowPage(talker, "seal_stone_thx.htm"); } } } } |
into what?
|
|
into C4 AI...
i cant figure out how to do this: "i1 = OwnItemCount(talker, 6360);" basicly use the function OwnItemCount and return the results into i1 Im horrible at AI so im using HF's guide but im stuck at that point |
ahh you want the compiled code.
"i1 = OwnItemCount(talker, 6360);" is something like this... ~~~~ this is C1 ~~~~ push_event push_const 196 // i1 add push_reg_sp fetch_i shift_sp 1 push_event push_const 32 // talker add fetch_i push_const 6360 func_call 81 // OwnItemCount shift_sp -2 assign shift_sp -1 ~~~~ and this is C4 ~~~~ push_event push_const 264 // i1 add push_reg_sp fetch_i push_event push_const 704 // myself add fetch_i push_event push_const 40 // talker add fetch_i push_const 6360 func_call 184680579 // OwnItemCount shift_sp -2 assign4 shift_sp -1 |
awesome, thank you! 1 more question and i should be done... How exactly do i do arithmetic in AI? Im trying to follow HF's AI guide in the sticky section but unfortunately he doesnt add something like this.
this is what i need to do: i0 = (((i1*3)+(i2*5))+(i3*10)); this is what im thinking it would look kind of like: push_event push_const 260 // i0 add push_reg_sp fetch_i push_event push_const 264 // i1 push_const 3 mul but i dont know what comes next... shift_sp -2 ? Thanks for the help! This is what I have so far: Code:
class 1 ancient_trader : citizen |
you need 2 variables or const and an operator
(((i1*3)+(i2*5))+(i3*10)) would be i1 3 * i2 5 * + i3 10 * + push_event // i0 push_const 260 add push_reg_sp fetch_i push_event // i1 push_const 264 add fetch_i4 push_const 3 mul push_event // i2 push_const 268 add fetch_i4 push_const 5 mul add push_event // i3 push_const 272 add fetch_i4 push_const 10 mul add assign4 shift_sp -1 Code:
class 1 ancient_trader : citizen |
You are awesome! Thank you very much!
|
| All times are GMT. The time now is 15:09. |