Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Beat NPC into Submission?
Author Message
Reflex
Journeyman
*

Posts: 130
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Apr 2012
Reputation: 1



Post: #1
Beat NPC into Submission?
How would you go about scripting a system to beat the animal into submission? put some type of event on the creature and have the event check its hitpoints or something then toggle a tag on the creature?
05-21-2012 06:00 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 246
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: Beat NPC into Submission?
Event and tag should be fine Big Grin
05-21-2012 08:31 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 246
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #3
RE: Beat NPC into Submission?
I have a question about events,and now, i cannot try it in local Big Grin

I want to add three events(event_b,event_a,event_d) with the same trigger(@gethit) to a npc, in what order the triggers will be fired ?

By "installation order"
  1. event_b
  2. event_a
  3. event_d


or by alphabetical/numeric order
  1. event_a
  2. event_b
  3. event_d


?
(This post was last modified: 05-22-2012 12:36 AM by darksun84.)
05-22-2012 12:33 AM
Find all posts by this user Like Post Quote this message in a reply
Reflex
Journeyman
*

Posts: 130
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Apr 2012
Reputation: 1



Post: #4
RE: Beat NPC into Submission?
thats something you're going to have to test I would assume all at once.
05-22-2012 12:58 AM
Find all posts by this user Like Post Quote this message in a reply
Gil Amarth
Journeyman
*

Posts: 189
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: May 2012
Reputation: 0



Post: #5
RE: Beat NPC into Submission?
No. There is a order you have to follow with multiple Triggers:

From the wiki:

Quote:The order of event handling

There are quite a few ways to add events to items or characters. These are:


EVENTS +DEFNAME
Can be set by a function, another event, a player action, or inside a trigger (for example, the @Create trigger).


TEVENTS=DEFNAME
In the body of the ITEMDEF or CHARDEF. There may be as many of TEVENTS lines as you wish.


TYPE=DEFNAME
(Items only) In the body of the ITEMDEF. There can only be ONE base type definition. TYPEs are not only events, they also determine some basic behaviour of the item, and it's capabilities (for example, if an item is not of an equippable type, it cannot be equipped).


DIRECT TRIGGERS
Poor man's events: As events are generally assortments of triggers what can be added to an item or character. You may also "hardcode" some trigger actions in the ITEMDEF/CHARDEF itself.


ORDER OF FIRING
Look at these simple code examples:


[ITEMDEF i_triggertester]
ID=i_floor_wood
TYPE = t_testtype
NAME=TriggerTester
TEVENTS=e_tev_test

ON=@Create
EVENTS +e_ev_test

ON=@DClick
SERV.LOG item dclick from direct trigger

[TYPEDEF e_ev_test]
ON=@DClick
SERV.LOG dclick from event

[TYPEDEF e_tev_test]
ON=@DClick
SERV.LOG item dclick from tevent

[TYPEDEF t_testtype]
ON=@DClick
SERV.LOG item dclick from base typedef


This gives the following results:

item dclick from event
item dclick from tevent
item dclick from base typedef
item dclick from direct trigger


The same for characters:


[CHARDEF c_testorc]
ID=c_orc
NAME=TestOrc
TEVENTS=e_tev_character

ON=@Create
STR = 100

ON=@NPCRestock
EVENTS +e_ev_character

ON=@DClick
SERV.LOG char dclick from direct trigger

[EVENTS e_tev_character]
ON=@DClick
SERV.LOG char dclick from tevent

[EVENTS e_ev_character]
ON=@DClick
SERV.LOG char dclick from event


The results:

char dclick from event
char dclick from tevent
char dclick from direct trigger
05-22-2012 09:25 PM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 246
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #6
RE: Beat NPC into Submission?
wait wait , i mean all that events i wrote, are installed with EVENTS +e_a EVENTS e_d EVENTS +e_b etc Big Grin
(This post was last modified: 05-22-2012 10:31 PM by darksun84.)
05-22-2012 10:24 PM
Find all posts by this user Like Post Quote this message in a reply
dagger4k
Journeyman
*

Posts: 194
Likes Given: 1
Likes Received: 12 in 12 posts
Joined: Mar 2012
Reputation: 0



Post: #7
RE: Beat NPC into Submission?
Have a look at the misc monster abilities. I think that it might give you some clues. For example getting to a certain amount of HP and going invis, or healing. I think you would just ahve to set it to HP brackets
05-22-2012 11:52 PM
Find all posts by this user Like Post Quote this message in a reply
Gil Amarth
Journeyman
*

Posts: 189
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: May 2012
Reputation: 0



Post: #8
RE: Beat NPC into Submission?
It would be better to have only one trigger who checks events on the player to have 3 triggers apart.

My suggestion, make one trigger who check event e_a, e_b, e_d,... (with ISEVENT of course), and return the desired value or effect at the end.
The other way is simply too troublesome for me. Lol
(This post was last modified: 05-23-2012 06:56 AM by Gil Amarth.)
05-23-2012 06:54 AM
Find all posts by this user Like Post Quote this message in a reply
jeem
Apprentice
*

Posts: 33
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Mar 2012
Reputation: 3



Post: #9
RE: Beat NPC into Submission?
I think it was with the order that's shown when you type ".show events". And what is the order of that? I suppose installation order.

All of the above might be wrong though.
05-24-2012 07:10 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 246
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #10
RE: Beat NPC into Submission?
I tested it , it's installation order .

Plus triggers of the same type in differents events share both locals and arguments ! Interesting


Instead, events inserted in the sphere.ini in the fields EventsPlayers etc trigger after the events installed by script/game
(This post was last modified: 05-24-2012 07:56 AM by darksun84.)
05-24-2012 07:50 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)