Go Back   Savage 2: A Tortured Soul Forum > Savage 2 Modding

Notices

Savage 2 Modding Discussion of all things related to making mods of Savage 2

Reply
 
Thread Tools Display Modes
Old 01-05-2014, 10:03 PM   #351
rohezal

rohezal's Avatar
 
Join Date: Mar 2008
Posts: 2,610
Thanks: 112
Thanked 136 Times in 106 Posts
Default

Quote:
If these two tests passed, we have found a bridge.
So you don't hardcode the bridge id, but check if an object near the waypoints is a bridge?
__________________

http://xs229.xs.to/xs229/08295/image_get.php939.jpeg

I love VOIP
sing: "base, base, base, base, base, base, base"

Why only 15 year old girls? Since 4 Years, damn I'm doing something wrong...

One day I will find out who is responsible for the K2 scripting "language" and the modding "support". And then...

rohezal is offline   Reply With Quote
Old 01-05-2014, 10:26 PM   #352
Durwyn

 
Join Date: Jul 2011
Location: Belgium
Posts: 264
Thanks: 47
Thanked 67 Times in 54 Posts
Default

Quote:
Originally Posted by rohezal View Post
So you don't hardcode the bridge id, but check if an object near the waypoints is a bridge?
I'm using a proximity trigger to register every "prop", "building", "npc" when map is loaded.

//loading props
SpawnEntityAtEntity #GetScriptParam(spawnedindex)# Trigger_Proximity triggeronnpc 1 triggeronprop 1 triggeronbuilding 1 triggerradius 100000 triggerenter "set new_building_index #GetScriptParam(index)#;set new_building_type #GetType(|#new_building_index|#)#;Exec "/scripts/practice_init_addons/loading_props.cfg""

For every index found, if the index is a "Prop_Scenery", you do the two tests mentionned above:

Quote:
the index must pass two tests:

1) the index must have a height above ground of 295+
(e.g like Eden, Bunker, LostHills, ...)

if [posHeight_scenery < (posZ_scenery - 295)]

https://dl.dropboxusercontent.com/u/...ctBridge_1.jpg

2) The two waypoints must have a similar terrain height to the position Z of the index.

https://dl.dropboxusercontent.com/u/...ctBridge_2.jpg

If these two tests passed, we have found a bridge.
So yes, it's not hardcoded
__________________
Operating System: Windows 7 x64
Graphic card : Geforce GT 540M
RAM : 8gb
Savage2MapsAI
Durwyn is offline   Reply With Quote
Old 01-05-2014, 11:26 PM   #353
PetzI

PetzI's Avatar
 
Join Date: Jun 2007
Posts: 1,814
Thanks: 17
Thanked 72 Times in 50 Posts
Default

Wow, you are insane! Are you going to try to make bots include these bridges in their general path finding?
PetzI is offline   Reply With Quote
Old 01-05-2014, 11:51 PM   #354
Durwyn

 
Join Date: Jul 2011
Location: Belgium
Posts: 264
Thanks: 47
Thanked 67 Times in 54 Posts
Default

I tried but came back to a previous solution.

The problem is to know whether it's wise the cross the bridge to gain time or if it's useless.

And for that to know, well i have no idea ^^

This will do :P Though if he has multiples bridges to cross before reaching destination, it won't work.
__________________
Operating System: Windows 7 x64
Graphic card : Geforce GT 540M
RAM : 8gb
Savage2MapsAI
Durwyn is offline   Reply With Quote
Old 01-06-2014, 04:40 PM   #355
Old55

Old55's Avatar
 
Join Date: Jun 2009
Posts: 2,586
Thanks: 14
Thanked 428 Times in 209 Posts
Default

A* pathfinding in your future. Coding that in K2 may be....difficult
__________________
Old55 is offline   Reply With Quote
Old 01-07-2014, 05:49 PM   #356
Durwyn

 
Join Date: Jul 2011
Location: Belgium
Posts: 264
Thanks: 47
Thanked 67 Times in 54 Posts
Default

I will work on it later, i'm trying to improve the NPCs now. Adding most of their abilities in their .xml files, well if possible.

Avoiding snapcasts, i use attack "self" with a "projectile" setup, with a low radius to allow attacks to hit multiples targets (like if you melee in front of multiples enemies) and yet ensuring only in front enemies can be hit.

Once done, i want to make NPCs stats progressive over game. (for each enemy killed, etc, they gain more Health, armor, or increased damage, but not mana, since they don't use it)

And also change their apperances based on their levels

Well thats the plan :P
Unless you have other ideas :o

edit:

- Fixed bug with ChangeWorld command. Now if the command is executed, the mod will relaunch upon the new map loaded.
__________________
Operating System: Windows 7 x64
Graphic card : Geforce GT 540M
RAM : 8gb
Savage2MapsAI

Last edited by Durwyn; 01-08-2014 at 04:19 PM. Reason: ChangeWorld Fix
Durwyn is offline   Reply With Quote
The Following User Says Thank You to Durwyn For This Useful Post:
rohezal (01-08-2014)
Old 01-11-2014, 02:08 PM   #357
Durwyn

 
Join Date: Jul 2011
Location: Belgium
Posts: 264
Thanks: 47
Thanked 67 Times in 54 Posts
Default

From this monday onwards, i will be back to work (real one )

Progress will take more time than already haha

-----

Updated script attack_player in case NPC attacked us:

Quote:
if #StringEquals(|#methodused|#,Unknown)# "goto npc_attacked"
goto end
@npc_attacked
set type_enemy #pet_type_|#enemy_attackingindex|##
goto #type_enemy#
// neutral_NPC
goto end

//Don't block If ...
@behemoth
goto end
@batteringram
goto end
@tempest
goto end
@steambuchet
goto end
@engineer
If [damagereceived <= 10] "goto end"
goto continue
@conjurer
If [(damagereceived >= 63) & (damagereceived <= 75)] "goto end"
goto continue
@chaplain
If [(damagereceived >= 50) & (damagereceived <= 63)] "goto end"
goto continue
@shaman
goto continue
@legionnaire
If [(damagereceived >= 63) & (damagereceived <= 82)] "goto end"
goto continue
@predator
goto continue
@savage
If [(damagereceived >= 8) & (damagereceived <= 9)] "goto end"
goto continue
@hunter
goto continue
@marksman
If [(damagereceived >= 62) & (damagereceived <= 77)] "goto end"
goto continue
@shapeshifter
goto continue

@continue
//are we blocking or not?
createvar int block_yesno #block_yesno_|#attackedindex|##
if [block_yesno == 0] "goto end"

CastSpell #enemy_attackingindex# Spell_BladeWind
CastSpell #attackedindex# Spell_SummonWorker

Set _health #GetHealth(|#attackedindex|#)#
SetHealth #attackedindex# [_health + damagereceived]
@end
I tried to incorporate your angles calculs Rohezal, however, only SetAngles is available, GetAngles doesn't exit.

Should i use GetPitch, GetYaw or GetRoll?
(i don't really know the difference.. maybe you do )

----

Shapeshifter blind ability added to .xml
Behemoth stomp ability added to .xml

----

Using "Choose" function to determine which kind of pet to spawn.

Quote:
//Random number from 0 to 20
set random_number [(rand * 20) + 1]
if [random_number == 21] "set random_number 20"

//Check tech buildings with corresponding random_number

set TechIVbuilt1_name engineer

if #EntityExists(|#TechIVbuilt1|#)# "Set tech #IsEntityActive(|#TechIVbuilt1|#)#; if [(tech == 1) & (random_number == 3)] \"set TechIVbuilt1_name batteringram\";if [(tech == 1) & (random_number == 4)] \"set TechIVbuilt1_name steambuchet\""

set TechIIbuilt1_name engineer

if #EntityExists(|#TechIIbuilt1|#)# "Set tech #IsEntityActive(|#TechIIbuilt1|#)#; if [(tech == 1) & (random_number == 5)] \"set TechIIbuilt1_name chaplain\";if [(tech == 1) & (random_number == 6)] \"set TechIIbuilt1_name chaplain\""

set HS_T1built1_name marksman

if #EntityExists(|#HS_T1index|#)# "Set tech #IsEntityActive(|#HS_T1index|#)#; if [(tech == 1) & (random_number == 9)] \"set HS_T1built1_name revenant\";if [(tech == 1) & (random_number == 10)] \"set HS_T1built1_name malphas\""

set TechIIIbuilt1_name savage

if #EntityExists(|#TechIIIbuilt1|#)# "Set tech #IsEntityActive(|#TechIIIbuilt1|#)#; if [(tech == 1) & (random_number == 17)] \"set TechIIIbuilt1_name legionnaire\";if [(tech == 1) & (random_number == 18)] \"set TechIIIbuilt1_name legionnaire\";if [(tech == 1) & (random_number == 19)] \"set TechIIIbuilt1_name legionnaire\";if [(tech == 1) & (random_number == 20)] \"set TechIIIbuilt1_name legionnaire\""

//Pick a type to spawn among the 4
set random_float [rand * 4]
createvar int random_type #random_float#
//In case [rand] returned 1
if [random_type == 4] "set random_type 3"
//Number chosen, -1, 0, 1, 2
set random_type [random_type - 1]

//Choose which type to spawn
set practice_enemy_name #Choose(|#random_type|#,|#TechIVbuilt1_name|#,|#Te chIIbuilt1_name|#,|#HS_T1built1_name|#,|#TechIIIbu ilt1_name|#)#
Got rid of Random.cfg, Random_human & Random_beast scripts.
__________________
Operating System: Windows 7 x64
Graphic card : Geforce GT 540M
RAM : 8gb
Savage2MapsAI
Durwyn is offline   Reply With Quote
Old 01-11-2014, 02:19 PM   #358
PetzI

PetzI's Avatar
 
Join Date: Jun 2007
Posts: 1,814
Thanks: 17
Thanked 72 Times in 50 Posts
Default

http://1.bp.blogspot.com/_nibSxQl2aC...wPitchRoll.jpg
PetzI is offline   Reply With Quote
Old 01-18-2014, 10:46 AM   #359
KillM3

 
Join Date: Jan 2014
Posts: 1
Thanks: 0
Thanked 2 Times in 1 Post
Default

Update ur AI map.
KillM3 is offline   Reply With Quote
The Following 2 Users Say Thank You to KillM3 For This Useful Post:
Durwyn (01-19-2014), rohezal (01-21-2014)
Old 01-19-2014, 06:19 PM   #360
Durwyn

 
Join Date: Jul 2011
Location: Belgium
Posts: 264
Thanks: 47
Thanked 67 Times in 54 Posts
Default

Welcome to this project :P

I wanna hear your thoughts if possible.

new stable version is available
__________________
Operating System: Windows 7 x64
Graphic card : Geforce GT 540M
RAM : 8gb
Savage2MapsAI
Durwyn is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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



All times are GMT. The time now is 04:36 PM.