You must be logged in to post messages.
Please login or register

Scenario Design
Moderated by Crazed Ewok, Gen_Rhys_Dallows

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Leon Kennedy's Scenario Guide Part III
posted 08-17-06 07:27 PM EDT (US)   
Welcome back, all.

This guide will cover an AI trick--Force Powers. So I hope you are prepared to get a crash course. :P

First off, the AI stands for artificial intelligence and is used by SWGB to control the computer characters. The first thing you need to do before you try anything is to become familiar with your AI scripting. To learn more about the scripts for AI, read AI Scripting Guide by Wok and the sequel AI Scripting Continued by Wok. You don't need to learn about strategic numbers or anything like that. Just understand the correlation between AI and triggers.

Ok in a force AI you will probably include the immobile aspects for pacing purposes.

; Immobile Units AI Gold

(defrule
(true)
=>
(set-strategic-number sn-maximum-food-drop-distance 0)
(set-strategic-number sn-maximum-carbon-drop-distance 0)
(set-strategic-number sn-maximum-nova-drop-distance 0)
(set-strategic-number sn-maximum-hunt-drop-distance 0)
(set-strategic-number sn-maximum-metal-drop-distance 0)
(set-strategic-number sn-food-gatherer-percentage 0)
(set-strategic-number sn-nova-gatherer-percentage 0)
(set-strategic-number sn-carbon-gatherer-percentage 0)
(set-strategic-number sn-metal-gatherer-percentage 0)
(set-strategic-number sn-cap-civilian-explorers 0)
(set-strategic-number sn-percent-civilian-explorers 0)
(disable-self)
)

;Military

(defrule
(true)
=>
(set-strategic-number sn-percent-enemy-sighted-response 100)
(set-strategic-number sn-hits-before-alliance-change 25)
(set-strategic-number sn-number-explore-groups 0)
(set-strategic-number sn-percent-attack-soldiers 0)
(set-strategic-number sn-task-ungrouped-soldiers 0)
(set-strategic-number sn-number-attack-groups 0)
(set-strategic-number sn-enemy-sighted-response-distance 10)
(set-strategic-number sn-total-number-explorers 0)
(set-strategic-number sn-holocron-return-distance 0)
(disable-self)
)

Then I tend to have other things besides taunt-force powers. So I leave a few of the basic taunts.

; Immobile RPG Mega V4

;Taunt 1

(defrule
(taunt-detected 1 1)
=>
(acknowledge-taunt 1 1)
(cc-add-resource nova 1)
(cc-add-resource metal 255)
)

This is only if we taunt 1 and you probably will need more if you do any sort of scenario. That way you leave a lot of options open to use in conversations and such. To understand conversations, see my next guide (Leon Kennedys Scenario Guide Part IV). Anyway, now were going to go over the AI part for a force power.

For example in my Star Wars Sith campaign, I have a force power known as force camouflage. It is a power that is used for sneaking around places. The official text for the power is as follows:

" FORCE CAMOUFLAGE
After intense training, the user has mastered
stealth and the use of the force to block others
from sensing his/her presence. Ineffective against
force users. Battle and/or conversation nullifies
the effect.

Dark Side Power
(60)
Chat 11 { ~ 40 second Time Duration}
ACT I (The Way of the Sith) "


; Force Powers :: by SilverSaber_Yoda
; Force Camouflage

(defrule
(food-amount >= 60)
(taunt-detected 1 11)
=>
(acknowledge-taunt 1 11)
(cc-add-resource nova 11)
(cc-add-resource metal 245)
)

; Force Camouflage (failure)

(defrule
(food-amount < 60)
(taunt-detected 1 11)
=>
(acknowledge-taunt 1 11)
(cc-add-resource carbon 1)
)

;::End of Force Powers

But we need a force pool to use these powers. And strangely enough, the pool is food for Player 2 and nova for Player 1.

;:: Force Nova by SilverSaber_Yoda

;Force Nova

(defrule
(food-amount <= 150)
=>
(cc-add-resource food 1)
)

Ok, this means as long as the force player (Player 2) has 150 food or less, 1 food will be added. Now, we need a trigger to complete the effect.

Trigger Force Power
Starting Status: ON
Looping: YES
Condition 1: Accumulate Attribute (1 Food) (Player 2)
Effect: Tribute 1 (Food) (Player 2 to Player 3)
Effect: Tribute (-2 Nova) (Player 1 to GAIA)
Effect: Tribute (1 Nova) (Player 1 to GAIA)

This will give a quiet and steady replenishing of the force pool after use. This prevents cheating on the force power and it also allows Player 1 to see the amount of power.

Trigger Force Power Overflow
Starting Status: ON
Looping: Yes
Condition 1: Accumulate Attribute: (101 Nova) Player 1
Condition 2: Accumulate Attribute: (101 Food) Player 3
Effect 1: Tribute (1 Nova) (Player 1 to GAIA)
Effect 2: Tribute (1 Food) (Player 3 to GAIA)

This simply keeps the force from going over the pool. Player 3 actually hold the force power. Use an Ultimate RPG AI for that player. This is very likely to be buggy at first, but most of your problems will be in simply getting the powers active.

Now I've established a system in the AI so now we have an idea of what we want to do; we have a script of AI; now we need to make the in game triggers. Assign the AI to player 2 for the instance.

Lets analyze what our AI does. Every time our force player ( Player 2) notices player 1 taunt 11, this ai script activates. If the force player has 60 or more food, which is our force power, it will add 11 nova and 245 metal, which is ore. However, if the force power player has 59 food or less, 1 carbon is added to the pool. Knowing this allows us to make interesting results.


Trigger (Force Power Failure)
Starting Status: ON
Looping: YES
Condition 1: Timer 2
Condition 2: Accumulate Attribute (Carbon 1) (Player 2)
Effect: Tribute (Carbon 1) (Player 2 to GAIA)
Effect: Display Instructions (2) “<ORANGE>Insufficient Force”

Now if we dont have enough force power, it will display insufficient force.

Trigger (Force Camouflage)
Starting Status: ON
Looping: NO
Condition 1: Accumulate Attribute (11 Nova) (Player 2)
Condition 2: Accumulate Attribute (255 Ore) (Player 2)
Effect: Tribute (Nova 1000) (Player 2 to GAIA)
Effect: Tribute (Ore 1000) (Player 2 to GAIA)
Effect: Tribute (Food 60) (Player 3 to GAIA)
Effect: Tribute (Nova 60) (Player 1 to GAIA)
Effect: Display Instructions (2) “<ORANGE>Force Camouflage”
Effect: Activate Trigger: “Trigger (Force Camouflage)<Expired>
Effect: Deactivate Trigger: “Trap A”
Effect: Deactivate Trigger: “Trap B”
Effect: Deactivate Trigger: “Event A”


Trigger (Force Camouflage)<Expired>
Starting Status: OFF
Looping: NO
Condition 1: Timer 40
Effect: Activate Trigger: “Trap A”
Effect: Activate Trigger: “Trap B”
Effect: Activate Trigger: “Event A”
Effect: Display Instructions: "Force Camouflage lost."

Ok, translation. While in Force Camouflage, Trap A and B will not work and Event A will not happen. And of course if you have a conversation trigger, the opening trigger for each conversation should have an added effect:

Effect: Deactivate Trigger: “Trigger (Force Camouflage)<Expired>
Effect: Activate Trigger: “Trigger (Force Camouflage)

In this way, every conversation started in the 40 second time limit will cancel the Force Camouflage effect. Another thing to realize in the power text is the ineffective against force users. This is probably the easiest thing to master. Make a trigger so that if your character goes near to where the player is at, the power fails. Basically:

TRIGGER (Force Camouflage) <Force User Negation>
Starting Status: OFF
Looping: NO
Condition 1: Bring Object to Object (Main Character using power to Jedi or Sith)
Effect: Deactivate Trigger "Force Camouflage" <Expired>
Effect: Activate Trigger "Trap 1" and ect.
Effect: Activate Trigger "Force Camouflage" or a timer before you can use it or something similar.
Effect: Display Instructions: "Force Camouflage lost." Make certain you notify the player when something changes.

Be sure if you do these additions that you activate them. And there are other tricks, like changing alliance of friend to enemy or something like that. Many possibilities are out there, and as with all of my guides, these are not rules only foundations of which to build upon. Now we’ve done the impossible, we’ve made a force power. And this is another trick brought to you by Leon Kennedy. More guides will come soon.

By the way, please feel free to ask questions about this guide or make a request for a future guide. I'll see what I can do.


~LEGEND~
(To Aid in Viewing)

AI Scripts are WHITE. Triggers are ORANGE. Text is BLUE.


~/~|~\~SEE OTHER GUIDES~/~|~\~


L E O N ___ K E N N E D Y ' S
Scenario Design Guide Part I ~ STORYLINE ~
Scenario Design Guide Part II ~ MINES ~
Scenario Design Guide Part III ~ FORCE POWERS ~
Scenario Design Guide Part IV ~ CONVERSATIONS ~


.:: L E O N K E N N E D Y ::.
"Sounds like he took some of the furniture when he left... and the carpet... and the drapes...and I wouldn't expect to get that deposit back."

A Scientist, A Virus,
And a Squad to Retrieve Them
ALPHA RED

[This message has been edited by Leon Kennedy (edited 10-12-2006 @ 03:13 PM).]

Replies:
posted 08-17-06 07:48 PM EDT (US)     1 / 7  
Cool guide, one thing: The link to the mines guide leads to the first guide.

" Well, I'll go back in time and prevent Ledger from ODing. If the movie is still as acclaimed, then I'll go back again, stop myself from stopping him, and let time proceed normally." - Moff Yittreas
"Map design is what you do in the scn editor, eye candy is the stuff I'm not allowed to link to on these forums." - The Legend
"Someone has to play the asshole in these type of threads." - Blackmoon

+1 Post Count
posted 08-18-06 05:11 AM EDT (US)     2 / 7  
Nice guide, but you made things more difficult than they could be. Taunt-tributing with AI script goals leads to less headaches when designing .

B e n d e r s . . . © 2004

ex SWGBH scn designer
ex BFME2H cherub
posted 08-18-06 11:28 AM EDT (US)     3 / 7  
@ Batman: Nice catch. I thought I might have messed it up, but I thought I had corrected that. Thank you.

Corrected.

@ Bendak: I am curious. What is the simpler way? If you would, please post.

posted 08-18-06 11:44 AM EDT (US)     4 / 7  
any time.

" Well, I'll go back in time and prevent Ledger from ODing. If the movie is still as acclaimed, then I'll go back again, stop myself from stopping him, and let time proceed normally." - Moff Yittreas
"Map design is what you do in the scn editor, eye candy is the stuff I'm not allowed to link to on these forums." - The Legend
"Someone has to play the asshole in these type of threads." - Blackmoon

+1 Post Count
posted 08-18-06 05:57 PM EDT (US)     5 / 7  
Well, you are using this thing:
(food-amount >= 60)
which I generally don't like because it's tedious. I'm more a fan of activating the script with an AI script goal (the effect), then using simple taunt-tributing to establish your goal. Instead of changing the food amount, you simply send an AI script goal to deactivate the whole stuff again. That's just my opinion because I don't like tedious triggers (*headaches from HL's weapon system*).

Before changing your guide I'd suggest you first try that out... Ultimate RPG AI uses it and can help .


B e n d e r s . . . © 2004

ex SWGBH scn designer
ex BFME2H cherub

[This message has been edited by Bendak (edited 08-18-2006 @ 06:02 PM).]

posted 08-18-06 07:11 PM EDT (US)     6 / 7  
Meh in my experience using the tributes its faster, and more effective than signals anyday.

But it's really sort of a preference thing.

[This message has been edited by Blackmoon (edited 08-18-2006 @ 08:24 PM).]

posted 08-19-06 04:00 AM EDT (US)     7 / 7  
You get it wrong. There's a difference between signals and AI script goals (backward signals). I do use the taunt-tributing stuff, read my post.

B e n d e r s . . . © 2004

ex SWGBH scn designer
ex BFME2H cherub
SWGB Heaven » Forums » Scenario Design » Leon Kennedy's Scenario Guide Part III
Top
You must be logged in to post messages.
Please login or register
Hop to:    
SWGB Heaven | HeavenGames