| View previous topic :: View next topic |
| Author |
Message |
Zefz Lead Designer


Joined: 16 Sep 2007 Posts: 2301 Location: Norway
|
Posted: Mon Jan 21, 2008 7:53 am Post subject: |
|
|
| Quote: | | Oh, I forgot! We need functions that check if the date or time is at something specific. Can we do that very easily or no? |
Yeah should be fairly easy. We need to make a check for the system time or the like.
| Quote: | I wouldn't know...
Anyway, is it possible to change the top running speed of a given mountable to something higher when a character who has a special ability? |
The fastest way I can think of is give the mount a 75% speed when having a unskilled rider and 100% with a skilled one.
| Code: |
SetTargetToRider
tmpargument = YOURSKILL
IfTargetHasSkill
Run //100%
Else
Walk //66%
Else
Walk //66%
|
_________________ http://egoboo.sourceforge.net
"The pen is mightier than the sword- IF it is sharpened, dipped in poison and thrown really really hard at your target. But seriously, you are better off with a sword." |
|
| Back to top |
|
 |
woodmouse Skinner


Joined: 19 Apr 2008 Age: 13 Posts: 3061 Location: Finland
|
Posted: Sun Apr 20, 2008 4:06 pm Post subject: |
|
|
What's wrong with this script (it's the peasants of the Vampyre starter module)? I mean, I looked the Parseerr but there just read that:
modules/vampyre.mod/objects/peasant.obj/script.txt - KillPlayer undefined
modules/vampyre.mod/objects/peasant.obj/script.txt - AttackMadly undefined
modules/vampyre.mod/objects/peasant.obj/script.txt - Attack undefined
modules/vampyre.mod/objects/peasant.obj/script.txt - Attack undefined
modules/vampyre.mod/objects/peasant.obj/script.txt - Attack undefined
modules/vampyre.mod/objects/peasant.obj/script.txt - Attack undefined
The peasant's script:
//The states
//0: Walking around the city
//1: Attack to the player
//2: In combat go mad
// Get mean if characters wanna be bad
IfAttacked
KillPlayer
AttackMadly //Go mad!
JoinGoodTeam
tmpargument = 2
SetState
IfCalledForHelp
JoinGoodTeam
Attack
IfSpawned
tmpargument = rand % 4 //Randomize skin
ChangeArmor
Attack //Kill the player!
//------------------------------------------------------------------------------
// ZZ> Handle normal state
IfTimeOut
tmpargument = 80 + rand & 200
SetTime
//ATTACK PLAYER
IfStateIs0
tmpx = rand & 2024 - 1012 + selfx
tmpy = rand & 2024 - 1012 + selfy
tmpturn = rand & 512 - 256 + selfturn
Compass
ClearWaypoints
AddWaypoint
SetTargetToNearbyEnemy //Enemy near, go combat mode
tmpargument = 2
SetState
tmpargument = 50
SetTime
Attack
//IDLE OR RETURN TO START
IfStateIs1
tmpx = selfspawnx //Just attack the player
tmpy = selfspawny
ClearWaypoints
AddWaypoint
SetTargetToNearbyEnemy //Enemy near, go combat mode
tmpargument = 2
SetState
tmpargument = 50
SetTime
Attack
//IN COMBAT
IfStateIs2
SetTargetToNearbyEnemy
IfFacingTarget //Scooch around randomly
tmpx = targetdistance
tmpy = 100
IfXIsLessThanY
tmpargument = LATCHRIGHT
PressLatchButton
Else
tmpx = targetx //Get in combat position
tmpy = targety
tmpturn = targetturnto
tmpdistance = 200
Compass
ClearWaypoints
AddWaypoint
Else
tmpargument = 0
SetState
tmpargument = 60
SetTime
//What to do if bumped
IfBumped
SetTargetToWhoeverBumped
IfTargetIsOnHatedTeam
IfFacingTarget //Attack player
tmpargument = LATCHRIGHT
PressLatchButton
Else
tmpx = targetx //Move towards enemy
tmpy = targety
ClearWaypoints
AddWaypoint
Else
tmpx = rand & 511 - 256 + selfx //Scooch around the player
tmpy = rand & 511 - 256 + selfy
tmpdistance = 100
tmpturn = targetturnto + 32768
Compass
ClearWaypoints
AddWaypoint
SetTargetToOldTarget
//------------------------------------------------------------------------------
End
//------------------------------------------------------------------------------
And I have another question: How could I make there a bat that would follow the player all the time? _________________

Last edited by woodmouse on Sun Apr 20, 2008 4:26 pm; edited 1 time in total |
|
| Back to top |
|
 |
Clonkinator Master Frying Pen (Moderator)


Joined: 03 Nov 2007 Age: 15 Posts: 3074 Location: Germany
|
Posted: Sun Apr 20, 2008 4:10 pm Post subject: |
|
|
"KillPlayer" and "AttackMadly", as well as "Attack" don't exist. That's why.  _________________ Yes, it's true. I fail. Epicly so. |
|
| Back to top |
|
 |
woodmouse Skinner


Joined: 19 Apr 2008 Age: 13 Posts: 3061 Location: Finland
|
Posted: Sun Apr 20, 2008 4:15 pm Post subject: |
|
|
Oh, but they attack madly... But how could I make them to attack JUST the player? I mean, that they shouldn't run in the city, just attack. _________________
 |
|
| Back to top |
|
 |
Chainsaw Lumberjack


Joined: 20 Oct 2007 Age: 15 Posts: 2378 Location: Israel
|
Posted: Sun Apr 20, 2008 5:09 pm Post subject: |
|
|
| Clonkinator wrote: | "KillPlayer" and "AttackMadly", as well as "Attack" don't exist. That's why.  |
He never used those commands, they were comments. _________________ "To err is human, to really mess up requires a computer."
Chainsaw's Cell [Last update: 27th May '08]
 |
|
| Back to top |
|
 |
Clonkinator Master Frying Pen (Moderator)


Joined: 03 Nov 2007 Age: 15 Posts: 3074 Location: Germany
|
Posted: Sun Apr 20, 2008 6:36 pm Post subject: |
|
|
| Chainsaw wrote: | | Clonkinator wrote: | "KillPlayer" and "AttackMadly", as well as "Attack" don't exist. That's why.  |
He never used those commands, they were comments. |
No, they weren't commented out. It makes sense with the log output, too. _________________ Yes, it's true. I fail. Epicly so. |
|
| Back to top |
|
 |
woodmouse Skinner


Joined: 19 Apr 2008 Age: 13 Posts: 3061 Location: Finland
|
Posted: Sun Apr 20, 2008 6:38 pm Post subject: |
|
|
What should I script there? _________________
 |
|
| Back to top |
|
 |
penguinflyer5234 Penguin King

Joined: 01 Feb 2008 Age: 15 Posts: 1669 Location: Somewhere
|
Posted: Sun Apr 20, 2008 7:12 pm Post subject: |
|
|
KillPlayer: You could do:
| Code: |
IfAttacked
SetTargetToWhoeverAttacked
tmpargument = 4096 // 16 life points!
DamageTarget
|
_________________ You really thought so, didn't you?
Donna Noble has left the library. Donna Noble has been saved. |
|
| Back to top |
|
 |
woodmouse Skinner


Joined: 19 Apr 2008 Age: 13 Posts: 3061 Location: Finland
|
Posted: Sun Apr 20, 2008 7:16 pm Post subject: |
|
|
On the every place where it is?  _________________
 |
|
| Back to top |
|
 |
Clonkinator Master Frying Pen (Moderator)


Joined: 03 Nov 2007 Age: 15 Posts: 3074 Location: Germany
|
Posted: Sun Apr 20, 2008 7:19 pm Post subject: |
|
|
| penguinflyer5234 wrote: | KillPlayer: You could do:
| Code: |
IfAttacked
SetTargetToWhoeverAttacked
tmpargument = 4096 // 16 life points!
DamageTarget
|
|
What? You want the player to take 16 points of damage if he hits an enemy!?  _________________ Yes, it's true. I fail. Epicly so. |
|
| Back to top |
|
 |
penguinflyer5234 Penguin King

Joined: 01 Feb 2008 Age: 15 Posts: 1669 Location: Somewhere
|
Posted: Sun Apr 20, 2008 7:20 pm Post subject: |
|
|
There is only one place where KillPlayer is in that script. _________________ You really thought so, didn't you?
Donna Noble has left the library. Donna Noble has been saved. |
|
| Back to top |
|
 |
woodmouse Skinner


Joined: 19 Apr 2008 Age: 13 Posts: 3061 Location: Finland
|
Posted: Sun Apr 20, 2008 7:23 pm Post subject: |
|
|
I want the peasants to attack like the wizard shop's Zambini. No magic, but the rage of the attacks and they would just run and be wise, like they wouldn't stuck in the walls. How could I make it? _________________
 |
|
| Back to top |
|
 |
Zefz Lead Designer


Joined: 16 Sep 2007 Posts: 2301 Location: Norway
|
Posted: Sun Apr 20, 2008 9:39 pm Post subject: |
|
|
Kill the current target of the peasant
Make the peasant attack
| Code: |
IfTargetIsOnHatedTeam
IfFacingTarget
tmpx = targetdistance
tmpy = 200
IfXIsLessThanY
tmpargument = LATCHRIGHT
PressLatchButton
|
This is a very normal way to make AI attack enemies that are nearby and facing him. (uses right hand to attack) _________________ http://egoboo.sourceforge.net
"The pen is mightier than the sword- IF it is sharpened, dipped in poison and thrown really really hard at your target. But seriously, you are better off with a sword." |
|
| Back to top |
|
 |
woodmouse Skinner


Joined: 19 Apr 2008 Age: 13 Posts: 3061 Location: Finland
|
Posted: Mon Apr 21, 2008 1:28 pm Post subject: |
|
|
Uhm... Zefz... That script you posted... IT MAKES THE PLAYER DIE!!! I mean, if I attack them, the player just dies... _________________
 |
|
| Back to top |
|
 |
Zefz Lead Designer


Joined: 16 Sep 2007 Posts: 2301 Location: Norway
|
Posted: Mon Apr 21, 2008 1:29 pm Post subject: |
|
|
Yes it was what you asked for. _________________ http://egoboo.sourceforge.net
"The pen is mightier than the sword- IF it is sharpened, dipped in poison and thrown really really hard at your target. But seriously, you are better off with a sword." |
|
| Back to top |
|
 |
|