Forums
Games
Cyberpunk 2077 Thronebreaker: The Witcher Tales GWENT®: The Witcher Card Game The Witcher 3: Wild Hunt The Witcher 2: Assassins of Kings The Witcher The Witcher Adventure Game
Jobs Store Support Log in Register
Forums - CD PROJEKT RED
Menu
Forums - CD PROJEKT RED
  • Hot Topics
  • NEWS
  • GENERAL
    THE WITCHER ADVENTURE GAME
  • STORY
    THE WITCHER THE WITCHER 2 THE WITCHER 3 THE WITCHER TALES
  • GAMEPLAY
    THE WITCHER THE WITCHER 2 THE WITCHER 3 MODS (THE WITCHER) MODS (THE WITCHER 2) MODS (THE WITCHER 3)
  • TECHNICAL
    THE WITCHER THE WITCHER 2 (PC) THE WITCHER 2 (XBOX) THE WITCHER 3 (PC) THE WITCHER 3 (PLAYSTATION) THE WITCHER 3 (XBOX) THE WITCHER 3 (SWITCH)
  • COMMUNITY
    FAN ART (THE WITCHER UNIVERSE) FAN ART (CYBERPUNK UNIVERSE) OTHER GAMES
  • RED Tracker
    The Witcher Series Cyberpunk GWENT
THE WITCHER
THE WITCHER 2
THE WITCHER 3
MODS (THE WITCHER)
MODS (THE WITCHER 2)
MODS (THE WITCHER 3)
Menu

Register

question to get a idea of how scripting works in the redkit

+
C

Cador

Senior user
#1
May 17, 2013
question to get a idea of how scripting works in the redkit

Hello,

lets say i want to make a monster that attacks the player when he enters a room, and stops combat when its hp drops below 10.

i came from nwn modding so i´m used to event based scripting.
in nwn i would paint a trigger on the ground an would put an attack script in the "onenter" event.
then i would put a script that checks the hp of the monster in the "onhit" event of the monster.

how would this work in the redkit?

i know it is perhaps a stupid question, but i want to get the basic idea.

thx for help!
 
Benzenzimmern

Benzenzimmern

CD PROJEKT RED
#2
May 17, 2013
It is always good to look in existing scripts from The Witcher 2. They use their own scripting language, so it's best to try and copy how they worked.
I guess you need to combine a trigger and your script in the quest editor.
 
I

iniside

Senior user
#3
May 17, 2013
It similiar to Unreal Script. State and Event based along with OOP.
 
S

shak-otay

Senior user
#4
May 30, 2013
Cador said:
Hello,

lets say i want to make a monster that attacks the player when he enters a room,
Click to expand...
That's rather simple: place a monster in the room. (I made a Wiki sample for that).
You don't need a trigger as the monster will attack Geralt as soon as he's in its "range of perception". (This is what I experienced. If you want a "defined area", well then things are getting harder.)

and stops combat when its hp drops below 10.
Click to expand...
I wanted to import this feature to all the games I modded so far (G3, Risen etc.).
Because I always found it totally annoying monsters committing suicide. (Especially for such as goblins or trolls for example because of their supposed IQ, hehe.)
And I think even wolves would flee before they die except they are totally starved.
We'll need an event (as you stated) I guess.

edit: there's OnHitDamage() to be found in 3 of the REDkit scripts.
But I don't have any imagination how to script the monster to flee. (It won't open the door will it?:D Passing through it shouldn't disturb the immersion too much...but how get temporary rid of the door's collision shape?

And once it's outside where to flee to? We will have to define an "escape point" I think.

But first I'll try to cause the monster to flee...
 
Last edited: May 30, 2013
F

Fartuess.807

Forum veteran
#5
Jun 2, 2013
Cador said:
Hello,
lets say i want to make a monster that attacks the player when he enters a room, and stops combat when its hp drops below 10.
Click to expand...
I'm not sure if using witcherscript is required here. Probably messing with Quest and AI subeditors will be more than enough.
 
Share:
Facebook Twitter Reddit Pinterest Tumblr WhatsApp Email Link
  • English
    English Polski (Polish) Deutsch (German) Русский (Russian) Français (French) Português brasileiro (Brazilian Portuguese) Italiano (Italian) 日本語 (Japanese) Español (Spanish)

STAY CONNECTED

Facebook Twitter YouTube
CDProjekt RED Mature 17+
  • Contact administration
  • User agreement
  • Privacy policy
  • Cookie policy
  • Press Center
© 2018 CD PROJEKT S.A. ALL RIGHTS RESERVED

The Witcher® is a trademark of CD PROJEKT S. A. The Witcher game © CD PROJEKT S. A. All rights reserved. The Witcher game is based on the prose of Andrzej Sapkowski. All other copyrights and trademarks are the property of their respective owners.

Forum software by XenForo® © 2010-2020 XenForo Ltd.