Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Grant, AndrewAMD), 911 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
'Watch Tutorial' Contest (Win Intense X Copper) #242848
12/26/08 01:16
12/26/08 01:16
Joined: Jul 2004
Posts: 1,205
Greece
LarryLaffer Offline OP
Serious User
LarryLaffer  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,205
Greece
Hello everyone,

As I've mentioned in this thread, I've released a new tutorial for Intense X which allows programmers to easily create new goals and add them to the existing Intense X's AI with just one line of code. In an effort to create as much exposure as I can for this tutorial (I'm looking very forward for non-customers of Intense X to learn about the capabilities of Intense X for programmers and non-programmers alike) but because my tutorials are too long for someone to casually watch them fully (this Custom Goals tutorial is 1 hour and 8 minutes long), I'm giving the people who actually watch the tutorials the incentive of winning a free copy of Intense X.

At the very end of the tutorial, I ask one question. The question is this:

If I kill Jack, and Bill kills me, can you modify my code so that after Bill kills me he will play the Patrol Goal instead of the Guard goal that it currently plays at the end of this tutorial?

This contest is only for non-Intense X owners, and since there's no way to actually test your code, you are asked to simply PM me with the changes that you think you should make to my code (it's two very simple changes), so that the question above can be satisfied. Be the first to answer to me correctly and WIN a free copy of Intense X Copper.

When a winner is found, I'll post his name in here. Until I do, it means no winner has been found yet, so keep sending in your answers.

Cheers,
Aris


INTENSE AI: Use the Best AI around for your games!
Join our Forums now! | Get Intense Pathfinding 3 Free!
Re: 'Watch Tutorial' Contest (Win Intense X Copper) [Re: LarryLaffer] #243388
12/29/08 19:34
12/29/08 19:34
Joined: Jul 2004
Posts: 1,205
Greece
LarryLaffer Offline OP
Serious User
LarryLaffer  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,205
Greece
Hi all,

Sorry for the late response to all who've entered this competition. I didn't have access to my computer for the past few days so I couldn't post the results. I know I should have thought of that before starting a contest but, oh well.

I received 5 total entries, 2 of them were correct. That's Quadraxas and upsidedownman. Quadraxas however PMed me first which means he wins. Here's the correct answers:

Originally Posted By: Quadraxas
first i would change the *Value of Goal_FollowJack to 21.

and then, in patrol Goal, if would check if the sID is "Jack" or "Bill", *Value remains 20.
----------------- this all i would change in code.



Originally Posted By: upsidedownman
Would you change the lines in the patrol function like this

if(str_cmpi(sMyid,"Jack")) || ( str_cmpi(sMyid,"Bill"))
*Value = 19;
else *Value = 0;



Quadraxas, please PM me your e-mail address to send you your license information (I have a feeling the one you have in your profile is fake smirk ). And, well done! To be honest, I'll be very happy to have you in our little community, if you do get to use my software. I've read many of your posts here and I like the way you think and work.

upsidedownman, I can see you're new to GS so you should be quite proud since you answered a question right that the majority of entries didn't. A very well done to you..


While at it, I decided to correct the entries that got it wrong, in case you give a hoot.. Here goes:


Originally Posted By: basharsj
void Action_FollowJack(par1,par2,par3,par4)
{
ix_skill(my,is_bActionInProgress)=IS_TRUE;
/////////

if (id_to_ptr(par1) !=NULL ||eToFollow != NULL )
{
is_Action_Run_To_X_Neutral(0,0,0,id_to_ptr(par1));
while(is_IsActionRunning(is_cAction_MoveTo)) wait(1);
}
else
{
is_Action_Run_To_X_Neutral(550,390,110,NULL);
while(is_IsActionRunning(is_cAction_MoveTo)) wait(1);

is_Action_Run_To_X_Neutral(-650,50,110,NULL);
while(is_IsActionRunning(is_cAction_MoveTo)) wait(1);

is_Action_Run_To_X_Neutral(250,-530,110,NULL);
while(is_IsActionRunning(is_cAction_MoveTo)) wait(1);

}

/////////
ix_skill(my,is_bActionInProgress)=IS_FALSE;

}



A couple of errors here. Action_FollowJack would never get activated at all if Jack==NULL since in Goal_FollowJack it makes sure to set its value to 0 when that happens. Also, you don't have access to the eToFollow pointer from Action_FollowJack and finally, putting everything inside the FollowJack goal kinda ruins the whole 'Goal Oriented code' idea..


Originally Posted By: Gorverius
we need to add this code in to the Goal_Patrol function.

ENTITY* ejack;
STRING* sjack = str_create("Jack");
eJack = sId_to_ptr(sjack);
if(str_cmpi(sMyid, "Bill") && ix_skill(ejack, ix_health)<=0; )
{
*value = 20;
}
else
{
*value = 0;
}



You were very very close. But if we were adding that code, then the *value would be replaced later in that function by this line: [i]if(str_cmpi(sMyid,"Jack")) *Value=20; else *Value=0;[i], so instead you should have moved that line in your last else clause to make sure that Goal_Patrol calculates value correctly for both Jack and Bill. Also, if both Goal_Patrol and Goal_FollowJack have the same value (20) and since now both goals are available for Bill, one of the two would be randomly chosen and we don't want that..



Originally Posted By: GamerX
So i would either go to the goal patrol function and add another if statment like this
if(str_cmpi(sMyid,"Bill")) *Value = 15;
else *Value = 0;
If that didn't work i would try and add an or statement into the original Jack line like so,
if(str_cmpi(sMyid,"Jack") || str_cmpi(sMyid,"Bill"))
*Value = 20;
else *Value = 0;

But i am not so sure what will happen if two goals are at 20.



You were even closer.. All you had to do is change *Value to 19 instead of 20 like you pondered correctly at the end.. Don't beat yourself up though, Quadraxas would still win because he PMed me first.


Thanks to everyone who've watched my video and btw happy new years to everyone,

Cheers,
Aris

PS: I've now added a Hi-res and a downloadable version of the tutorial. Check it out.


INTENSE AI: Use the Best AI around for your games!
Join our Forums now! | Get Intense Pathfinding 3 Free!
Re: 'Watch Tutorial' Contest (Win Intense X Copper) [Re: LarryLaffer] #243402
12/29/08 20:43
12/29/08 20:43
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
PM sent.


3333333333

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1