Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 08.03.2007, 01:09   #1
goodtimeshaxor
Архивный участник
 
Join Date: Oct 2006
Posts: 108
Default AI skill creation

I'm interested in making skills through AI. These skills are imposible through conventional skilldata scripting but are a reality through AI scripting. I need some help, any help will do.

If you can provide any of the following please reply:
1. Script a brand new skill through AI.obj
2. Help me learn AI.obj
3. Combination of the two
4. Or anything that will get me closer to my goal

Interesting aye? Let's recap: A skill that is imposible to implement through skilldata.txt but can be done through ai scripting. Again, this means that it's a skill that can be done and is something out of the ordinary which ultimately means a brand new skill that has, to my knowledge, never been made.

^_^
goodtimeshaxor is offline  
Old 08.03.2007, 01:38   #2
m4rk
Архивный участник
 
Join Date: Jan 2006
Posts: 607
Default

your skill summons a pet that makes action on master and then despawns.

This would allow Per example to make a skill that makes a earthquake... (You can make //earthquake through AI ^_^)
I think that would be a nice effect for any skill
m4rk is offline  
Old 08.03.2007, 01:51   #3
FidoW
Архивный участник
 
Join Date: Sep 2005
Posts: 1,014
Default

In the past we use AI to implement some skills like "Summon Arrows" or unpack soulshots ... or "Scroll of Escape for towns"...

Thats is because with C1 skilldata was imposible to get an item through an skill so... with AI, summoning a pet who give an item to master and later despawn... in the case of the SOE towns is a similar idea, pet teleport master to the required location and later despawn...


some examples... C1 NASC... my own code...

Decompressing packs...
Code:
class default_npc { }

class summon_item : default_npc {
  parameter:
    int item = 1;
    int cantidad = 1;

  handler:

  EventHandler CREATED() {
    GiveItem1(myself.master, item, cantidad);
    AddTimerEx(30001, 100);
  }

  EventHandler TIMER_FIRED_EX(timer_id) {
    if (timer_id == 30001) Despawn();
  }

}

// Soulshot
class soulshot_decompressor_n : summon_item {
  parameter:
    int item = 1835;
    int cantidad = 300;
}
Summoning arrows...
Code:
class default_npc { }

class summon_item_random : default_npc {

  parameter:
    int item = 1;
    int cantidad_fija = 1;
    int cantidad_random = 1;
    
  handler:

  EventHandler CREATED() {
    GiveItem1(myself.master, item, cantidad_fija+Rand(cantidad_random));
    AddTimerEx(30001, 100);
  }

  EventHandler TIMER_FIRED_EX(timer_id) {
    if (timer_id == 30001) Despawn();
  }

}

class summon_mithril_arrow : summon_item_random {
  parameter:
    int item = 1344; // @mithril_arrow
    int cantidad_fija = 450;
    int cantidad_random = 1350;
}
SOE to towns (C4 SOEs)
Code:
class default_npc { }

class scroll_of_escape_town : default_npc {
  parameter:
    int x = 0;
    int y = 0;
    int z = 0;
    int castle = 0;
    string fnYouAreChaotic = "tcm.htm";

  handler:

  EventHandler CREATED() {
    if (myself.master.karma > 0) {
      ShowPage(myself.master, fnYouAreChaotic);
      Despawn();
    }
    else if (castle > 0) && (Castle_IsUnderSiege2(castle))
    {
      ShowSystemMessage(myself.master, 707);  // No puedes teletransportarte a un pueblo que este en asedio
      Despawn();
    }
    else {
      AddTimerEx(50000, 100);
      InstantTeleport(myself.master, x, y, z);
    }
  }

  EventHandler TIMER_FIRED_EX(timer_id) {
    if (timer_id == 50000) Despawn();
  }

}

class summon_soe_talking : scroll_of_escape_town {
  parameter:
    int x = -83900;
    int y = 242700;
    int z = -3700;
    int castle = 0;
}
FidoW is offline  
Old 10.03.2007, 19:02   #4
evern
Архивный участник
 
Join Date: Jul 2006
Posts: 46
Default

Thanks to fidows post i am able begin my first attempt to add skills that buff stats, i'm able to add a kind of validation to whether players buff stack on this by retaining the summon until a certain period using TIMER_FIRED, which when it will die and negate the stats, but a major problem arise because players can select the summon and unsummoning it manually, this causing the AI not able to negate the stats before the timer runs out.

i tried a few methods but to no avail...........

1) negate the stats upon MY_DYING
problem: MY_DYING doesn't work when players unsummon them manually
s
2) negate the stats upon TALKED and TALK_SELECTED
problem: doesn't work either

so here's my question

1) what are the parameter that is passed in to MENU_SELECTED when players click unsummon? (maybe this method works?)

2) is there any other way around this?

any help appreciated... really.... i'm stucked for days... thanks in advance

Code:
class stat_inc_skills : default_npc
{
parameter:
	int	Stat = 0;
	int	Amount = 0;

handler:
	EventHandler CREATED()
	{
		myself->AddTimerEx(3000,1000);
	}

	EventHandler TIMER_FIRED_EX(timer_id,i0,i1)
	{
		if( timer_id == 3000 )
		{
			i0 = Stat;
			i1 = Amount;
			myself->IncrementParam(myself.master,i0,i1);
                        despawn();
		}
	}

}
Code:
class 1 stat_inc_skills : default_npc
parameter_define_begin
	int Stat 0
	int Amount 0
parameter_define_end
handler 13 17	//  CREATED
	variable_begin
		"myself"
		"_choiceN"
		"_code"
		"_from_choice"
	variable_end

	push_event	//  myself
	push_const 704
	add
	fetch_i
	push_const 3000
	push_const 1000
	func_call 184680487	//  func[AddTimerEx]
	shift_sp -2
	shift_sp -1
handler_end

handler 12 540	//  TIMER_FIRED_EX
	variable_begin
		"timer_id"
		"i0"
		"i1"
		"myself"
		"_choiceN"
		"_code"
		"_from_choice"
	variable_end

	push_event	//  timer_id
	push_const 236
	add
	fetch_i4
	push_const 3000
	equal
	branch_false L12899
L12898
	push_event	//  i0
	push_const 260
	add
	push_reg_sp
	fetch_i
	push_parameter Stat
	assign4
	shift_sp -1
L12900
	push_event	//  i1
	push_const 264
	add
	push_reg_sp
	fetch_i
	push_parameter Amount
	assign4
	shift_sp -1
L12901
	push_event	//  myself
	push_const 704
	add
	fetch_i
	push_event	//  myself
	push_const 704
	add
	fetch_i	//  master
	push_const 552
	add
	fetch_i
	push_event	//  i0
	push_const 260
	add
	fetch_i4
	push_event	//  i1
	push_const 264
	add
	fetch_i4
	func_call 184746219	//  func[IncrementParam]
	shift_sp -3
	shift_sp -1
L12902
	push_event	//  myself
	push_const 704
	add
	fetch_i
	func_call 184549616	//  func[Despawn]
	shift_sp -1
L12899
handler_end

class_end
evern is offline  
Old 12.03.2007, 02:07   #5
goodtimeshaxor
Архивный участник
 
Join Date: Oct 2006
Posts: 108
Default

Hm, before I start to mess with AI, how are you able to use "NASC" or whatever that is? AI isn't written in that language for C4.
goodtimeshaxor is offline  
Old 12.03.2007, 02:16   #6
FidoW
Архивный участник
 
Join Date: Sep 2005
Posts: 1,014
Default

Using a compiler... maybe ?

C1 AI is like C4 but with some differences... in C1 we have a good NASC compiler, now... people like me compile it by hand.. but others looks like he have a compiler... would be interesting sharing that and all together start coding faster... in the past i code a lot of stuff for C1 and share some things, right now im too tired to compile it by hand... i need my time for other things.
FidoW is offline  
Old 12.03.2007, 14:07   #7
evern
Архивный участник
 
Join Date: Jul 2006
Posts: 46
Default

whos got a c4 compiler? please share dont be selfish... =P i had enough of coding it by hand
evern is offline  
Old 12.03.2007, 18:03   #8
m4rk
Архивный участник
 
Join Date: Jan 2006
Posts: 607
Default

check here and ask them to gently compile your c4 nasc code into c4 ai.obj
m4rk is offline  
Old 12.03.2007, 18:10   #9
FidoW
Архивный участник
 
Join Date: Sep 2005
Posts: 1,014
Default

The problem of that system is i cant make my own test, i never write the final code in the first time, i code... test... modify... test... add... and if I need to wait between every change i made for someone to compile it for me... :s
FidoW is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 18:37.