Home   Help Search Login Register  

Author Topic: Syntax (yeah, i KNow!)  (Read 1812 times)

0 Members and 1 Guest are viewing this topic.

Offline Roni

  • Members
  • *
  • Play the Game !
Re:Syntax (yeah, i KNow!)
« Reply #15 on: 14 Sep 2005, 05:16:39 »
If that's true then "~pauses" are linked to script cycles and not the PC clock.  This could lead to all sorts of grief !

I remember my first draft of a time dilation script that I wrote (all fixed now !).  At first, all I did was write a simple "skipTime _delay, ~1" loop, then discovered that the faster computers were actually travelling through time faster !  I was getting sunset for some players and sunrise for others !

I fixed it by having the server action the skipTime then shout the new game time (_hostTime) to the network via a publicVariable declaration.  The client machines versions of the script simply caught this variable and skipped forward just enough to catch up (skipTime (_hostTime - daytime).

Intersting to see that the actual loop times might also have been different too ("My ~10 is faster than your ~10 !")!



Roni



funkster

  • Guest
Re:Syntax (yeah, i KNow!)
« Reply #16 on: 14 Sep 2005, 09:22:58 »
on the contrary funkster, what YOU are suggesting is absolutely impossible. event handlers don't just fire because the tank was able to, or was told to, they fire because the tank fires, and only when it fires, no more, no less. if the time slows before the tank fires there IS SOMETHING ELSE causing it.

more importantly, if someone trys to answer the problem that YOU COULDN'T SOLVE, never, NEVER throw it back in their face. out of sheer respect for the people trying to help you, even if their idea or attempt doesn't work, you THANK them, because if they didn't try to help you, you'd never figure it out.


here's a suggestion:
show us the mission, so we can see for ourselves what is happenning, and end this useless bickering

Kyle:
First off, sorry Kyle if you thought I was being rude, I was not, only impatient. There was no offence intended.
As for the time, I know that the time is not the same, I put ~ 0.8 because Iwanted 8seconds of slow mo. What i am getting is around 15- 30 seconds, now in normal time, 1.5 - 3 seconds is a long time to wait for a unit to fire once it is supposed to...


Triggerhappy:
 talk about overreacting buddy! thanks, my ears are ringing!
 Frankly, the only reason I wrote something like that was because Kyle wrote "never assume, it makes an ass out of u and me" which I thought was rather rude - I was only asking a question after all.

Yeah I was a bit out of line there, but still,
There was no need to come down so harsh about the whole thing - I found it rather patronising actually...

"On the contrary, what you are suggesting is impossible..."?

I never said anything was impossible?

Yes, you are probably all right, I was probably wrong, Im about to go and check my script. I do appreciate all the help that people give in this forum - very much!

 ;D

-----------------------------------

EDIT:

Like I said, Ill go and check the script to see if something else is causing the slow down, if not, then Ill post the miission, but I dont know where to host it, its around 5MB.
« Last Edit: 14 Sep 2005, 09:35:00 by funkster »

funkster

  • Guest
Re:Syntax (yeah, i KNow!)
« Reply #17 on: 14 Sep 2005, 10:05:55 »
Hi again,

I have checked the script, its not something that is happening there, from what I can see, Ill post all the script towards the end (the relevant section) here so you can see. If anyone knows where I can host a 5MB or so mission, then Ill post a link to it.

>>
Code: [Select]
~ 2

_cam camsetrelpos [35, -18, 11]
_cam camsetFOV 0.73
_cam camcommit 7

WAfour doTarget EMtwelve
WAfour selectWeapon "HEAT120"
~ 1.4

WAfour addeventhandler ["fired",{_this exec "fired.sqs"}]

~ 0.1

WAfour doFire EMtwelve
WAfour setBehaviour "COMBAT"
WAthree setBehaviour "COMBAT"



~ 1.1

EMseven setCombatMode "RED"
EMeight setCombatMode "RED"
EMnine setCombatMode "RED"
EMten setCombatMode "RED"
EMeleven setCombatMode "RED"
EMtwelve setCombatMode "RED"

WAthree setCombatMode "RED"
WAfour setCombatMode "RED"

WAfour doMove getPos EMseven
WAthree doMove getPos EMtwelve



_cam camsettarget getPos EMnine
_cam camsetrelpos [0, 0, 200]
_cam camsetFOV 0.7
_cam camcommit  43

~ 30

titlecut [" ","BLACK OUT", 4]
5 fadeSound 0
5 fadeMusic 0

WAthree saveStatus "a1stat"
WAfour saveStatus "a2stat"




exit


Any ideas?

Thanks.

Kyle Sarnik

  • Guest
Re:Syntax (yeah, i KNow!)
« Reply #18 on: 14 Sep 2005, 21:09:41 »
Hi again,

I have checked the script, its not something that is happening there, from what I can see, Ill post all the script towards the end (the relevant section) here so you can see. If anyone knows where I can host a 5MB or so mission, then Ill post a link to it.

>>
Code: [Select]
~ 2

_cam camsetrelpos [35, -18, 11]
_cam camsetFOV 0.73
_cam camcommit 7

WAfour doTarget EMtwelve
WAfour selectWeapon "HEAT120"
~ 1.4

WAfour addeventhandler ["fired",{_this exec "fired.sqs"}]

~ 0.1

WAfour doFire EMtwelve
WAfour setBehaviour "COMBAT"
WAthree setBehaviour "COMBAT"



~ 1.1

EMseven setCombatMode "RED"
EMeight setCombatMode "RED"
EMnine setCombatMode "RED"
EMten setCombatMode "RED"
EMeleven setCombatMode "RED"
EMtwelve setCombatMode "RED"

WAthree setCombatMode "RED"
WAfour setCombatMode "RED"

WAfour doMove getPos EMseven
WAthree doMove getPos EMtwelve



_cam camsettarget getPos EMnine
_cam camsetrelpos [0, 0, 200]
_cam camsetFOV 0.7
_cam camcommit  43

~ 30

titlecut [" ","BLACK OUT", 4]
5 fadeSound 0
5 fadeMusic 0

WAthree saveStatus "a1stat"
WAfour saveStatus "a2stat"




exit


Any ideas?

Thanks.


Make sure that WAfour doesn't fire ANY weapons after it is given the eventhandler and before you want him to, because that will set off the eventhandler (grenade throwing, and placing of mines and satchel charges counts as firing too).

funkster

  • Guest
Re:Syntax (yeah, i KNow!)
« Reply #19 on: 15 Sep 2005, 10:19:20 »
Thanks Kyle  :)

No, he is actually set to CombatMode "BLUE", so there's no chance of him firing before he is told to.

You can see why I think that the fire EH is being set off before it actually fires right....? I mean, what else could it be?

-----------------------------------------------
O, btw,
WA refers to West Armour - M1A1s,

While EM refers to East Man,

so the situation is im waiting for the M1A1 to fire a HEAT at a Ruski solder.
« Last Edit: 15 Sep 2005, 10:21:59 by funkster »

Kyle Sarnik

  • Guest
Re:Syntax (yeah, i KNow!)
« Reply #20 on: 15 Sep 2005, 20:48:11 »
Well, having stumped me, there is only one thing left to do. Attach the mission (in a .rar or .zip file) to a post (the Attach: box down at the bottom) so I can take a look at everything.

Merc

  • Guest
Re:Syntax (yeah, i KNow!)
« Reply #21 on: 16 Sep 2005, 03:51:22 »
funkster, you should probably put a wait until thing ,@, somewhere in there to wait until the fired script is done.

And I have 2 questions:

1. How long does it take for a heat to reload?
Because that might have something to do with it.

2. Does the fire EH simulate firing as in the bullet leaving the chamber (tank shell in the barrel) or pulling the trigger (clicking the mouse while reloading and because of the reloading no bullet comes out)?

funkster

  • Guest
Re:Syntax (yeah, i KNow!)
« Reply #22 on: 16 Sep 2005, 09:17:32 »
hmm, thanks guys.

Merc:
 thats what I was originally thinking.
Maybe its loading the HEAT...

But I didnt think that it could be the computer 'trying to fire' while the ammo aint loaded, that actually an interesting idea....but sounds unlikely.who knows?

as for the @ command, I dont understand how that would help... What exactly do you mean?

Kyle:

Id like to attach the mission, but I was saying before that its 5mb. If I find some site that will host downloads for free, then Ill post a link, but I dont know where would do that...

ANy0ne know of place?

Cheers.
« Last Edit: 16 Sep 2005, 09:22:35 by funkster »

Kyle Sarnik

  • Guest
Re:Syntax (yeah, i KNow!)
« Reply #23 on: 16 Sep 2005, 20:45:50 »
www.rapidshare.de

The @ command is a wait for command, its used just like a "?" except without the ":". For example:

Code: [Select]
_ammo = WAfour ammo "HEAT120"
@ WAfour ammo "HEAT120" < _ammo
<the rest of your script>

And as stated MANY times before, a fired EH can ONLY fire if the unit ACTUALLY fires, as in the weapon is able to fire and does succesfully fire. NO EXCEPTIONS.

Second, selectweapon will NOT work for Heat ammo, since it is a magazine not a weapon. The only way to make the AI to select Heat is remove all of his Sabot rounds (WAfour removemagazine "Shell120"), and if you want him to get it reloaded quickly, remove the weapon and add it again:


Code: [Select]
WAfour removeweapon "Gun120"
WAfour addweapon "Gun120"
WAfour selectweapon "Gun120"

I can't garuntee that it will make the reload instantanious, but it will make it shorter. You might want to set the units skill to 1 (all the way to the right) and call the above code at the begining of the scene.
« Last Edit: 16 Sep 2005, 20:48:20 by Kyle Sarnik »